 function unhideIframe()
        {
            if(ie)
            {
                var theIframe=document.getElementById("fadeboxiframe")
                if(theIframe != null)
                {
                    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 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 myWidth = 0, myHeight = 0;
                if( typeof( window.innerWidth ) == 'number' ) {
                    //Non-IE
                    myWidth = window.innerWidth;
                    myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                    //IE 6+ in 'standards compliant mode'
                    myWidth = document.documentElement.clientWidth;
                    myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                    //IE 4 compatible
                    myWidth = document.body.clientWidth;
                    myHeight = document.body.clientHeight;
                }

                var FinalTop=((myHeight-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 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 ProcessLoader()
            {
                document.getElementById('dvprocessing').style.display = '';
            }
            function SetBackground()
            {
                document.getElementById('dimmer').style.width=GetBodyWidth();
                document.getElementById('dimmer').style.height=GetBodyHeight();
                document.getElementById('dimmer').style.visibility="visible";
            }
            function unsetBackground()
            {
                document.getElementById('dimmer').style.width=0;
                document.getElementById('dimmer').style.height=0;
                document.getElementById('dimmer').style.visibility="";
            }
            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;
                }
                    theWidth=theWidth-80;
 	               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;
                    isMozilla=(document.all)?0:1;
                    if(isMozilla)
                   {
                        theHeight4=0;
                    }
                    else
                    {
                        theHeight4=document.body.scrollHeight;
                    }
                }

                FinalHeight=Math.max(theHeight1,theHeight2,theHeight3,theHeight4);
		     if(navigator.appName != "Microsoft Internet Explorer")
                    {
                         FinalHeight=FinalHeight-85;
                    }
                return FinalHeight+ "px";
            }
function newsletterajaxfunction()
            {
                var str=document.getElementById('txtnlemail').value;
                xmlHttp=GetXmlHttpObject();
                if(xmlHttp==null)
                {
                    alert("Browser does not support HTTP Request");
                    return false;
                }
                var url="newslettersignup.php?email="+str;
                xmlHttp.onreadystatechange= stateChangenewsletterajaxfunction;
                xmlHttp.open("GET",url,true);
                xmlHttp.send(null);
            }
            function stateChangenewsletterajaxfunction()
            {

                SetBackground();
               if(xmlHttp.readyState==1)
                {
                    ProcessLoader();
                }
                if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
                {
                    var popuph = 200;
                    var popupw = 360;
                    var popuph2 = popuph/2;
                    var popupw2 = popupw/2;
                    var winW = screen.width;
                    var winH = screen.height;
                    if (parseInt(navigator.appVersion)>3) {
                        if (navigator.appName=="Netscape") {

                            winW = document.body.offsetWidth;
                            winH = document.body.offsetHeight;
                        }
                        if (navigator.appName.indexOf("Microsoft")!=-1) {
                            winW = document.body.offsetWidth;
                            winH = document.body.offsetHeight;

                        }

                    }

                    var sh = winH;
                    var sw = winW;
                    var sh2 = sh/2;
                    var sw2 = sw/2;

                    var topf = sh2 - popuph;
                    var leftf = sw2 - popupw2;

                    document.getElementById('dvprocessing').style.display='none';
//                    document.getElementById('dvregisterfrm').style.display='';
//                    document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
//                    document.getElementById('dvregisterfrm').style.left= CalculateLeft('430')+ "px";/**/
//                    document.getElementById("dvregisterfrm").innerHTML="";
//                    unhideIframe();
                    document.getElementById('dimmer').style.width=0;
                    document.getElementById('dimmer').style.height=0;
                    document.getElementById('dimmer').style.visibility="hidden";
					if(xmlHttp.responseText == "false")
						alert("You have already signed up for newsletter");
					else
						document.getElementById('icpsignup5845').submit();
                    //alert(xmlHttp.responseText);
					//location.href = 'thankyou.php?page=signup';
                }
            }
function setmessage_newsletter(msg)
{
   /*if(document.getElementById('txtnlemail').value=="" || document.getElementById('txtnlemail').value==msg)
    {
        document.getElementById('txtnlemail').value = msg;
    }*/
	if(document.getElementById('txtnlemail').value == "")
	{
		document.getElementById('txtnlemail').value = msg;
	}
	
}
function unsetmessage_newsletter(msg)
{
   /* if(document.getElementById('txtnlemail').value!="" || document.getElementById('txtnlemail').value!=msg)
    {
        document.getElementById('txtnlemail').value = "";
    }*/
	if(document.getElementById('txtnlemail').value == msg && document.getElementById('txtnlemail').value != "")
	{
		document.getElementById('txtnlemail').value = "";
	}
}
function request_a_quote_ajaxfunction()
            {
                var testresults;
                var str=document.getElementById('txtrapemail').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
                }
                if(document.getElementById('txtrapname').value=="")
                {
                    alert('Please Enter The Name');
                    document.getElementById('txtrapname').focus();
                    return false;
                }
                if(testresults==false)
                {
                    alert('Please Enter Valid Email Address');
                    document.getElementById('txtrapemail').focus();
                    return false;
                }
                if(document.getElementById('txtrapmsg').value=="")
                {
                    alert('Please Enter The Message');
                    document.getElementById('txtrapmsg').focus();
                    return false;
                }
                if(document.getElementById('txtimage_quote').value!=document.getElementById('hdnpinvaluequote').value)
                {
                    alert('Please Enter The Given Code Correctly');
                    document.getElementById('txtimage_quote').focus();
                    return false;
                }
                xmlHttp=GetXmlHttpObject();
                if(xmlHttp==null)
                {
                    alert("Browser does not support HTTP Request");
                    return;
                }
				
				
				   var sel = document.getElementById("cboInterest");
				   var selintrest = new Array(); 
				   var selval = new Array();
				   var count = 0;
				   for (var i = 0; i < sel.options.length; i++) 
				    { 
					   if (sel.options[ i ].selected==true) 
						{
						     selintrest[count] = sel.options[i].value;
						  count++;
						}
					}
					//alert(selintrest);
				
			
                var url="requestquote.php?name="+document.getElementById('txtrapname').value;
				
                url += "&email="+document.getElementById('txtrapemail').value;
                url += "&msg="+document.getElementById('txtrapmsg').value;
				url += "&intrested="+selintrest;
	
                xmlHttp.onreadystatechange= stateChangerequestquoteajaxfunction;
                xmlHttp.open("GET",url,true);
                xmlHttp.send(null);
            }
            function stateChangerequestquoteajaxfunction()
            {

                SetBackground();
                //alert(xmlHttp.readyState);
//                alert(xmlHttp.responseText);
                if(xmlHttp.readyState==1)
                {
                    ProcessLoader();
                }
                if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
                {
                    var popuph = 200;
                    var popupw = 360;
                    var popuph2 = popuph/2;
                    var popupw2 = popupw/2;
                    var winW = screen.width;
                    var winH = screen.height;
                    if (parseInt(navigator.appVersion)>3) {
                        if (navigator.appName=="Netscape") {

                            winW = document.body.offsetWidth;
                            winH = document.body.offsetHeight;
                        }
                        if (navigator.appName.indexOf("Microsoft")!=-1) {
                            winW = document.body.offsetWidth;
                            winH = document.body.offsetHeight;

                        }

                    }

  // alert('sdf');
                    var sh = winH;
                    var sw = winW;
                    var sh2 = sh/2;
                    var sw2 = sw/2;

                    var topf = sh2 - popuph;
                    var leftf = sw2 - popupw2;

                    document.getElementById('dvprocessing').style.display='none';
//                    document.getElementById('dvregisterfrm').style.display='';
//                    document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
//                    document.getElementById('dvregisterfrm').style.left= CalculateLeft('430')+ "px";/**/
//                    document.getElementById("dvregisterfrm").innerHTML="";
//                    unhideIframe();
                    document.getElementById('dimmer').style.width=0;
                    document.getElementById('dimmer').style.height=0;
                    document.getElementById('dimmer').style.visibility="hidden";
//                    alert(xmlHttp.responseText);
					
					alert("Thank you for requesting proposal. We will back to you soon.");
					
					// clear the form and close after sending mail
					document.rightrequestquote.reset();
					closeSlidePanel('formElement');
                }
            }
function check_enter_key(e)
{
    var enter_pressed = 0;//assume enter not pressed
    var key;
    var keychar;
    var reg;
    var _dom = 0;
    _dom=document.all?3:(document.getElementById?1:(document.layers?2:0));
    if(document.all) e=window.event; // for IE


    //this is code for enter key
    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;
            if(KeyID==13)
            {
                enter_pressed = 1;
            }
        }
        else {                       // for Mozilla

            if(e.charCode>0) ch='('+String.fromCharCode(e.charCode)+')';
            KeyID=e.charCode;
            var key__for_mozilla =e.keyCode;
            // alert(key_try);

            if(key__for_mozilla==13)
            {
                enter_pressed = 1;
            }
        }
    }
    //alert(enter_pressed);
    if(enter_pressed == 1)
    {
        document.getElementById('submitbuttonforquote').click();
        //addRow('tbllist','2');
        return false;
    }
    return true;
    //alert(key);
    //keychar = String.fromCharCode(key);
    //reg = /\d/;
    //reg = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    //reg = /^[a-zA-Z\s\'?\b]+$/;

    //regPhone = /\d\d\d\-?\d\d\d\-?\d\d\d\d/;


    //return reg.test(keychar);
}
function check_enter_key_for_newsletter(e)
{
    var enter_pressed = 0;//assume enter not pressed
    var key;
    var keychar;
    var reg;
    var _dom = 0;
    _dom=document.all?3:(document.getElementById?1:(document.layers?2:0));
    if(document.all) e=window.event; // for IE


    //this is code for enter key
    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;
            if(KeyID==13)
            {
                enter_pressed = 1;
            }
        }
        else {                       // for Mozilla

            if(e.charCode>0) ch='('+String.fromCharCode(e.charCode)+')';
            KeyID=e.charCode;
            var key__for_mozilla =e.keyCode;
            // alert(key_try);

            if(key__for_mozilla==13)
            {
                enter_pressed = 1;
            }
        }
    }
    //alert(enter_pressed);
    if(enter_pressed == 1)
    {
        verifyRequired5845();
        //addRow('tbllist','2');
        return false;
    }
    return true;
    //alert(key);
    //keychar = String.fromCharCode(key);
    //reg = /\d/;
    //reg = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    //reg = /^[a-zA-Z\s\'?\b]+$/;

    //regPhone = /\d\d\d\-?\d\d\d\-?\d\d\d\d/;


    //return reg.test(keychar);
}

var glb_videofilepath = null;
function funpopupvideo(videofilepath)

{

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }
    glb_videofilepath = videofilepath;
    var url="videopopup.html";
    xmlHttp.onreadystatechange= stateChangevideopopup

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}


var glb_videofilepath = null;

function funYoutube_videotest(vidoeId)
{
	//document.getElementById('lbCloseLink').click();
	document.getElementById('video-testimonial-border2').style.visibility = '';
	
	xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }
	
    var url="videopopup.php?vidoeId="+vidoeId;
   xmlHttp.onreadystatechange= stateChangevideopopupYouTube1

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)
	

}

function stateChangevideopopupYouTube1()
{
	   //SetBackground();
   
	   
    if(xmlHttp.readyState==1)
    {
		ProcessLoader();
    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
   
		var popuph = 540;
		var popupw = 600;
		
		var popuph2 = popuph/2;
		var popupw2 = popupw/2;
		
		var winW = screen.width;
		//alert(winW);	
		var winH = screen.height;
		//alert(winH);
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
		var sh = winH;
		var sw = winW;
		
		var sh2 = sh/2;
		var sw2 = sw/2;
		var topf1 = sh2 - popuph;
		var leftf1 = sw2 - popupw2;
        document.getElementById('dvprocessing').style.display='none';
        document.getElementById('dvregisterfrm').style.display='';
        document.getElementById('dvregisterfrm').style.top=CalculateTop('540')+ "px";
        document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
		
        document.getElementById("video-testimonial-border2").innerHTML = xmlHttp.responseText;
       // alert(xmlHttp.responseText);
		
		 
        //alert('hello');
        //unhideIframe();
    }
	
}


function funYoutube(vidoeId)
{
	xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }
	
    var url="videopopup.php?vidoeId="+vidoeId;
   xmlHttp.onreadystatechange= stateChangevideopopupYouTube

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)
	

}

function funpopupartwork(artworkfilepath)
{
    //alert(artworkfilepath);
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    var url="artwork.php";
	//alert ('hi');
    xmlHttp.onreadystatechange= stateartworkdownload;
    xmlHttp.open("GET",url,true)
	//alert ('hi');
    xmlHttp.send(null)
}

function funpopupdownload(filepath)
{
  // alert ('hi');
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
   // glb_videofilepath = videofilepath;
	//alert ('hi1');
    var url="downloadtemplate.php";
    xmlHttp.onreadystatechange= stateartworkdownload
    xmlHttp.open("GET",url,true)
	//alert ('hi');
    xmlHttp.send(null)
}

function stateartworkdownload()
{
    SetBackground();
    if(xmlHttp.readyState==1)
    {
		ProcessLoader();
    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {

		var popuph = 560;
		var popupw = 560;
		var popuph2 = popuph/2;
		var popupw2 = popupw/2;
		var winW = screen.width;
		var winH = screen.height;
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
		var sh = winH;
		var sw = winW;
		//alert(sh);
		//alert(sw);
		var sh2 = sh/2;
		var sw2 = sw/2;
		var topf1 = sh2 - popuph;
		var leftf1 = sw2 - popupw2;
        document.getElementById('dvprocessing').style.display='none';
        document.getElementById('dvregisterfrm').style.display='';
        document.getElementById('dvregisterfrm').style.top=CalculateTop('540')+ "px";
        document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
        document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
        //unhideIframe();
		
		
    }
}

function stateChangevideopopupYouTube()
{
  SetBackground();
    if(xmlHttp.readyState==1)
    {
		ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
		var popuph = 540;
		var popupw = 400;
		var popuph2 = popuph/2;
		var popupw2 = popupw/2;
		var winW = screen.width;
		var winH = screen.height;
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
		var sh = winH;
		var sw = winW;
		var sh2 = sh/2;
		var sw2 = sw/2;
		var topf1 = sh2 - popuph;
		var leftf1 = sw2 - popupw2;
        document.getElementById('dvprocessing').style.display='none';
        document.getElementById('dvregisterfrm').style.display='';
        document.getElementById('dvregisterfrm').style.top=CalculateTop('540')+ "px";
        document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
        document.getElementById("dvregisterfrm").innerHTML = xmlHttp.responseText;
    }
}




function stateChangevideopopup()
{
    SetBackground();
   if(xmlHttp.readyState==1)
    {
		ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
		var popuph = 540;
		var popupw = 560;
		var popuph2 = popuph/2;
		var popupw2 = popupw/2;
		var winW = screen.width;
		var winH = screen.height;
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
		var sh = winH;
		var sw = winW;
		var sh2 = sh/2;
		var sw2 = sw/2;
		var topf1 = sh2 - popuph;
		var leftf1 = sw2 - popupw2;
        document.getElementById('dvprocessing').style.display='none';
        document.getElementById('dvregisterfrm').style.display='';
        document.getElementById('dvregisterfrm').style.top=CalculateTop('540')+ "px";
        document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
        document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
        //alert(glb_videofilepath);
        var so = new SWFObject("player.swf", "someSWF", "540", "400", "9", "#E8E8E8");
        so.addVariable("vidURL", glb_videofilepath);
        so.write("dynamicvideodiv");
        unhideIframe();
    }
}
var ie = document.all;
var nn6 = document.getElementById &&! document.all;
//alert(nn6);
var isdrag = false;
var x, y;
var dobj;

function movemouse( e ) {
	//alert('yes');
	//alert(isdrag);
  if( isdrag ) {
	 // alert(ie);
	 //alert(tx + e.clientX - x);
    dobj.style.left = nn6 ? tx + e.clientX - x + "px" : tx + event.clientX - x + "px";
    dobj.style.top  = nn6 ? ty + e.clientY - y + "px" : ty + event.clientY - y + "px";
	//alert(dobj.style.left);
	//alert(tx + e.clientX - x);
	if(ie)
	{
		dobj12.style.left = nn6 ? tx12 + e.clientX - x : tx + event.clientX - x;
    	dobj12.style.top  = nn6 ? ty12 + e.clientY - y : ty12 + event.clientY - y;
		//alert(dobj12.style.left);
	}
    return false;
  }
}

function selectmouse( e ) {
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";
  //alert(fobj.parentElement);
  if(fobj.parentElement == null ) { } else {

	  while (fobj.tagName != topelement && fobj.className != "dragme") {
		  //alert(fobj.parentElement);
		fobj = nn6 ? fobj.parentNode : fobj.parentElement;
	  }
  }

	  if (fobj.className=="dragme") {

		isdrag = true;
		dobj = document.getElementById("dvregisterfrm");
		//alert(dobj);
		tx = parseInt(dobj.style.left+0);
		ty = parseInt(dobj.style.top+0);

		x = nn6 ? e.clientX : event.clientX;
		y = nn6 ? e.clientY : event.clientY;
		//alert(x);
		if(ie)
		{

            dobj12 = document.getElementById("fadeboxiframe");
            if(dobj12 != null)
			{
			tx12 = parseInt(dobj12.style.left+0);
			ty12 = parseInt(dobj12.style.top+0);
			x = nn6 ? e.clientX : event.clientX;
			y = nn6 ? e.clientY : event.clientY;
            }
		}

		document.onmousemove=movemouse;
		return false;
	  }
}
function styledPopupClose()
{
  document.getElementById("dvregisterfrm").innerHTML = "";
  document.getElementById("dvregisterfrm").style.display = "none";
  document.getElementById('dimmer').style.visibility = 'hidden';

  hideIframe();
}
function styledPopupClose1()
{
  document.getElementById("dvregisterfrm").innerHTML = "";
  document.getElementById("dvregisterfrm").style.display = "none";
 // document.getElementById('video-testimonial-border2').style.visibility = 'hidden';
  
  document.getElementById('dispvideo').style.visibility = '';
  
  hideIframe();
}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
function body_onkeydown(evt)
{
    var key=(window.event) ? event.keyCode : evt.which;
    //alert(key);
    if(key==27)
    {
    styledPopupClose();
    }
}
function gototop()
{
   window.scrollTo(0,300); 
   return false; 
}

function videoopen(id)
{
	document.location="video_testimonial.php?intglcode="+id;
	return true;
}

/*********Apply jobs validation *****************/
var extArray = new Array(".doc", ".docx");

    function LimitAttach1()
    {
        var form = document.frmapply;
        var file = document.frmapply.file_Resume.value;
       
        allowSubmit = false;
        if (!file) return;
        while (file.indexOf("\\") != -1)
            file = file.slice(file.indexOf("\\") + 1);
        ext = file.slice(file.indexOf(".")).toLowerCase();
        for (var i = 0; i < extArray.length; i++) {
            if (extArray[i] == ext) { allowSubmit = true; break; }
        }
        if (allowSubmit) return true;
        else
            return false;
    }	
function checkemail(str)
{

	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 chkApplyForm()
{
	if(document.getElementById('txtName').value == "")
	{
		alert("Enter your First name");
		document.getElementById('txtName').focus();
		return false;
	}
	else if(document.getElementById('txtLast').value == "")
	{
		alert("Enter your Last name");
		document.getElementById('txtLast').focus();
		return false;
	}
	else if(document.getElementById('txtMobile').value == "")
	{
		alert("Enter your Mobile Number");
		document.getElementById('txtMobile').focus();
		return false;
	}

	else if(document.getElementById('txtPrimemail').value == "")
	{
		alert("Enter Primary E-Mail");
		document.getElementById('txtPrimemail').focus();
		return false;
	}
	else if(!checkemail(document.getElementById('txtPrimemail').value))
	{
		alert("Enter valid Primary E-Mail address");
		document.getElementById('txtPrimemail').focus();
		return false;
	}
	else if((document.getElementById('txtSecemail').value != "") && (!checkemail(document.getElementById('txtSecemail').value)))
	{
		alert("Please Enter Valid Secondary Email Address");
		document.getElementById('txtSecemail').focus();
		return false;
	}
	else if(document.getElementById('file_Resume').value == "")
	{
    	alert("Please Attach Resume");
		document.getElementById('file_Resume').focus();
		return false;
	}
	else if( document.getElementById('file_Resume').value != "" && !LimitAttach1())
	{
	    alert("Please Attach .doc, .docx file");
		document.getElementById('file_Resume').focus();
		return false;
	
	}
     else if(document.getElementById('txtimage').value=="")
               {
                  alert("Please enter the code shown in image");
                  document.getElementById('txtimage').focus();
                   return false;
               }
			   else if(document.getElementById('txtimage').value!=document.getElementById('pin_value_hdn').value)
			   {
			   alert("Please enter the given code correctly");
			      document.getElementById('txtimage').focus();
                  return false;
			   }
	return true;
}


/*****************Printing page ajax function *****************************/


function disprushjobradio(val)
{
  document.getElementById('hidquantity').value = val;
  if(val=='OPTION_CHOOSE')
  {  document.getElementById('rad_rushjob').style.display ='none';}
  else
  { document.getElementById('rad_rushjob').style.display ='';  }
}

function disp_color_quantity(value)
{
  if(value==-1)
  {
	  document.getElementById('dispcolor1').style.display ='none';
	  document.getElementById('dispcolor').style.display ='';

	  document.getElementById('dispquentity1').style.display ='none';
	  document.getElementById('dispquentity').style.display ='';

  }
  else
  {
   document.getElementById('dispcolor1').style.display ='';
   document.getElementById('dispcolor').style.display ='none';

	document.getElementById('dispquentity').style.display ='none';
	document.getElementById('dispquentity1').style.display ='';

  }
}
function disp_quentity(val)
{
   document.getElementById('hidcolor').value = val;
  if(val==-1)
  {
      document.getElementById('dispquentity1').style.display ='none';
	  document.getElementById('dispquentity').style.display ='';
  }
  else
  {
     document.getElementById('dispquentity').style.display ='none';
	 document.getElementById('dispquentity1').style.display ='';
  }

}


function showQuentity(strval)
{
    xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XMLHTTP!");
	  return;
	  }

  if((strval=='F') || (strval=='FB') || (strval=='BS') )
	 {
	   var radvalstand =   document.getElementById("standard").checked;
		   var radvalrush =   document.getElementById("rushjob").checked;
		   if(radvalstand==true)
		   {
		      var turntimeval = 'S';
		   }
		   else if(radvalrush == true)
		   {
		        var turntimeval = 'R';
		   }

		  var roundcor = document.getElementById("round_corners").checked;
	      if(roundcor==true)
		  {
		     roundcorval = 'RC';
		  }
		  else if(roundcor==false)
		  {
		    roundcorval = '';
		  }

		    var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;
		     var url="printing.ajax.php";
		     url=url+"?strvalue="+queval+"&turntimeval="+turntimeval+"&roundcorner="+roundcorval+"&colortype="+strval;
	 }
	 else if(strval =='round_corners')
	 {
	      var radvalstand =   document.getElementById("standard").checked;
		   var radvalrush =   document.getElementById("rushjob").checked;
		   if(radvalstand==true)
		   {
		      var turntimeval = 'S';
		   }
		   else if(radvalrush == true)
		   {
		        var turntimeval = 'R';
		   }

		  var roundcor = document.getElementById("round_corners").checked;
	      if(roundcor==true)
		  {
		     roundcorval = 'RC';
		  }
		  else if(roundcor==false)
		  {
		    roundcorval = '';
		  }

		    var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;

		   var selcolor = document.getElementById("printcolor");
		   var  colortype = selcolor.options[selcolor.selectedIndex].value;
		   var url="printing.ajax.php";
		  url=url+"?strvalue="+queval+"&turntimeval="+turntimeval+"&roundcorner="+roundcorval+"&colortype="+colortype;

	 }
	 else
	 {
	   var roundcor = document.getElementById("round_corners").checked;
	      if(roundcor==true)
		  {
		     roundcorval = 'RC';
		  }
		  else if(roundcor==false)
          { roundcorval = ''; }

       if(strval=='R')
	   {
			var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;

			var selcolor = document.getElementById("printcolor");
		   var  colortype = selcolor.options[selcolor.selectedIndex].value;
			  var roundcor = document.getElementById("round_corners").checked;

			  if(roundcor==true)
			  {
				 roundcorval = 'RC';
			  }
			  else if(roundcor==false)
			  { roundcorval = ''; }

			 var url="printing.ajax.php";
			url=url+"?strvalue="+queval+"&turntimeval="+strval+"&roundcorner="+roundcorval+"&colortype="+colortype;
	   }
	   else if (strval=='S')
	   {
	        var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;
			var selcolor = document.getElementById("printcolor");
		    var  colortype = selcolor.options[selcolor.selectedIndex].value;
			var roundcor = document.getElementById("round_corners").checked;
			  if(roundcor==true)
			  {
				 roundcorval = 'RC';
			  }
			  else if(roundcor==false)
			  { roundcorval = ''; }

			var url="printing.ajax.php";
			url=url+"?strvalue="+queval+"&turntimeval="+strval+"&roundcorner="+roundcorval+"&colortype="+colortype;
	   }
	   else if( roundcorval == 'RC')
	   {
		   var radvalstand =   document.getElementById("standard").checked;
		   var radvalrush =   document.getElementById("rushjob").checked;
		   if(radvalstand==true)
		   {
		      var turntimeval = 'S';
		   }
		   else if(radvalrush == true)
		   {
		        var turntimeval = 'R';
		   }
		    var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;
		    var selcolor = document.getElementById("printcolor");
		    var  colortype = selcolor.options[selcolor.selectedIndex].value;
			var url="printing.ajax.php";
			url=url+"?strvalue="+queval+"&turntimeval="+turntimeval+"&roundcorner="+roundcorval+"&colortype="+colortype;
		 //alert(url);
	   }
	   else
	   {
	       var radvalstand =   document.getElementById("standard").checked;
		   var radvalrush =   document.getElementById("rushjob").checked;
		   if(radvalstand==true)
		   {
		      var turntimeval = 'S';
		   }
		   else if(radvalrush == true)
		   {
		        var turntimeval = 'R';
		   }

		  var roundcor = document.getElementById("round_corners").checked;
	      if(roundcor==true)
		  {
		     roundcorval = 'RC';
		  }
		  else if(roundcor==false)
		  {
		    roundcorval = '';
		  }

		    var sel = document.getElementById("printQue");
			var  queval = sel.options[sel.selectedIndex].value;

			var selcolor = document.getElementById("printcolor");
		   var  colortype = selcolor.options[selcolor.selectedIndex].value;


				var url="printing.ajax.php";
				url=url+"?strvalue="+strval+"&turntimeval="+turntimeval+"&roundcorner="+roundcorval+"&colortype="+colortype;
	   }

	}
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return true;
}
function stateChanged()
{
   if(xmlhttp.readyState==1)
     {
       ProcessLoader();
     }

	if (xmlhttp.readyState==4)
	  {
	     document.getElementById("val_print_total").innerHTML = xmlhttp.responseText;
		 document.getElementById("val_total").value = xmlhttp.responseText;
		 document.getElementById('dvprocessing').style.display='none';
		 document.getElementById('dimmer').style.width=0;
		document.getElementById('dimmer').style.height=0;
		document.getElementById('dimmer').style.visibility="hidden";
	  }
}
function ChkValid()
{
  if(document.frmprint.paper.value == "-1")
 	{
		alert(" Please Select Paper Type");
		document.frmprint.paper.focus();
		return false;
	}
	else if(document.getElementById('printcolor').value == "-1")
 	{
		 alert("Please Select Color Type");
		 document.getElementById('printcolor').focus();
		 return false;
	}
	else if(document.getElementById('printQue').value == "OPTION_CHOOSE")
 	{
		 alert("Please Select Quantity");
		 document.getElementById('printQue').focus();
		return false;
	}

   else if (document.frmprint.chkagree.checked == false)
    {
		alert("Please Accept Terms & Conditions");
		document.frmprint.chkagree.focus();
		return false;
	}
	
	return true;
}

/*****************Printing page ajax function *****************************/

function onlyNumeric(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	//alert(charCode);
	
	if(charCode == 40 || charCode == 41 || charCode == 45 || charCode == 32)
	{
		return true;
	}
	else if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function ChkValid_contact()
{
	
	if(document.frmprint.txtname.value == "")
	{
		alert("Please Enter Name");
		document.frmprint.txtname.focus();
		return false;
	}
    else if(document.frmprint.txtphone.value == "")
	{
		alert("Please Enter Phone Number");
		document.frmprint.txtphone.focus();
		return false;
	}
	
    if (document.frmprint.txtemail.value == "")
    {
		alert("Please Enter Email Address");
		document.frmprint.txtemail.focus();
		return false;
	}
	else if (!checkemail(document.getElementById('txtemail').value))
    {
        alert("Please enter a valid email address");
        document.frmprint.txtemail.focus();
        return false;
    }

	return true;
	
}

