//ajax asp start---------------------------->
function getTip(tipid, referid, t_type){
// Gets the ToolTip content live from ASP and loads it into the document element 'tip'
// LiveASP technology allows javascript code to call any ASP server function and return its result.
	//alert(tipid + " " + referid + " " + t_type);
	show_info(tipid,t_type);
	ASPAjax.LiveASP('ToolTip("'+referid+'","' + t_type + '")',document.getElementById('tip'));
	//document.getElementById('tip').innerHTML = "hahahahaha";
}
function clearTip(){
	document.getElementById('tip').innerHTML="";
}

//document.onmousemove=function(e) {
function show_info(tipid, t_type) {
	var temp_y, temp_x, temp_prefix;
	if(t_type=='gv') {
		temp_y = 23;
		temp_x = -65;
		temp_prefix = "info";
	}
	else if(t_type=='treatment') {
		temp_y = 23;
		temp_x = -130;
		temp_prefix = "info";
	}
	else if(t_type=='salon') {
		temp_y = 30;
		temp_x = 30;
		temp_prefix = "salon";
	}

	var obj = document.getElementById(temp_prefix + tipid);
	var xx=0;
	var yy=0;
	xx = findPosX(obj);
	yy = findPosY(obj);
	var target = document.getElementById('tip');
	if (!target){return false;}

	target.style.position ="absolute";
	target.style.top =yy + temp_y + "px";
	target.style.left =xx + temp_x + "px";
}

// by Peter-Paul Koch & Alex Tingle.
function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
		while(1) 
		{
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
		  curtop += obj.offsetTop;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}

function change_mouse(e,flag) {
	if(flag==1) {
		e.style.cursor = 'pointer';
		e.style.color = '#ab905e';
		e.style.textDecoration = 'underline';
	}
	else {
		e.style.cursor = 'auto';
		e.style.color = '#0063b2';
		e.style.textDecoration = 'none';
	}
}
