if (!document.all)
document.captureEvents(Event.MOUSEMOVE)

// On the move of the mouse, it will call the function getPosition
document.onmousemove = getPosition;


// These varibles will be used to store the position of the mouse
var X = 0
var Y = 0

// This is the function that will set the position in the above varibles 
function getPosition(args) 
{
  // Gets IE browser position
  if (document.all) 
  {
    X = event.clientX + document.body.scrollLeft
    Y = event.clientY + document.body.scrollTop
  }
  
  // Gets position for other browsers
  else 
  {  
    X = args.pageX
    Y = args.pageY
  }  
}
function backgroundFilter()
{
    var div;
    
    if(document.getElementById)
    // Standard way to get element
    div = document.getElementById('backgroundFilter'); 
    else if(document.all) 
    // Get the element in old IE's 
    div = document.all['backgroundFilter']; 
    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display==''&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined)
    {
        div.style.display = (div.offsetWidth!=0&&div.offsetHeight!=0)?'block':'none'; 
    }
    
    // If the background is hidden ('none') then it will display it ('block').
    // If the background is displayed ('block') then it will hide it ('none').
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';
}

function popUp()
{
    var div;
    
    if(document.getElementById)
    // Standard way to get element
    div = document.getElementById('popupWindow'); 
    else if(document.all) 
    // Get the element in old IE's 
    div = document.all['popupWindow']; 
    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display==''&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined)
    {
        div.style.display = (div.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; 
    }
    
    // If the PopUp is hidden ('none') then it will display it ('block').
    // If the PopUp is displayed ('block') then it will hide it ('none').
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';
    
    // Off-sets the X position by 15px
    //X = X + 15;
    
    // Sets the position of the DIV
    div.style.left = '50%';/*'300px';*/
	div.style.marginLeft='-300px';
    div.style.top = '500px';
	
}

//Exit button function
function exit_fun()
{
	//alert('Sorry! Age must be above 25');
	popUp();backgroundFilter();
}


//Displaying particular selector popup
function showselector(somevar)
{
	document.getElementById("text"+somevar).style.display='none';
	document.getElementById("select"+somevar).style.display='block';
	
	for(i=1;i<=4;i++)
	{
		if (i==somevar)
		{
			continue;
		}
		document.getElementById("select"+i).style.display='none';
		document.getElementById("text"+somevar).style.display='block';

	}
}

//To get value from selected popup to particular textfields
function getvalue(target,somevar)
{
	document.getElementById("select"+target).style.display='none';	
	document.getElementById("text"+target).style.display='block';
	document.getElementById("text"+target).value=somevar;		
}
function hidethis(somevar)
{
	document.getElementById("select"+somevar).style.display='none';
}

//Checkbox image function
var remember="no";
function chk_chkbox()
{
	var img_src=document.getElementById("chk").src;
	var pos=img_src.lastIndexOf("checkbox-checked");
	document.getElementById("chk").src=(pos==-1)?'includessplash/images/checkbox-checked.jpg':'includessplash/images/checkbox.jpg';
	remember=(pos==-1) ? "yes" : "no";
}
function hideboxes()
{
		for(i=1;i<=4;i++)
		{
			document.getElementById("select"+i).style.display='none';
			document.getElementById("text"+i).style.display='block';
		}
}