// JavaScript Document
function codevisible() 
	{
	var counter=parseInt(number);
	for (i = 0; i < counter; i++)
		{
			var img='couponimg'+i;
			var code='couponcode'+i;
			document.getElementById(img).style.display = 'none';
			document.getElementById(code).style.display = 'inline';
		}
	var tr=document.getElementsByTagName('tr');
	for(var k=0; k<tr.length; k++)
		{
			if(tr[k].className=='code_usage_report')
				tr[k].style.display='none';

			if(tr[k].className=='survey_question')
				tr[k].className='survey_question_show';
		}
	//class document.getElementById(code).style.display = 'inline';
//	code_usage_report
//survey_question
	}

function openPopUp(URL)
	{ 
	popunder=top.window.open(URL);
	popunder.blur();
	top.window.focus();
	}

function MM_reloadPage(init) 
	{  //reloads the window if Nav4 resized
  	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 	{
    	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}

function CallAjax(param, url)
	{
		var j=0;
		var callUrl=url;
		var content;
		callUrl+=param;
		
		xmlreqGET(callUrl);
	}
	
function SendSurvey(codeHolder, pageUrl, merchant, answer) 
	{
		var couponcode=document.getElementById(codeHolder).innerHTML;
		ajaxUrl+=couponcode+'&merchant='+merchant+'&url='+pageUrl+'&ans='+answer;
		xmlreqGET(ajaxUrl);
		alert("Merci ");
	}
function redirect1(MID,CouponID)
	{ //alert(MID,CID);
		window.location=("Merchant.php?Merchant_ID="+MID+"&Coupan_ID="+CouponID+"&s=1&u=1")	
	}
function redirect2(MID,CouponID)
	{ 
		window.location=("Merchant.php?Merchant_ID="+MID+"&Coupan_ID="+CouponID+"&s=0&u=1")	
	}
function redirectNM1(MID,NM,CouponID)
	{	
		window.location=("MerchantNM.php?Merchant_ID="+MID+"&txtMerchantName="+NM+"&Coupon_ID="+CouponID+"&s=1&u=1")
	}
function redirectNM2(MID,NM,CouponID)
	{ //alert(NM);
		window.location=("MerchantNM.php?Merchant_ID="+MID+"&txtMerchantName="+NM+"&Coupon_ID="+CouponID+"&s=0&u=1")
	}