  // function to show Record Modified By....
	
// JavaScript Document
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
/*document.write('<img id="dhtmlpointer" src="images/no_image.jpg" height="1" width="1" style="visibility:hidden">')*/ //write out pointer image

var ie=document.all
//alert(ie);
var ns6=document.getElementById && !document.all
//alert(ns6)
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
//alert(tipobj)
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 to show tooltip-----
	function show(thetext,thewidth, thecolor)
  {
			
			//alert("Hello");
			if (ns6||ie)
			{
			if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
			if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
			
			if(thetext!="")			
			{
				//tipobj.innerHTML="Last Modified By-- ";
				tipobj.innerHTML=thetext;
			enabletip=true
			}
			return false
  }
	}
  /* ###### Used in "emp/e_v_msg_view" (to show vender membership type) ##### */
	function show_mem_type(thetext,thewidth,thecolor)
  {
			if (ns6||ie)
			{
					if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
					if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
					
					if(thetext!="")			
					{
						//tipobj.innerHTML="Last Modified By-- ";
						tipobj.innerHTML=thetext;
						enabletip=true
					}
					return false
      }
	
	}
	/*--------------------------------------------------------------------------*/


function positiontip(e){
//alert(ietruebody())
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//alert(curX)
//alert(curY)
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
//alert(winwidth)
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 the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
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 hide(){
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  // to show tooltip-----
function video_window(videoName,url)
{
window.open('videoName',null,'resizable=0,toolbar=no,location=0,direction=no,status=no,menubar=no,scrollbars=0,width=600,height=400,left=200,top=150');
return false;
}

/*-------------function for contact us check------------*/
function check_frm(frm)
{	//alert(frm);
	if(frm==1)
	{
	var doc=document.form1;
	}
	else{
	var doc=document.form2;
	}
	if(doc.name.value=="")
	{
		alert("Name should not be blank!");
		doc.name.focus();
		return false;
	}
	else if(isNaN(doc.name.value)==false)
	{
		alert("Invalid name!");
		doc.name.select();
		return false;
	}
	else if(doc.name.value.charAt(0)==" ")
	{
		alert("Invalid first name!");
		doc.name.select();
		return false;
	}
	else if(doc.email.value=="")
		{
			alert("Email should not be blank!");
			doc.email.focus();
			return false;
		}

	    	//var doc = document.form1;
			var newtring = doc.email.value;		
			var search = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
			var regx = search.test(newtring); 

		if (regx == false)
		{
			alert ("Invalid Email!");
			doc.email.select();
			return false;			
		}	
	else if(doc.notes.value=="")
	{
		alert("Questions & Comments should not be blank!");
		doc.notes.focus();
		return false;
	}
	
}

/*------------------------------popup page js -------------------------*/

function showlaptop(theTable,abc)
{
	//	alert(document.getElementById(abc));
	//	window.resizeTo(775,510);
      if (document.getElementById(theTable).style.display == 'none')
      {
            document.getElementById(theTable).style.display = 'block';
			document.getElementById(abc).style.display = 'none';
      }
}
function hidelaptop(theTable,abc)
{	//	alert("asda");
      if (document.getElementById(theTable).style.display == 'none' )
      {
            document.getElementById(theTable).style.display = 'none';
			document.getElementById(abc).style.display = 'block';
	  }
      else
      {
            document.getElementById(theTable).style.display = 'none';
			document.getElementById(abc).style.display = 'block';
      }
}

function check()
{
	var doc = document.popup_frm;
	if(doc.message.value=="")
		{
			alert("Message should not be blank!");
			doc.message.focus();
			return false;
		}
	if(doc.message.value=="Explain What Help You Need Here!")
		{
			alert("Message should not be blank!");
			doc.message.select();
			return false;
		}	
	if(doc.name.value=="")
		{
			alert("Name should not be blank!");
			doc.name.focus();
			return false;
		}
	if(isNaN(doc.name.value) == false)
		{
			alert("Please Enter a Valid Name");
			doc.name.select();
			return false;
		}	
	if(doc.email.value=="")
		{
			alert("Email should not be blank!");
			doc.email.focus();
			return false;
		}

	    	var doc = document.popup_frm;
			var newtring = doc.email.value;		
			var search = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
			var regx = search.test(newtring); 

		if (regx == false)
		{
			alert ("Invalid Email!");
			doc.email.focus();
			return false;			
		}	
	if(doc.phone.value=="")
		{
			alert("Phone should not be blank!");
			doc.phone.focus();
			return false;
		}	
	if(isNaN(doc.phone.value) == true)
		{
			alert("Invalid Phone number!");
			doc.phone.select();
			return false;
		}	
}	

window.onerror = function () 
{
 return true;
}
function hide()
{
parent.agreewin.hide(); return false;
}
/*function write() {document.popup_frm.srch.value = "This is the stuff that goes into the textarea";}
function mywrite() {
form.txt1.focus();
form.txt1.value = "This is the stuff that goes into the textarea";
}*/
function clear_all()
{
document.popup_frm.srch.value="";
}
