var WindowObjectReference;
function validate_input ( form ) 
{    var FIELD_MESSAGE = "Please Enter Search Criteria before clicking Search Button."
 
  if ( !is_blank ( form.ctl00_phMain_SearchTextBox ) )
	{
		return display_message(form.ctl00_phMain_SearchTextBox,  FIELD_MESSAGE )
	};
	
	if ( form.ctl00_phMain_ebuyershub.checked == true )
		{
	        return true
	    }
	 else
	    {   if ( form.ctl00_phMain_google.checked == true )
	        {
	         openRequestedPopup ('http://www.google.com/search?q=', 'mywindow', form.ctl00_phMain_SearchTextBox.value);
	         WindowObjectReference.focus();
	         return false
	         };
	         
	         if ( form.ctl00_phMain_yahoo.checked == true )
	        {
	         openRequestedPopup ('http://search.yahoo.com/search?p=', 'mywindow', form.ctl00_phMain_SearchTextBox.value);
	         WindowObjectReference.focus();
	         return false
	         };
	         
	         if ( form.ctl00_phMain_msn.checked == true )
	        {
	         openRequestedPopup ('http://search.msn.com/results.aspx?q=', 'mywindow', form.ctl00_phMain_SearchTextBox.value);
	         WindowObjectReference.focus();
	         return false
	         };
	    };
};
function openRequestedPopup(url, windowname, qparameter)
{
    WindowObjectReference = window.open(url+qparameter,windowname, "menubar=yes,location=no,resizable=yes,scrollbars=yes,status=yes,left=200,top=0");
};

function display_message(strFieldName, strMessage)
{    	alert ( strMessage ) 
    	strFieldName.focus () 
    	return false
};
function is_blank ( strFieldName) 
{ 	var li_counter, i
  	li_counter = 0; 
 	 for (i=0 ; i < strFieldName.value.length; i++) 
 	 { 
     		if ( strFieldName.value.charAt(i) == " " ) 
		         li_counter ++ 
	  } 
	  if ( (li_counter == strFieldName.value.length)  ||  (strFieldName.value == "")) 
	  { 
  	
	     return false
	  } 
	  else 
	     return true
};

function MakeHomePage(form)
{    
     var a="http://www.ebuyershub.com/"  
    if(BrowserName(this.form) == "Microsoft Internet Explorer")
    {
        setHomePage(a);
        document.getElementById("ctl00_phMain_BtnHP").style.visibility="hidden";
    }
    else
    alert("only works in (Internet Explorer) IE 4.0 or higher Browser Versions!");
    };
 
function BrowserName(form)
{  
    var x = navigator
    return  x.appName;
};

function setHomePage(siteURL) {
  if (document.all) 
  {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage(siteURL);
  }
  else
    alert("only works in IE 4.0 or higher!");
};

function verifyHomePage(sPageURL)
{      var x
            document.body.style.behavior = "url(#default#homepage)";
            x = document.body.isHomePage(sPageURL);
            return x;
};

function showhide()
{   
    var a="http://www.ebuyershub.com/"   
    if(BrowserName(this.form) != "Microsoft Internet Explorer")
        {
          document.getElementById("ctl00_phMain_BtnHP").style.visibility="hidden";
        }
     else
     { 
        if(Boolean(document.getElementById("ctl00_phMain_BtnHP")))
        {
            if (verifyHomePage(a))
            {
                document.getElementById("ctl00_phMain_BtnHP").style.visibility="hidden";
            };
         };
     };
     
               
};
