// JavaScript Document
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function showregistrationform()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="UserRegestration.php"
xmlHttp.onreadystatechange= stateChangeregister
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showforgotpasswordform()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="forgetpassword.php"
xmlHttp.onreadystatechange= stateChangeforgotpassword
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showalbumupload()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="CreateAlbum.php"
xmlHttp.onreadystatechange= stateChangedalbum
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showalbumupdate(id)
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="CreateAlbum.php?id="+id;
xmlHttp.onreadystatechange= stateChangedalbum
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function showuploadformdetails()
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="uploadalbum.php"
    xmlHttp.onreadystatechange=stateChangedLoginauction
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}


function showpininfo()
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="popupwindow.php"
    xmlHttp.onreadystatechange=stateChangedshowpininfo
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}

function checkemail1()
    {

        var testresults;
        var str=document.getElementById('varuid').value;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        testresults=true
        else{

        testresults=false
        }
        return (testresults)
    }

function form_submit_quick_register()
 {
		 if(document.getElementById('varfname').value == "")
        {
            alert("Please enter the first name");
			document.getElementById('varfname').focus();
			return false;
        }
    else if(document.getElementById('varlname').value == "")
        {
            alert("Please enter the last name");
			document.getElementById('varlname').focus();
			return false;
        }
	 else if(! checkemail1())
        {
            alert("Please enter a valid email address");
			document.getElementById('varuid').focus();
			return false;
        }
   
    else if(document.EditUseMast.varpassword.value.length < 6)
        {
            alert("Please enter the password (6 Characters minimum)");
            document.EditUseMast.varpassword.focus();
            return false;
        }
    else if(document.EditUseMast.varcpassword.value=="")
        {
            alert("Please enter Verify Password ");
            document.EditUseMast.varcpassword.focus();
            return false;
        }

    else if(document.EditUseMast.varpassword.value != document.EditUseMast.varcpassword.value)
        {
            alert("Password and Verify passoword not matched");
            document.EditUseMast.varcpassword.focus();
            return false;
        }
   /* else if(document.EditUseMast.DisCom.value=="PleaseSelect")
        {
            alert("Please select district");
            document.EditUseMast.DisCom.focus();
            return false;
        }*/
		else if(document.EditUseMast.chkaggry.checked==false)
		{
			alert("Please check the Check Box.");
            document.EditUseMast.chkaggry.focus();
            return false;
		}
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		var url="UserRegestration.php?QT=1";
		var params = "&varfname="+document.getElementById('varfname').value;
        
		params=params+ "&varlname="+document.getElementById('varlname').value; 
		params=params+"&varuid="+document.getElementById('varuid').value;
		params=params+"&varpassword="+document.getElementById('varpassword').value;
		//params=params+"&varadd="+document.getElementById('varadd').value;
//		params=params+"&varcity="+document.getElementById('varcity').value; 
		params=params+"&varphone="+document.getElementById('varphone').value;
		//params=params+"&varfax="+document.getElementById('varfax').value;
//		params=params+"&varpobox="+document.getElementById('varpobox').value;
//		params=params+"&DisCom="+document.getElementById('DisCom').value;
//		params=params+"&ZipCode="+document.getElementById('ZipCode').value;
//		params=params+"&varzip="+document.getElementById('varzip').value;
		
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedRegisterPopup 
		xmlHttp.send(null)
}


function form_submit_quick_changeprofile()
 {
		 if(document.getElementById('varfname').value == "")
        {
            alert("Please enter the first name");
			document.getElementById('varfname').focus();
			return false;
        }
    else if(document.getElementById('varlname').value == "")
        {
            alert("Please enter the last name");
			document.getElementById('varlname').focus();
			return false;
        }
	 else if(! checkemail1())
        {
            alert("Please enter a valid email address");
			document.getElementById('varuid').focus();
			return false;
        }
   
    else if(document.EditUseMast.varpassword.value.length < 6)
        {
            alert("Please enter the password");
            document.EditUseMast.varpassword.focus();
            return false;
        }
    else if(document.EditUseMast.NPassword.value!="")
        {
            if(document.EditUseMast.NPassword.value.length < 6)
        	{
				alert("Please enter the password (6 Characters minimum) ");
				document.EditUseMast.NPassword.focus();
            	return false;
        	}
			if(document.EditUseMast.NPassword.value != document.EditUseMast.RPassword.value)
			{
				alert("New Password and Verify passoword not matched");
				document.EditUseMast.RPassword.focus();
				return false;
			}
        }
 /*   else if(document.EditUseMast.fk_districtglcode.value=="PleaseSelect")
        {
            alert("Please select district");
            document.EditUseMast.fk_districtglcode.focus();
            return false;
        }*/
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		var url="changeprofile.php?QT=1";
		var params = "&varfname="+document.getElementById('varfname').value;
        
		params=params+ "&varlname="+document.getElementById('varlname').value; 
		params=params+"&varemail="+document.getElementById('varuid').value;
		params=params+"&varpassword="+document.getElementById('varpassword').value;
		params=params+"&NPassword="+document.getElementById('NPassword').value;
		params=params+"&RPassword="+document.getElementById('RPassword').value;
		//params=params+"&varadd="+document.getElementById('varadd').value;
//		params=params+"&varcity="+document.getElementById('varcity').value; 
		params=params+"&varphone="+document.getElementById('varphone').value;
		//params=params+"&varfax="+document.getElementById('varfax').value;
		//params=params+"&varpobox="+document.getElementById('varpobox').value;
//		params=params+"&fk_districtglcode="+document.getElementById('fk_districtglcode').value;
//		params=params+"&fk_Zipglcode="+document.getElementById('fk_Zipglcode').value;
//		params=params+"&varzip="+document.getElementById('varzip').value;
		
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedChangeProfilePopup 
		xmlHttp.send(null)
}

function ProcessLoader()
{
    document.getElementById('dvprocessing').innerHTML = "<img src='images/ajax-loader.gif'>";
    document.getElementById('dvprocessing').style.display = '';
    document.getElementById('dvprocessing').style.width = '';
    document.getElementById('dvprocessing').style.height = '';
    document.getElementById('dvprocessing').style.top = CalculateTop('32')+ "px";
    document.getElementById('dvprocessing').style.left = CalculateLeft('32')+ "px";
    document.getElementById('dvprocessing').style.backgroundColor = 'white';
}
function stateChangeregister()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
document.getElementById('dvregisterfrm').style.height='316';
document.getElementById('dvregisterfrm').style.width='394';
document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}
function stateChangeforgotpassword()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.height='275';
document.getElementById('dvregisterfrm').style.width='390';
document.getElementById('dvregisterfrm').style.top=CalculateTop('275')+ "px";
document.getElementById('dvregisterfrm').style.left=CalculateLeft('270')+ "px";
document.getElementById('dvregisterfrm').style.display='';
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function stateChangedLoginauction()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
document.getElementById('dvprocessing').style.display='none';

	   document.getElementById('dvregisterfrm').style.width = '477';
	   document.getElementById('dvregisterfrm').style.height = '480';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('482') + "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('477')+ "px";
document.getElementById('dvregisterfrm').style.display='';
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}
function stateChangedalbum()
{
SetBackground();
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{

/*$(function() {
			$('.date-pick').datePicker();
		});*/

document.getElementById('dvprocessing').style.display='none';

	   document.getElementById('dvregisterfrm').style.width = '475';
//	   document.getElementById('dvregisterfrm').style.height = '312';
	   document.getElementById('dvregisterfrm').style.height = '377';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('377')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('475')+ "px";
document.getElementById('dvregisterfrm').style.display='';
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function stateChangedshowpininfo()
{
SetBackground();
//alert(xmlHttp.readyState);

if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
//	alert(xmlHttp.responseText);
/* var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	alert(strlengthcount);
	if(strlengthcount>0)
	{*/
document.getElementById('dvprocessing').style.display='none';

	   document.getElementById('dvregisterfrm').style.width = '355';
	   document.getElementById('dvregisterfrm').style.height = '382';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('382') + "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('355')+ "px";
document.getElementById('dvregisterfrm').style.display='';
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
	/*}*/
}
}


function stateChangedRegisterPopup()
{
SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById('dvprocessing').style.display = 'none';
	 
	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 3300)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '395';
	   document.getElementById('dvregisterfrm').style.height = '';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('493')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('392')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		 document.location.href= 'albumlist.php';
	 }
 } 
}
function stateChangedChangeProfilePopup()
{
SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById('dvprocessing').style.display = 'none';
	 
	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 1200)
	{
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '400';
	   document.getElementById('dvregisterfrm').style.height = '';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('457')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('400')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '400';
	   document.getElementById('dvregisterfrm').style.height = '110';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('110')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('400')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
 } 
}
function trim(str, chars) {
return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
function body_onkeydown(evt)
{
//alert(evt);
//alert(evt.keyCode);
var key=(window.Event)?evt.which:evt.keyCode;
//alert(key);
if(key==27)
{
//alert(key);
styledPopupClose();
	}
}

function CalculateTop(Height)
{var ScrollTop=document.body.scrollTop;if(ScrollTop==0)
{if(window.pageYOffset)
ScrollTop=window.pageYOffset;else
ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}
var BodyHeight=document.body.clientHeight;if(BodyHeight==0)
{BodyHeight=window.innerHeight;}
if(BodyHeight==0)
{BodyHeight=document.documentElement.clientHeight}
var FinalTop=((BodyHeight-Height)/2)+ScrollTop;return FinalTop;}

function CalculateLeft(Weight)
{var ScrollLeft=document.body.scrollLeft;if(ScrollLeft==0)
{if(window.pageXOffset)
ScrollLeft=window.pageXOffset;else
ScrollLeft=(document.body.parentElement)?document.body.parentElement.scrollLeft:0;}
var BodyWeight=document.documentElement.clientWidth;if(BodyWeight==0)
{BodyWeight=document.body.clientWidth;}
var FinalLeft=(BodyWeight+ScrollLeft-Weight)/2;return FinalLeft;}

function SetBackground()
{
document.getElementById('dimmer').style.width=GetBodyWidth();
document.getElementById('dimmer').style.height=GetBodyHeight();
document.getElementById('dimmer').style.visibility="visible";
}
/*
function MouseDown(e) 
{
    if (over)
    {
        if (isMozilla) {
            objDiv = document.getElementById(DivID);
            X = e.layerX;
            Y = e.layerY;
            return false;
        }
        else {
            objDiv = document.getElementById(DivID);
            objDiv = objDiv.style;
            X = event.offsetX;
            Y = event.offsetY;
        }
    }
}


//
//
//
function MouseMove(e) 
{
    if (objDiv) {
        if (isMozilla) {
            objDiv.style.top = (e.pageY-Y) + 'px';
            objDiv.style.left = (e.pageX-X) + 'px';
            return false;
        }
        else 
        {
            objDiv.pixelLeft = event.clientX-X + document.body.scrollLeft;
            objDiv.pixelTop = event.clientY-Y + document.body.scrollTop;
            return false;
        }
    }
}

//
//
//
function MouseUp() 
{
    objDiv = null;
}*/

function init()
{
isMozilla=(document.all)?0:1;
if(isMozilla)
{
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
/*document.onmousedown=MouseDown;document.onmousemove=MouseMove;document.onmouseup=MouseUp;*/
}
init();
function hideIframe()
{
if(ie)
{
var theIframe=document.getElementById("fadeboxiframe")
//theIframe.style.display="none";
}
}


function unhideIframe()
{
if(ie)
{
var theIframe=document.getElementById("fadeboxiframe")
var theDiv=document.getElementById("dvregisterfrm");
//theIframe.style.width=theDiv.offsetWidth+'px';
//theIframe.style.height=theDiv.offsetHeight+'px';
//theIframe.style.top=theDiv.offsetTop+'px';
//theIframe.style.left=theDiv.offsetLeft+'px';
//theIframe.style.display='';
}
}


function GetBodyWidth()
{
var theWidth=0;
if(document.body)
{
theWidth=document.body.clientWidth;
}
else if(document.documentElement&&document.documentElement.clientWidth)
{
theWidth=document.documentElement.clientWidth;
}
else if(window.innerWidth)
{
theWidth=window.innerWidth;
}
if(isMozilla)
{
theWidth=theWidth-85;
}
return theWidth+ "px";
}

function GetBodyHeight()
{
var theHeight1=0;
var theHeight2=0;
var theHeight3=0;
if(window.innerHeight)
{
theHeight1=window.innerHeight;
}
if(document.documentElement&&document.documentElement.clientHeight)
{
theHeight2=document.documentElement.clientHeight;
}
if(document.body)
{
theHeight3=document.body.clientHeight;
if(isMozilla)
{
theHeight4=0;
}
else
{
theHeight4=document.body.scrollHeight;
}
}
FinalHeight=Math.max(theHeight1,theHeight2,theHeight3,theHeight4);
if(isMozilla)
{
FinalHeight=FinalHeight-85;
}
return FinalHeight+ "px";
}

function isDate(str)
{
	  
	  var re = /^(\d{1,2})[\s\.\/-](\d{1,2})[\s\.\/-](\d{4})$/
	  //var re = /^([0]?[1-9]|[1][0-2])[./-]([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0-9]{4}|[0-9]{2})$/
	  if (!re.test(str)) return false;
	  var result = str.match(re);
	  //alert(result[4]);
	  var y = parseFloat(result[3]);
	  var m = parseFloat(result[1]);
	  var d = parseFloat(result[2]);
	//  var rsplit = result[0].split('/');
	//  var y = parseFloat(rsplit[2]);
	//  var m = parseFloat(rsplit[0]);
	//  var d = parseFloat(rsplit[1]);
	//  
	//  alert(y);
	//  alert(m);
	//  alert(d);
	
	  if(m < 1 || m > 12 || y < 1900 || y > 2100) return false;
	  if(m == 2)
	  {
			  var days = ((y % 4) == 0) ? 29 : 28;
	  }
	  else if(m == 4 || m == 6 || m == 9 || m == 11)
	  {
			  var days = 30;
	  }
	  else
	  {
			  var days = 31;
	  }
	  return (d >= 1 && d <= days);
}

function checking()
{
 //var params='';
	
    //alert(document.getElementById('QT').value);
    if(document.getElementById('varTitle').value=="")
        {
            alert("Please Enter Title ");
            document.getElementById('varTitle').focus();
            return false;
        }
	else if(document.getElementById('vardate').value=="")
		{
			alert("Please Enter Date ");
            document.getElementById('vardate').focus();
            return false;
		}
	/*else if (!isDate(document.getElementById('vardate').value))
	  {
		  	alert("Please Enter Proper Date ");
			document.getElementById('vardate').focus();
			return false;
	  }*/
	  
          
        
         var a="";
         var fk_albumglcode=document.getElementById('fk_albumglcode');
         

            for (i=0;i<document.EditUseMast.albumvisibility.length;i++)
            {
                  if (document.EditUseMast.albumvisibility[i].checked)
                  {
                         //rbgroup_value = document.form1.rbgroup[i].value;
                         a=document.EditUseMast.albumvisibility[i].value;
                  }
            }
          /*  alert(a);*/
            if(a=="")
                {
                   return false;
                }
        var url="CreateAlbum.php?QT="+document.getElementById('QT').value;
		var params = "&varTitle="+document.getElementById('varTitle').value;

		params=params+ "&vardescription="+document.getElementById('vardescription').value;
        params=params+ "&albumvisibility="+a;
		params=params+ "&vardate="+document.getElementById('vardate').value;
        params=params+ "&intglcode="+document.getElementById('intglcode').value;

		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)

		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedcreatealbum
		xmlHttp.send(null)
   

}
function stateChangedcreatealbum()
{
    SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;

	/* alert(str);
     alert(strlengthcount);*/
	 if(strlengthcount > 2000)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '320';
	   document.getElementById('dvregisterfrm').style.height = '225';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('225')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('320')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
        document.location.href=str;
	 }
 }
}

function checkemail()
    {

        var testresults;
        var str=document.EditUseMast.varuid.value;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        testresults=true
        else{

        testresults=false
        }
        return (testresults)
    }
function KeycheckOnlyNumeric(e)
{
   var _dom = 0;
    _dom=document.all?3:(document.getElementById?1:(document.layers?2:0));
    if(document.all) e=window.event; // for IE
    var ch='';
    var KeyID = '';
    //alert(_dom);
    if(_dom==2){                     // for NN4
        //alert(e.which);
        if(e.which>0) ch='('+String.fromCharCode(e.which)+')';
        KeyID=e.which;
    }
    else
    {
        if(_dom==3){                   // for IE
            KeyID = (window.event) ? event.keyCode : e.which;
        }
        else {                       // for Mozilla
            //alert('Mozilla:' + e.charCode);
            if(e.charCode>0) ch='('+String.fromCharCode(e.charCode)+')';
            KeyID=e.charCode;
        }
    }
    
    if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))	
    {
        //alert("hello");
        return false;
    }
    
    
    return true;
}
	
function funpopuplogin()
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="loginpopup.php"
    xmlHttp.onreadystatechange= stateChangeloginpopup
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}

function stateChangeloginpopup()
{
    SetBackground();
    //alert(xmlHttp.readyState);
    //alert(xmlHttp.responseText);
    if(xmlHttp.readyState==1)
    {
    ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
    <!--document.getElementById('dvprocessing').style.display='none';-->
    //alert(xmlHttp.responseText);
    document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='';
    document.getElementById('dvregisterfrm').style.height='190';
    document.getElementById('dvregisterfrm').style.width='320';
    document.getElementById('dvregisterfrm').style.top=CalculateTop('190')+ "px";
    document.getElementById('dvregisterfrm').style.left=CalculateLeft('320')+ "px";
        //alert(document.getElementById('dvregisterfrm').style.height);
        //alert(document.getElementById('dvregisterfrm').style.width);
    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
    unhideIframe();
    }
}

function stateChangedcheckpopuplogin()
{
    SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 2000)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '320';
	   document.getElementById('dvregisterfrm').style.height = '195';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('195')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('320')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		 document.location.href= 'albumlist.php';
	 }
 }
}

function checkpopuplogin()
{
    if(document.getElementById('AdminId').value== "")
	{
		alert("Please enter the User Id");
		document.getElementById('AdminId').focus();
		return false;
	}
	else if(document.getElementById('Password').value== "")
	{
		alert("Please enter the password");
		document.getElementById('Password').focus();
		return false;
	}
    
    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		var url="loginpopup.php?QT=1";
		var params = "&AdminId="+document.getElementById('AdminId').value;
        
		params=params+ "&Password="+document.getElementById('Password').value;
		
		
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedcheckpopuplogin
		xmlHttp.send(null)

	
}

function checkemail()
    {

        var testresults;
        var str=document.EditPassword.varuserid.value;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        testresults=true
        else{

        testresults=false
        }
        return (testresults)
    }

function ChkValid()
{
	//alert('yes');
    if (! checkemail())
    {
        alert("Please enter a valid email address");
        document.EditPassword.varuserid.focus();
        return false;
    }

    if (document.EditPassword.varuserid.value == "")
        {
            alert("Please Enter User Id");
			document.EditPassword.varuserid.focus();
			return false;
        }
    else if(document.EditPassword.NPassword.value != document.EditPassword.RPassword.value)
        {
            alert("New Password not matched");
            document.EditPassword.RPassword.focus();
            return false;
        }
    else if(document.EditPassword.varfname.value == "")
        {
            alert("Please Enter First Name");
			document.EditPassword.varfname.focus();
			return false;
        }
    else if(document.EditPassword.varlname.value == "")
        {
            alert("Please Enter Last Name");
			document.EditPassword.varlname.focus();
			return false;
        }
    
	else
	{
	xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		var url="changeprofile.php?QT=1";
		var params = "&varuserid="+document.getElementById('varuserid').value;
        
		params=params+ "&CPassword="+document.getElementById('CPassword').value;
			params=params+ "&NPassword="+document.getElementById('NPassword').value;
				params=params+ "&RPassword="+document.getElementById('RPassword').value;
					params=params+ "&varfname="+document.getElementById('varfname').value;
			params=params+ "&varlname="+document.getElementById('varlname').value;
				params=params+ "&varadd="+document.getElementById('varadd').value;
				params=params+ "&varemail1="+document.getElementById('varemail1').value;	
			params=params+ "&varemail2="+document.getElementById('varemail2').value;		
		
		
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedcheckpopupprofile
		xmlHttp.send(null)
	 }

}
function stateChangedcheckpopupprofile()
{
    SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	 alert(str);
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 2000)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '200';
	   document.getElementById('dvregisterfrm').style.height = '260';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('473')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('477')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		// document.location.href= 'albumlist.php';
	 }
 }
}
function funchangeprofile()
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="changeprofile.php"
    xmlHttp.onreadystatechange= stateChangeprofilepopup
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}
function stateChangeprofilepopup()
{

    SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 2000)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '400'+"px";
	   document.getElementById('dvregisterfrm').style.height = '329'+"px";
       document.getElementById('dvregisterfrm').style.top = CalculateTop('329')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('400')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		 document.location.href= 'albumlist.php';
	 }
 }
}


//binitforgetpassword
function showrforgetpass()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="forgetpassword.php"
xmlHttp.onreadystatechange= stateChangeforgetpass
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangeforgetpass()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
document.getElementById('dvregisterfrm').style.height='155';
document.getElementById('dvregisterfrm').style.width='381';
document.getElementById('dvregisterfrm').style.top=CalculateTop('155')+ "px";
document.getElementById('dvregisterfrm').style.left=CalculateLeft('381')+ "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function checkforgetpass()
{



        var str=document.getElementById('EmailId').value;
        
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        {

        }
        else
        {
            alert("Email Address Not Valid");
            document.getElementById('EmailId').setfocus();
            return false
        }


        xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		var url="forgetpassword.php";
		var params = "?EmailId="+document.getElementById('EmailId').value;

		params=params+ "&submit=1";
        //alert(url+params);

		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)

		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedforgetpasspopup
		xmlHttp.send(null)
        
}

function stateChangedforgetpasspopup()
{
    SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	//alert(str);
    var strlengthcount = str.length;
	 //alert(strlengthcount);
	 //if(strlengthcount > 3300)
	 //{
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '390';
	   document.getElementById('dvregisterfrm').style.height = '174';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('174')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('477')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 //}
	 //else
	 //{
		 //document.getElementById('dvregisterfrm').style.display = "none";
		 //document.location.href= 'albumlist.php';
	 //}
 }
}
	//for shipping by ashish
	
	function showshipaddressdetails()
{
    //alert("in");
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="address.php"
    xmlHttp.onreadystatechange= stateChangedshipadd
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}
function showshipaddressupdatedetails(str)
{
    //alert("in");
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="address.php?intglcode="+str;
    xmlHttp.onreadystatechange= stateChangedshipadd
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}
function stateChangedshipadd()
{
SetBackground();
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
document.getElementById('dvprocessing').style.display='none';
/*document.getElementById('dvregisterfrm').style.height='270';
document.getElementById('dvregisterfrm').style.width='335';
document.getElementById('dvregisterfrm').style.top=CalculateTop('275');
document.getElementById('dvregisterfrm').style.left=CalculateLeft('270');*/
	   document.getElementById('dvregisterfrm').style.width = '480';
	   document.getElementById('dvregisterfrm').style.height = '310';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('480')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('310')+ "px";
document.getElementById('dvregisterfrm').style.display='';
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}
/*function form_submit_quick_address()
 {
		 if(document.getElementById('varadd').value == "")
                {
                    alert("Please Enter Address ");
                    document.getElementById('varadd').focus();
                    return false;
                }

            else if(document.getElementById('varcity').value == "")
                {
                    alert("Please Enter Street Address");
                    document.getElementById('varcity').focus();
                    return false;
                }
            else if(document.getElementById('DistrictCode').value=="PleaseSelect")
                {
                    alert("Please select district");
                    document.getElementById('DistrictCode').focus();
                    return false;
                }
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
            return
		 }
		var url="address.php"
		var params = "?varadd="+document.getElementById('varadd').value;
		params=params+ "&varcity="+document.getElementById('varcity').value;
        	params=params+"&varphone="+document.getElementById('varphone').value;
       	 	//params=params+"&varfax="+document.getElementById('varfax').value;
        	params=params+"&varpobox="+document.getElementById('varpobox').value;
        	params=params+"&DistrictCode="+document.getElementById('DistrictCode').value;
		params=params+"&ZipCode="+document.getElementById('ZipCode').value;
		params=params+"&varzip="+document.getElementById('varzip').value;
		params=params+"&fk_userglcode="+document.getElementById('fk_userglcode').value;
        params=params+"&do";
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)

		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedshipaddress
		xmlHttp.send(null)
}*/
function form_submit_quick_address()
 {
		 
         if(document.getElementById('vartittle').value == "")
                {
                    alert("Please enter Address Tittle");
                    document.getElementById('vartittle').focus();
                    return false;
                }
         else if(document.getElementById('varadd').value == "")
                {
                    alert("Please enter Appartment");
                    document.getElementById('varadd').focus();
                    return false;
                }

            else if(document.getElementById('varcity').value == "")
                {
                    alert("Please enter Street Address");
                    document.getElementById('varcity').focus();
                    return false;
                }
            else if(document.getElementById('DistrictCode').value=="PleaseSelect")
                {
                    alert("Please select District");
                    document.getElementById('DistrictCode').focus();
                    return false;
                }
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
            return
		 }
		var url="address.php"
		var params = "?vartittle="+document.getElementById('vartittle').value;
        params=params+ "&varadd="+document.getElementById('varadd').value;
		params=params+ "&varcity="+document.getElementById('varcity').value;
        	params=params+"&varphone="+document.getElementById('varphone').value;
       	 	//params=params+"&varfax="+document.getElementById('varfax').value;
        	params=params+"&varpobox="+document.getElementById('varpobox').value;
        	params=params+"&DistrictCode="+document.getElementById('DistrictCode').value;
		params=params+"&ZipCode="+document.getElementById('ZipCode').value;
		params=params+"&varzip="+document.getElementById('varzip').value;
		params=params+"&fk_userglcode="+document.getElementById('fk_userglcode').value;
     params=params+"&addressid="+document.getElementById('addressid').value;
        params=params+"&do="+document.getElementById('do').value;
		
		//params=params+"&operation=submit"
		//xmlHttp.open("POST",url,true)
		//alert(url+params);
		xmlHttp.open("GET",url +params ,true)

		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedshipaddress
		xmlHttp.send(null)
}
function stateChangedshipaddress()
{
SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 if(strlengthcount > 3300)
	 {
	   document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '485';
	   document.getElementById('dvregisterfrm').style.height = '370';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('275')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('270')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		 document.location.href= 'shipaddress.php?photofinish='+document.getElementById('photofinish').value+'&address=true';
	 }
 }
}
//binit for order

function funvieworder(str)
{
    
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="ViewOrderDetail.php?intglcode="+str;
    xmlHttp.onreadystatechange= stateChangevieworder
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}
function stateChangevieworder()
{
    SetBackground();
    //alert(xmlHttp.readyState);
    //alert(xmlHttp.responseText);
    if(xmlHttp.readyState==1)
    {
    ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
    <!--document.getElementById('dvprocessing').style.display='none';-->
    //alert(xmlHttp.responseText);
    document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='';
    document.getElementById('dvregisterfrm').style.height='520';
    document.getElementById('dvregisterfrm').style.width='415';
    document.getElementById('dvregisterfrm').style.top=CalculateTop('520')+ "px";
    document.getElementById('dvregisterfrm').style.left=CalculateLeft('410')+ "px";
        //alert(document.getElementById('dvregisterfrm').style.height);
        //alert(document.getElementById('dvregisterfrm').style.width);
    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
    unhideIframe();
    }
}

	/*$(function() {
			$('.date-pick').datePicker();
		});
*/
      function checksdate(str,id)
      {
          
          if (str == "")
          {
              $(document.getElementById(id)).dpDisplay();
              return false;
          }
          if (isDate(str))
          {
              //alert("Valid");
          }
          else
          {
              alert("Please Enter Valid Date.");
              //document.getElementById(id).value = "";
              document.getElementById(id).focus();
          }
      }
      function displaycont(trid)
      {

            alert(trid);
            var trobj = document.getElementById(trid);
            if (trobj.style.display == "none")
            {
                trobj.style.display = '';
            }
            else
            {
                trobj.style.display = 'none';
            }
      }
      function funviewconorder(sid,pcode)
{

    
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="viewconorder.php?sid="+sid+"&pcode="+pcode;
    xmlHttp.onreadystatechange= stateChangeconvieworder
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}
function stateChangeconvieworder()
{
    SetBackground();
    //alert(xmlHttp.readyState);
    //alert(xmlHttp.responseText);
    if(xmlHttp.readyState==1)
    {
    ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
    <!--document.getElementById('dvprocessing').style.display='none';-->
    //alert(xmlHttp.responseText);
    document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='';
    document.getElementById('dvregisterfrm').style.height='374';
    document.getElementById('dvregisterfrm').style.width='415';
    document.getElementById('dvregisterfrm').style.top=CalculateTop('374')+ "px";
    document.getElementById('dvregisterfrm').style.left=CalculateLeft('415')+ "px";
        //alert(document.getElementById('dvregisterfrm').style.height);
        //alert(document.getElementById('dvregisterfrm').style.width);
    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
    unhideIframe();
    }
}

