/* ----------------------------------------------------
Saturday, June 07, 2008
function fnOpenPopup(objID, objWidth) {
	var tempObj			=	document.getElementById(objID);
	var contObj			=	document.getElementById("popup_container");
	contObj.style.width	=	objWidth + "px";
	contObj.style.height=	tempObj.style.height = "1";
	contObj.style.top	=	tempObj.style.top;
	contObj.style.left	=	tempObj.style.left;
	contObj.innerHTML	=	tempObj.innerHTML;

	// ...... Tuesday, June 03, 2008
	//document.getElementById("maskdiv").style.height = document.getElementById("container").offsetHeight;	
	var arrayPageSizeWithScroll =	getPageSizeWithScroll();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	// ...... Tuesday, June 03, 2008

	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
}
---------------------------------------------------- */
function fnOpenPopup_old(objID, objWidth) 
{
	//var tempObj			=	document.getElementById(objID);
	var contObj			=	document.getElementById("popup_container");

	var Objfrm			=	document.getElementById("frm");
	Objfrm.style.visibility	=	"visible";

	contObj.style.width	=	objWidth + "px";
	contObj.style.height=	"1";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
//	contObj.style.top = (window.screen.width - 500) / 2;
  //  contObj.style.left = (window.screen.height - 500) / 2;
	contObj.style.top	=	"180px";
	contObj.style.left	=	"250px";
	
	// ...... Tuesday, June 03, 2008
	//document.getElementById("maskdiv").style.height = document.getElementById("container").offsetHeight;	
	var arrayPageSizeWithScroll =	getPageSizeWithScroll();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	// ...... Tuesday, June 03, 2008

	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
}
function fnInitialOpenPopup(objID, objWidth, path) 
{
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("josForm");
	
	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	
	contObj.style.height=	"200";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
	contObj.style.top = String((window.screen.height-200)/2)+"px" ;
	contObj.style.left = String((window.screen.width-450)/2)+"px" ;
	
	
	var arrayPageSizeWithScroll =	getPageSizeWithScrollUser();
	document.getElementById("upload_path").value=path;
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block"; 
}
function fnOpenPopupUser(objID, objWidth, event){
		
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frm_cart");
	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	var xPos;
	var yPos;
	var scrollPos;
	var IE = document.all?true:false;
	if(IE)
	{
		xPos=event.x;
		yPos=event.y;
		scrollPos=document.body.parentElement.scrollTop;
	}
	else
	{
		xPos=event.clientX;
		yPos=event.clientY;
		scrollPos=window.pageYOffset;
	}
	if(scrollPos!=0 )
	{
	  if(!IE)
		{
			contObj.style.top = (scrollPos+50) +"px";  
		}
		else
		{
			contObj.style.top = (scrollPos+50) +"px";
		}
	}
	else
	{
	  contObj.style.top = (yPos) +"px";
	}
	var top =  contObj.style.top + scrollPos;

	var left1 = (screen.width/2)-(objWidth/2);
	var top1 = (screen.height/2)-(480/2) + scrollPos-50;

	contObj.style.top = top1;
	contObj.style.left = left1;
	

	contObj.style.height=	"530px";	
	contObj.style.border=	"2px";	
	contObj.style.solid=	"#FF0000";
	document.getElementById("maskdiv").style.height = document.body.offsetHeight + "px";
	document.getElementById("maskdiv").style.width = document.body.offsetWidth + "px";
	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block"; 
	
}
function fnOpenPopupadmin(objID, objWidth, event){
	

	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frm");
	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	var xPos;
	var yPos;
	var scrollPos;
	var IE = document.all?true:false;
	if (!IE) document.captureEvents(Event.CLICK)

	if(IE)
	{
		xPos=event.x;
		yPos=event.y;
		yPos='200';
		scrollPos=document.body.parentElement.scrollTop;

	}
	else
	{
		xPos=event.clientX;
		yPos=event.clientY;
		scrollPos=window.pageYOffset;
	}
	if(scrollPos!=0 )
	{
	  if(!IE)
		{

			contObj.style.top = (scrollPos+50) +"px";  
		}
		else
		{
			alert('IE');
			contObj.style.top = (scrollPos+50) +"px";
		}
	}
	else
	{
	  contObj.style.top = (yPos) +"px";
	}
	var left1 = (screen.width/2)-(objWidth/2);
	alert(left1);
	contObj.style.top ="200px";
	contObj.style.left=left1+"px";
	contObj.style.height=	"530px";	
	contObj.style.border=	"2px";	
	contObj.style.solid=	"#FF0000";
	Width=document.body.offsetWidth - 200;
	Height=document.body.offsetHeight-100;
	document.getElementById("maskdiv").style.height =document.body.offsetHeight + "px";
	document.getElementById("maskdiv").style.width = document.body.offsetWidth + "px";
	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block"; 
	
}
function fnOpenPopupUserAdr(objID, objWidth){
	
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frm");
	var Objheaderbanner	=	document.getElementById("headerbanner");	
	if(Objheaderbanner!=undefined)
		Objheaderbanner.style.visibility	=	"hidden";	
	

	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	
	contObj.style.height=	"1";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
	contObj.style.top	=	"20px";
	contObj.style.left	=	"150px";
	
	
	var arrayPageSizeWithScroll =	getPageSizeWithScrollUser();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	document.getElementById("maskdiv").style.display = "block";
	
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block";
	
}

function fnOpenPopupUserEvent(objID, objWidth){
	
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frm");
	var Objheaderbanner	=	document.getElementById("headerbanner");	
	if(Objheaderbanner!=undefined)
		Objheaderbanner.style.visibility	=	"hidden";	
	

	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	
	contObj.style.height=	"1";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
	contObj.style.top	=	"200px";
	contObj.style.left	=	"225px";
	
	
	var arrayPageSizeWithScroll =	getPageSizeWithScrollUser();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	document.getElementById("maskdiv").style.display = "block";
	
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block";
	
}


function getPageSizeWithScroll(){

	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else 
	if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );     
	return arrayPageSizeWithScroll; 
}


function getPageSizeWithScrollUser(){

	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else 
	if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
	
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
		
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	
		//yWithScroll = document.body.offsetHeight;
		xWithScroll =	document.body.offsetWidth;
		//yWithScroll =	document.getElementById("wrapper").offsetHeight+30;
		if(document.body.offsetHeight < window.screen.height)
			yWithScroll =	window.screen.height;
		else
			yWithScroll =	document.body.offsetHeight;
		
	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );     
	return arrayPageSizeWithScroll; 
}
function fnOpenPopup1(objID, objWidth)
{
	
	var tempObj	=	document.getElementById(objID);
	var contObj	=	document.getElementById("popup_container");
	
	contObj.style.width	=	objWidth + "px";
	contObj.style.height=	tempObj.style.height = "1";
	contObj.style.top	=	tempObj.style.top;
	contObj.style.left	=	tempObj.style.left;			
	contObj.innerHTML	=	tempObj.innerHTML;	
	document.getElementById("maskdiv").style.height = document.getElementById("container").offsetHeight;	
	document.getElementById("maskdiv").style.display = "block";
	contObj.style.visibility	=	"visible";
}

function fnOpenPopupUserForSignup(objID, objWidth){
	
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frmSubmit");
	var Objheaderbanner	=	document.getElementById("headerbanner");	
	if(Objheaderbanner!=undefined)
		Objheaderbanner.style.visibility	=	"hidden";	
	

	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	
	contObj.style.height=	"1";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
	contObj.style.top	=	"125px";
	contObj.style.left	=	"225px";
	
	
	var arrayPageSizeWithScroll =	getPageSizeWithScroll();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	document.getElementById("maskdiv").style.display = "block";
	
	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block";
	
}

function fnOpenPopupUserforImport(objID, objWidth){
	
	var contObj			=	document.getElementById(objID);
	var Objfrm			=	document.getElementById("frmImport");
	var Objheaderbanner	=	document.getElementById("headerbanner");	
	if(Objheaderbanner!=undefined)
		Objheaderbanner.style.visibility	=	"hidden";	
	

	Objfrm.style.visibility	=	"visible";	
	contObj.style.width	=	objWidth + "px";
	
	contObj.style.height=	"1";	
	contObj.style.border=	"1px";	
	contObj.style.solid=	"#FF0000";
	contObj.style.top	=	"125px";
	contObj.style.left	=	"225px";

	var arrayPageSizeWithScroll =	getPageSizeWithScrollUser();
	document.getElementById("maskdiv").style.height = arrayPageSizeWithScroll[1] + "px";
	document.getElementById("maskdiv").style.display = "block";

	contObj.style.visibility	=	"visible";
	contObj.style.display		=	"block";
	
}
function fnopenPopup(divid,popwidth)
{
	var maskheight	= document.getElementById('thispage').offsetHeight;
	var maskwidth	= document.getElementById('thispage').offsetWidth-5;

	var windowleft	= (maskwidth-popwidth)/2;

	document.getElementById(divid).style.display='block';
	document.getElementById(divid).style.left=windowleft+'px';
	document.getElementById('fade').style.display='block';
	document.getElementById('fade').style.height=maskheight+'px';
	document.getElementById('fade').style.width=maskwidth+'px';
	document.getElementById('frmoverlay').style.display='block';
	document.getElementById('frmoverlay').style.height=maskheight+'px';
	document.getElementById('frmoverlay').style.width=maskwidth+'px';
}
function fnClosePopup(divid)
{
	var maskheight	= document.getElementById('thispage').offsetHeight;
	document.getElementById(divid).style.display='none';
	document.getElementById('fade').style.display='none';
	document.getElementById('fade').style.height='0px';
	document.getElementById('fade').style.width='0px';
	document.getElementById('frmoverlay').style.display='none';
	document.getElementById('frmoverlay').style.height='0px';
	document.getElementById('frmoverlay').style.width='0px';	
}
function fnResetForm()
{
	document.getElementById('selProgram').value="0";
	document.getElementById('cmbSubCareProgram').value="0";
	document.getElementById('cmbSubCareProgram').style.display="none";
	document.getElementById('cmbSubtCareProgram').value="0";
	document.getElementById('cmbSubtCareProgram').style.display="none";
	document.getElementById('cmblocation').value="0";
	document.getElementById('cmblocation').style.display="none";
	document.getElementById('txtFullName').value="Full name";
	document.getElementById('txtEmail').value="Enter email address";
	document.getElementById('txtAlternateEmail').value="Enter alternative email address - optional";
	document.getElementById('txtCity').value="city";
	document.getElementById('selState').value="0";
	document.getElementById('txtZip').value="Zip code";
	document.getElementById('txtContactNo').value="Contact phone number";
}
function getMultipleSelection(formName,elementName,array) // To select multiple values from multi select box.
{ 
    var selected = new Array(); 
    var mySelect = document.forms[formName].elements[elementName]; 
    for(j = 0; j < mySelect.options.length; j++) { 
        if(mySelect.options[j].selected) { 
            selected.push(mySelect.options[j].value); 
        } 
    } 
    if(array != 'true') 
    {
        var sel= selected.toString();
        document.frm.hdnLocations.value=sel;
    }
    else 
    {
        var sel= selected;
        document.frm.hdnLocations.value=sel;
    }
} 
