function showPopBackgroundAddSelection()
{var myHeight;if(typeof window.innerHeight!='undefined')
{myHeight=window.innerHeight;}
else if(typeof document.documentElement.clientHeight!='undefined')
{myHeight=document.documentElement.clientHeight;}
else
{myHeight=document.getElementsByTagName('body')[0].clientHeight;}
if(document.body.clientHeight>=myHeight)
{document.getElementById("progresslayer").style.height=document.body.clientHeight+"px";}
else
{document.getElementById("progresslayer").style.height=myHeight+"px";}
document.getElementById("progresslayer").style.display="block";}
function hidePopBackgroundAddSelection()
{document.getElementById("progresslayer").style.display="none";}
function setPosition()
{var vDiv=document.getElementById('DivMsgCart');var scrollPosition;if(window.pageYOffset)
scrollPosition=window.pageYOffset;else if(document.documentElement.scrollTop)
scrollPosition=document.documentElement.scrollTop;else
scrollPosition=document.body.scrollTop;scrollPosition=scrollPosition+150;if(scrollPosition<140)
scrollPosition=140;vDiv.style.top=scrollPosition+'px';}
window.onscroll=setPosition;function displaymsgfor3dModel(objecttype)
{document.getElementById("divask3D").style.display="block";document.getElementById("divaskshader").style.display="none";if(objecttype==1)
{document.getElementById("divask3D").style.display="none";document.getElementById("divaskshader").style.display="block";}
showPopBackgroundAddSelection();jQuery('#DivMsg3dModel').fadeIn("fast");}
function displaymsgforClientContactPopup(CompanyName)
{showPopBackgroundAddSelection();document.getElementById('contactcompanyNameId').innerHTML=CompanyName;jQuery('#DivClientContact').fadeIn("fast");}
function displaymsgforcart()
{document.getElementById('divselectionmsg').style.display="block";document.getElementById('divdemand3dmsg').style.display="none";document.getElementById('divcontactclientmsg').style.display="none";document.getElementById('divloginpopup').style.display="none";showPopBackgroundAddSelection();jQuery('#DivMsgCart').fadeIn("fast");var fadeouttime=1000;if(document.getElementById("hdTotalCartItems")!=null)
{if(document.getElementById("hdTotalCartItems").value=="1")
{fadeouttime=2500;}}
jQuery('#progresslayer').fadeOut(fadeouttime);jQuery('#DivMsgCart').fadeOut(fadeouttime);}
function displaymsgfor3ddemand()
{document.getElementById('divdemand3dmsg').style.display="block";document.getElementById('divselectionmsg').style.display="none";document.getElementById('divloginpopup').style.display="none";document.getElementById('divcontactclientmsg').style.display="none";showPopBackgroundAddSelection();jQuery('#DivMsgCart').fadeIn("fast");var fadeouttime=1000;if(document.getElementById("hdTotalCartItems")!=null)
{if(document.getElementById("hdTotalCartItems").value=="1")
{fadeouttime=2500;}}
jQuery('#progresslayer').fadeOut(fadeouttime);jQuery('#DivMsgCart').fadeOut(fadeouttime);}
function close3dmodel()
{jQuery('#DivMsg3dModel').fadeOut(50);jQuery('#progresslayer').fadeOut(50);}
function closeclientmodel()
{jQuery('#DivClientContact').fadeOut(50);jQuery('#progresslayer').fadeOut(50);}
function displaymsgforcontact()
{document.getElementById('divcontactclientmsg').style.display="block";document.getElementById('divdemand3dmsg').style.display="none";document.getElementById('divselectionmsg').style.display="none";document.getElementById('divloginpopup').style.display="none";showPopBackgroundAddSelection();jQuery('#DivMsgCart').fadeIn("fast");var fadeouttime=1000;if(document.getElementById("hdTotalCartItems")!=null)
{if(document.getElementById("hdTotalCartItems").value=="1")
{fadeouttime=2500;}}
jQuery('#progresslayer').fadeOut(fadeouttime);jQuery('#divcontactclientmsg').fadeOut(fadeouttime);jQuery('#DivMsgCart').fadeOut(fadeouttime);}
function displayloginpopup(logintype)
{if(logintype=="contact")
{document.getElementById('msgpopupval').innerHTML=str775;}
else
{document.getElementById('msgpopupval').innerHTML=str671;}
document.getElementById('divloginpopup').style.display="block";document.getElementById('divcontactclientmsg').style.display="none";document.getElementById('divdemand3dmsg').style.display="none";document.getElementById('divselectionmsg').style.display="none";document.getElementById('txtusername').value="";document.getElementById('txtpassword').value="";document.getElementById('msgloginerror').innerHTML="";showPopBackgroundAddSelection();document.getElementById('DivMsgCart').style.top="250px";jQuery('#DivMsgCart').fadeIn("fast");}
function closepopup()
{jQuery('#DivMsgCart').fadeOut(50);jQuery('#progresslayer').fadeOut(50);}
/* Dhaval Dave : Below logincheck function called from selectionaddmessage.php page which will display login in DIV tag
function logincheck()
{if(document.getElementById('txtusername').value=="")
{alert(str188);document.getElementById('txtusername').focus();return false;}
if(document.getElementById('txtpassword').value=="")
{alert(str189);document.getElementById('txtpassword').focus();return false;}
var loginusername=document.getElementById('txtusername').value;var loginpassword=document.getElementById('txtpassword').value;var pars="";pars+="&username="+loginusername+"&password="+loginpassword;var url=strbaseurl+"/loginpopup.php?";new Ajax.Updater('msgloginerror',url+pars,{evalScripts:true,onComplete:function(){if(document.getElementById('msgloginerror').innerHTML=="")
{document.frmloginpopup.submit();}}});}
*/
function logincheck()
{if(document.getElementById('txtusername').value=="")
{alert(str330);txtusername.getElementById('txtusername').focus();return false;}
if(document.getElementById('txtpassword').value=="")
{alert(str189);document.getElementById('txtpassword').focus();return false;}
var loginusername=document.getElementById('txtusername').value;var loginpassword=document.getElementById('txtpassword').value;var pars="";pars+="&username="+loginusername+"&password="+loginpassword;var url=strbaseurl+"/loginpopup.php?";new Ajax.Updater('msgloginerror',url+pars,{evalScripts:true,onComplete:function(){if(document.getElementById('msgloginerror').innerHTML=="")
{document.frmloginpopup.submit();}}});}
