﻿// JScript File
function s(c) 
{
    window.document.body.onSelectStart = c;
    alert(c);
}


function whichButton(event)
{
    if (event.button==2)//RIGHT CLICKs
{
//    alert("Not Allow Right Click!");
}

}
function noCTRL(e)
{
    var code = (document.all) ? event.keyCode:e.which;

//    var msg = "Sorry, this functionality is disabled.";
//    if (parseInt(code)==17) //CTRL
//    {
////        alert(msg);
//        window.event.returnValue = false;
//    }
} 
 function RemoveText(i)
    {
        if(i.value=='Subscribe to Our Newsletter')
        {
            i.value='';
        }
    }
    function AddText(i)
    {
//       Page = eval ("document.aspnetform." + i).value  ;
 
       if(i.value == '')
        {
         i.value='Subscribe to Our Newsletter';
        }
    }
    function AddTextSearch(i)
    {
//       Page = eval ("document.aspnetform." + i).value  ;
 
       if(i.value == '')
        {
         i.value='Search';
        }
    }
     function RemoveTextSearch(i)
    {
        if(i.value=='Search')
        {
            i.value='';
        }
    }
    function redirect(i)
    {
    
   
         document.location.href="http://www.google.co.in/search?hl=en&q="+ i.value ;
      }
      
   function disableEnterKey(e)
    {
        var key;
        
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox     

     if (key == 13) 
     {
       // var search = document.getElementById('ctl00_txtSearch').value;
       var search = document.getElementById('qq').value;
       var cx1 = document.getElementById('cx11').value;
       var cof=document.getElementById('cof').value;       
      
       if (search!="")
        {      
             var RadioSearch = document.getElementById ('RDWeb').checked;  
            if (RadioSearch == true)
            {
                document.location.href="http://www.google.co.in/search?hl=en&q="+ search  ;
            }
            else if(RadioSearch == false)
            {
                document.location.href="Search_Result_G.aspx?cx="+cx1+"&cof="+cof+"&q="+search;  

            }
            document.aspnetform.submit();
        }else if(search=="")
        {
            alert("Please enter search parameter");
             return false;
        }   
              
      
     }
     
    }
  function Google()
  {
   
        var search = document.getElementById('qq').value;       
        var cx1 = document.getElementById('cx11').value;
        var cof=document.getElementById('cof').value;        
        if (search!="")
        {      
             var RadioSearch = document.getElementById ('RDWeb').checked;  
            if (RadioSearch == true)
            {
                document.location.href="http://www.google.co.in/search?hl=en&q="+ search  ;
            }
            else if(RadioSearch == false)
            {
                document.location.href="Search_Result_G.aspx?cx="+cx1+"&cof="+cof+"&q="+search;  

            }
            document.aspnetform.submit();
        }else if(search=="")
        {
            alert("Please enter search parameter");
             return false;
        }    
  }  
  onload=function()
     {
	    var RightBorder = document.getElementById('RightBorder').offsetHeight;
	    var ScrollDiv = document.getElementById('ScrollDiv').offsetHeight;
	    var ScrollDivH = ScrollDiv + 97;
	    var hRdiv = RightBorder;
	    var HLDiv=ScrollDiv;
	    
	    if (hRdiv < 500 && HLDiv < 500 )
	    {
	    	document.getElementById('RightBorder').style.height="500px";
	    	document.getElementById('ScrollDiv').style.height="403px";
	   
	    }
	    else
	    {
	    if (RightBorder < ScrollDivH)
	    {
	    	document.getElementById('RightBorder').style.height=parseInt(ScrollDivH) +"px";
	   
	    }
	    if (RightBorder > ScrollDivH)
	    {
	    	document.getElementById('ScrollDiv').style.height=parseInt(RightBorder - 97) +"px";
	   
	    }
	    }
 }
 
 var IntI 
 IntI =2;
 function showhide(strName)
 {
    if(strName=="play")
    {
      //  document.aspnetForm.ctl00$hd_StartSlideText.value="Start";
      // document.getElementById("ctl00_hd_StartSlideText").value="Start";
        document.getElementById("div_play").style.display ="none";
        document.getElementById("div_stop").style.display ="block";
        tslide = setTimeout("auto()", 5000);
        
    }
    else
    {
     //   document.aspnetForm.ctl00$hd_StartSlideText.value="";
    // document.getElementById("ctl00_hd_StartSlideText").value="";
       document.getElementById("div_play").style.display ="block";
       document.getElementById("div_stop").style.display ="none";
       clearTimeout(tslide);
       
    }
   
 }
 function mouseOutForMar()
 {
    if(strCheck=="")
    {
         document.getElementById('mardealHome').start();
    }
 }
 function auto()
 {
    document.getElementById("slide_1").style.display="none";
    document.getElementById("slide_2").style.display="none";
    document.getElementById("slide_3").style.display="none";
    if(IntI ==1)
    {
        //hideImage(1);
        document.getElementById("slide_1").style.display="block";
        initImage(1);
        IntI = IntI +1
    }
    else if(IntI ==2)
    {
      //  hideImage(2);
        document.getElementById("slide_2").style.display="block";
        initImage(2);
        IntI =IntI +1
    }
    else if(IntI ==3)
    {
      //  hideImage(2);
        document.getElementById("slide_3").style.display="block";
        initImage(3);
        IntI =1
    }
    tslide = setTimeout("auto()", 5000);
 }
 function setOpacity(obj, opacity) 
	{
	  opacity = (opacity == 100)?99.999:opacity;
	  
	  // IE/Win
	  obj.style.filter = "alpha(opacity:"+opacity+")";
	  
	  // Safari<1.2, Konqueror
	  obj.style.KHTMLOpacity = opacity/100;
	  
	  // Older Mozilla and Firefox
	  obj.style.MozOpacity = opacity/100;
	  
	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  obj.style.opacity = opacity/100;
	}
	function fadeIn(objId,opacity) 
	{
	  if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
		  setOpacity(obj, opacity);
		  opacity += 10;
		  window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
	  }
	}
	function initImage(slideId) 
	{
	  intEnd = slideId * 4;
	  intStart =intEnd -3;
	  for(intA=intStart;intA<=intEnd;intA++)
	  {
	      imageId = 'imgSlide_'+intA;
	      image = document.getElementById(imageId);
	      setOpacity(image, 0);
	      image.style.visibility = 'visible';
	      fadeIn(imageId,0);
	  }
	}
	function hideImage(slideId)
	{
	  
	   intEnd = slideId * 4;
	   intStart =intEnd -3;
	   for(intA=intStart;intA<=intEnd;intA++)
	   {
	     imageId = 'imgSlide_'+intA;
	     image = document.getElementById(imageId);
	     image.style.visibility = 'hidden';
	   }
	        
	}
	function directionMarquee(strTemp)
{
   
	if(strTemp =="left")
	{
	  document.getElementById("dealMarq").direction = 'left';
	  document.getElementById("dealMarq").scrollAmount=8;
	}
	else
	{
	 document.getElementById("dealMarq").direction = 'right';	
	 document.getElementById("dealMarq").scrollAmount= 8;
	
	}

}
function speeddown()
{
    document.getElementById("dealMarq").scrollAmount=3;
}
