// JavaScript Document
 
function showCoupon(mer,cou)
{
	//alert("infun");
	dest = "../../couponhelp.php?coupon="+cou+"&merchant="+mer;
	var mh = 430;
	var mw = 420;
	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);
TheWin.focus();

//TheWin = window.open(dest,"couponhelp","width=420,height=350,scrollbars=yes,resizable=yes");
}

function showDeal(d)
{
	//alert("infun");
	dest = "../../dealnow.php?deal="+d;
	var mh = 450;
	var mw = 420;
	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);
TheWin.focus();

//TheWin = window.open(dest,"couponhelp","width=420,height=350,scrollbars=yes,resizable=yes");
}

function checkval()
{
	keyword = document.list.keyword.value;
	
	if(keyword=="")
	{
			alert("Please Enter a Keyword. The Store Name Should Not be Blank");
			document.list.keyword.focus();
			return false;
	}
	if(keyword=="Get free coupon codes for 20000 stores...")
	{
			alert("Please Enter a Store Name  e.g 'example.com'");
			document.list.keyword.focus();
			return false;
	}
	return true;
		
}


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;
}
