﻿// JScript File
// HomeHeader.ascx -- javascript
   function CheckKey(event) 
                            {
                              
                                //capture ENTER key
                                if (typeof(event)=="object" && event.keyCode == 13) 
                                {
//                                   if(getAspNetForm().action.toLowerCase()=="../sitemap/searchtermresult.html")
//                                   {
//                                     alert(event.keyCode);
                                     goToSearch(); 
                                     //cancel the asp form submission event as we are submitting google custom search form
                                    // event.returnValue=false;
                                     //event.cancelBubble = true;                                  
                                  // }
                                   return false;
                                }
                                else
                                return true; 
                            }

                    function goToSearch()
                    {
                        
                        var searchTerm="";
                        var searchTermLeft="";
                        searchTerm=document.getElementById('HdnSearch').value; 
                   
                         if(document.getElementById('HdnSearch')!=null) 
                            {  
                                searchTerm=document.getElementById('HdnSearch').value;  
                               
                            }
                          if(searchTerm.length>0)
                           {
                             // alert(searchTerm.length);
                              //pass information to google search custom form
                              document.getElementById("q").setAttribute("value",searchTerm);
                              document.getElementById("searchbox_009631452862648243672:qhrz_cydis8").submit();
                          }
                          else
                          {
                               document.getElementById('divSearchError').innerHTML = "<strong>Please enter a term to search.</strong>"
                               //cancel the asp form submission event as we do not want to proceed further
                                return false;
                          }
                    }
            
       function FeedbackWinWithURL(url)
		{
		
		
		    window.open(url, 'mywindow', 'width=850, height=550 resize=yes,scrollbars=yes');
		}
		
		
		function ShowLink(Anchorid)
		{
		
		    document.getElementById(Anchorid).style.textDecoration='underline';
		     document.getElementById(Anchorid).style.color='orange';
		}
		
		function Disablelink(Anchorid)
		{
		    document.getElementById(Anchorid).style.textDecoration='none'  ;
		    document.getElementById(Anchorid).style.color='Black';
		}
		
		
		
		
         //blinking for both mozilla and ie

        spe=1000;
        na=document.all.tags("blink");
        swi=0;
        bringBackBlinky();

        function bringBackBlinky() {

        if (swi == 1) {
        sho="visible";
        shd="hidden";
        swi=0;
        }
        else {
        sho="hidden";
        shd="visible"
        swi=1;
        }

        for(i=0;i<na.length-1;i++) {
        na[i].style.visibility=sho;
        na[i+1].style.visibility=shd;

        }

        setTimeout("bringBackBlinky()", spe);
        }
		
    
        function showwindow(strMailId)
	    {	strMailId = "../ContactUS.aspx?mid="+strMailId;
		    var win= window.open(strMailId,'','resizable=yes,scrollbars=yes,width=850,height=550,top=145,left=300');
	    }
	    
	    function ShowMenuItem(spanid)
	    {
	   // alert(spanid);
	   // alert(document.getElementById(spanid));
	        document.getElementById(spanid).style.color ='gray';
	    
	    }
	    
	        function showPrivacyPolicy()
        {
    
        window.open('../static/PrivacyPolicy.aspx','','resizable=yes,scrollbars=yes,width=750,height=850,top=145,left=300');
        }
         function showTermsConditions()
        {
        
            window.open('../static/Conditions.aspx','','resizable=yes,scrollbars=yes,width=750,height=850,top=145,left=300');
        }
	   
       

  function OpenModelPopup()
    { 
      //  document.getElementById ('tdDisplayName').innerHTML='';
        document.getElementById ('ctl00_txtName').value='';
        document.getElementById ('ModalPopupDiv').style.visibility='visible';
        document.getElementById ('ModalPopupDiv').style.display='';
        document.getElementById ('ModalPopupDiv').style.top= Math.round ((document.documentElement.clientHeight/2)+ document.documentElement.scrollTop)-100 + 'px';
        document.getElementById ('ModalPopupDiv').style.left='400px';
        
        document.getElementById ('MaskedDiv').style.display='';
        document.getElementById ('MaskedDiv').style.visibility='visible';
        document.getElementById ('MaskedDiv').style.top='200px';
        document.getElementById ('MaskedDiv').style.left='0px';
        document.getElementById ('MaskedDiv').style.width=  document.documentElement.clientWidth + 'px';
        document.getElementById ('MaskedDiv').style.height= document.documentElement.clientHeight+ 'px';
    }
    function CloseModelPopup()
    {
        document.getElementById ('MaskedDiv').style.display='none';
        document.getElementById ('ModalPopupDiv').style.display='none';
        document.getElementById ('ModalPopupDiv').style.visibility='hidden';
         document.getElementById ('MaskedDiv').style.visibility='hidden';
    }
    