// JavaScript Document
 function load_me(i) {
   if(i == 0)
   {
   document.location.href = "/index.php"
   }
   else if(i == 1)
    {
	document.location.href = "/A-beststore-discount-coupons"
	}
	else if(i == 2)
    {
	document.location.href = "/hot-deals.php"
	}
	else if(i == 3)
    {
	
	document.location.href="/top-deals.php";
	}
	else if(i == 4)
    {
	showWin();
	}
	else
	return false;
	
	return;
 }


function clearField(obj) {
     if (obj.defaultValue==obj.value) obj.value = ''; 
	 obj.style['color'] = 'black';
	 }
	 
function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}	 
function checkval()
{
	var frm = document.searchfrm;
	if (frm.keyword.value == "Search free coupons for 20,000 online stores..." )
	{
		alert("Please enter store name e.g. care.com");
		frm.keyword.focus();
		return false;
	}
	else if (frm.keyword.value == "Search product deals from online stores..." )
	{
		alert("Please enter keyword e.g. digital camera");
		frm.keyword.focus();
		return false;
	}
	else if (stripCharsInBag (frm.keyword.value, " ") == "" )
	{
		alert("Please Enter a Keyword. The Store Name Should Not be Blank");
		frm.keyword.focus();
		return false;
	}


	return true;
}
function showWin()
{
	dest = "/help.php";
	var mh = 400;
	var mw = 650;
	TheWin = window.open(dest,'image','height=' + mh + ',width=' + mw + ',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
	TheWin.resizeTo(mw+2,mh+30);
	TheWin.focus();
}

