/* Menu top */
	showtime = 0;
	function changtab(id,count,clear){
		for(i=0;i<=count;i++){
			try{
				document.getElementById('tab_'+i).className='tab_normal';
				document.getElementById('tabconten_'+i).style.display='none';
				$("#tabconten_"+id).hide();
			}
			catch(e){}			
		}
		document.getElementById('tab_'+id).className='tab_select';
		//document.getElementById().style.display='block';
		$("#tabconten_"+id).show();
	}
/* End */

/* Click to change tab */
function tabdiv(id,count){
	for(i=1;i<=count;i++){
		try{
			document.getElementById('tabt_'+i).className='n';
			document.getElementById('tabc_'+i).style.display='none';
		}
		catch(e){}			
	}
	document.getElementById('tabt_'+id).className='s';
	document.getElementById('tabc_'+id).style.display='block';
}
function tabdiv1(id,count){
	for(i=1;i<=count;i++){
		try{
			document.getElementById('tabg_'+i).className='n';
			document.getElementById('tabh_'+i).style.display='none';
		}
		catch(e){}			
	}
	document.getElementById('tabg_'+id).className='s';
	document.getElementById('tabh_'+id).style.display='block';
}
/* End */

/* Support website */
	function showContent(id){
		for(i=0;i<=2;i++){
			$("#show-content-"+i).css('display','none');
		}			
		var offset = $(".round").offset();
		$("#show-content-"+id).css({'display':'block','position':'absolute','right':offset.left});
	}
	function hideContent(id){
		$("#show-content-"+id).css('display','none');
	}
/* End */

/* Check sell sim*/
	function checkSellSim(){
		if(document.getElementById("ssim_sosim").value == ""){
			alert("Điền số sim"); document.getElementById("ssim_sosim").focus(); return;
		}
		if(document.getElementById("ssim_price").value == ""){
			alert("Điền giá sim"); document.getElementById("ssim_price").focus(); return;
		}
		if(document.getElementById("ssim_iCat").value == ""){
			alert("Chọn loại sim"); document.getElementById("ssim_iCat").focus(); return;
		}
		if(document.getElementById("ssim_phone").value == ""){
			alert("Điền số phone"); document.getElementById("ssim_phone").focus(); return;
		}
		if(document.getElementById("ssim_address").value == ""){
			alert("Điền địa chỉ"); document.getElementById("ssim_address").focus(); return;
		}
		if(document.getElementById("code").value == ""){
			alert("Điền mã bảo vệ"); document.getElementById("code").focus(); return;
		}
		if(document.getElementById("ssim_email").value.length > 0){
			if(!isemail(document.getElementById("ssim_email").value)){
				alert("Email not match");
				document.getElementById("ssim_email").focus();
				return;
			}
		}
	
		document.fSellSim.submit();
	}
/* End */

/* Check email */
	function isemail(email) {
		var re = /^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i;
		return re.test(email);
	}
/* End */


<!-- Tooltil from here -->
var offsetfromcursorX = 12;
var offsetfromcursorY = 10;
var offsetdivfrompointerX = 10;
var offsetdivfrompointerY = 14;

document.write('<div id="dhtmltooltip"></div>');
document.write('<img id="dhtmlpointer" src="/images/tooltiparrow.gif">');

var ie = document.all;
var ns6 = document.getElementById && ! document.all;
var enabletip = false;

if (ie || ns6) var tipobj = document.all ? document.all["dhtmltooltip"] : document.getElementById ? document.getElementById("dhtmltooltip") : "";

var pointerobj = document.all ? document.all["dhtmlpointer"] : document.getElementById ? document.getElementById("dhtmlpointer") : "";

function ietruebody() {
	return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function showtip(thetext, thewidth, thecolor) {
	if (ns6 || ie) {
		if (typeof thewidth != "undefined")
			tipobj.style.width = thewidth + "px";
		if (typeof thecolor != "undefined" && thecolor != "")
			tipobj.style.backgroundColor = thecolor;
		tipobj.innerHTML = thetext;		
		enabletip = true;
		return false;
	}
}

function positiontip(e) {
	if (enabletip) {		
		var nondefaultpos = false;
		var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
		var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
		
		var winwidth = ie && ! window.opera ? ietruebody().clientWidth : window.innerWidth - 20;
		var winheight = ie && ! window.opera ? ietruebody().clientHeight : window.innerHeight - 20;

		var rightedge = ie && ! window.opera ? winwidth - event.clientX - offsetfromcursorX : winwidth - e.clientX - offsetfromcursorX;
		var bottomedge = ie && ! window.opera ? winheight - event.clientY - offsetfromcursorY : winheight - e.clientY - offsetfromcursorY;

		var leftedge = (offsetfromcursorX < 0) ? offsetfromcursorX * (- 1) : - 1000;

		if (rightedge < tipobj.offsetWidth) {
			tipobj.style.left = curX - tipobj.offsetWidth + "px";
			nondefaultpos = true;
		}
		else if (curX < leftedge)
			tipobj.style.left = "5px";
		else {
			tipobj.style.left = curX + offsetfromcursorX - offsetdivfrompointerX + "px";
			pointerobj.style.left = curX + offsetfromcursorX + "px";
		}

		if (bottomedge < tipobj.offsetHeight) {
			tipobj.style.top = curY - tipobj.offsetHeight - offsetfromcursorY + "px";
			nondefaultpos = true;
		}
		else {
			tipobj.style.top = curY + offsetfromcursorY + offsetdivfrompointerY + "px";
			pointerobj.style.top = curY + offsetfromcursorY + "px";
		}

		tipobj.style.visibility = "visible";

		if (! nondefaultpos)
			pointerobj.style.visibility = "visible";
		else
			pointerobj.style.visibility = "hidden";
	}
}

function hidetip() {
	if (ns6 || ie) {
		enabletip = false;
		tipobj.style.visibility = "hidden";
		pointerobj.style.visibility = "hidden";
		tipobj.style.left = "-1000px";
		tipobj.style.backgroundColor = '';
		tipobj.style.width = '';
	}
}

document.onmousemove = positiontip;
<!-- Tooltip end here -->



