var curobj; 
var subobjstr;
var opt_position;

function getposOffset(overlay, offsettype)
{
	var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
	var parentEl=overlay.offsetParent;
	while (parentEl!=null)
		{
			totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
			parentEl=parentEl.offsetParent;
        }
	return totaloffset;
}

/*function newwindow(url,width,height)
 {
      //day = new Date();
	  //alert(url);
    //  id = day.getTime();
      window.open(url);
	  //window.open(url, '" + id + "', 'toolbar = 0, scrollbars = 1, location = 0, statusbar = 0, menubar = 0, resizable = 1, width = " + width + ", height = " + height + "');
  }*/

  function showDiv(subcontent,catdiv,catdiv1) {
	//alert("hello");
	var objDivStyle = eval('document.getElementById('+subcontent+').style');
	objDivStyle.visibility = '';

	var objDivStyle = eval('document.getElementById('+catdiv+').style');
	objDivStyle.visibility = '';
    var objDivStyle = eval('document.getElementById('+catdiv1+').style');
	objDivStyle.visibility = '';




}

function hideDiv(subcontent,catdiv,catdiv1) {
	var objDivStyle = eval('document.getElementById(' + subcontent + ').style');
	objDivStyle.visibility = 'hidden';

	var objDivStyle = eval('document.getElementById(' + catdiv + ').style');
	objDivStyle.visibility = 'hidden';

	var objDivStyle = eval('document.getElementById(' + catdiv1 + ').style');
	objDivStyle.visibility = 'hidden';

}

function overlay(curobj1, subobjstr1, opt_position1)
{
  alert("value");
  var a = document.getElementById(curobj1).style.display = "";

 //alert(curobj1);
 curobj = curobj1;
 subobjstr = subobjstr1;
 opt_position = opt_position1;
 //var url = 'checkcookie.php';
 //var x =  new RemoteProcedure(url,validateVNumResponse);
}

function overlayclose(subobj)
	{
		document.getElementById(subobj).style.display="none"		
    }

function shDiv(content) 
{
	//alert("hello");
	var objDivStyle = eval('document.all.' + content + '.style');
	objDivStyle.visibility = 'visible';
}

function hdDiv(content) {
	var objDivStyle = eval('document.all.' + content + '.style');
	objDivStyle.visibility = 'hidden';
}

function overlay(curobj1, subobjstr1, opt_position1)
{
  alert("value");
  var a = document.getElementById(curobj1).style.display = "";

 //alert(curobj1);
 curobj = curobj1;
 subobjstr = subobjstr1;
 opt_position = opt_position1;
 //var url = 'checkcookie.php';
 //var x =  new RemoteProcedure(url,validateVNumResponse);
}

function overlayclose(subobj,subobj2)
	{
		document.getElementById(subobj2).style.display="block"		
		document.getElementById(subobj).style.display="none"		
    }

function validateVNumResponse(xhrObj)
{
	var isVnumValid =  xhrObj.responseText;		
	
	String(isVnumValid);

	if(isVnumValid == "T")
	  {
		  window.location = "mypage.php";
	  }
	else
	  {
			if (document.getElementById)
		 { 
			var subobj=document.getElementById(subobjstr)
			subobj.style.display=(subobj.style.display!="block")? "block" : "none"
			var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
			var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
			subobj.style.left=xpos+"px"
			subobj.style.top=ypos+"px"
			return false
  	     }
	        else
	        return true
	   } 
 } 
