function showcode(code, popup)
{
	if (popup == "1")
	{
		window.open("http://www.coupondorks.com/index2.php?merchantid=" + code);
		
	}
	return true;
}

function showCode2(code, popup, thecoupon, thecode)
{
	if (popup == "1")
	{
		window.open("http://www.coupondorks.com/popup.php?merchantid=" + code + "&thecoupon=" + thecoupon + "&thecode=" + thecode, "popup","noresize,dependent,titlebar=0,width=610,height=207,screenX=0,left=0,screenY=0,top=0");
	}
	return true;
}

function submitForm(ad)
	{   var ad = document.getElementById('woot');
		var req = null; 

		document.getElementById("zone").innerHTML = "Started...";
 
		if (window.XMLHttpRequest)
		{
 			req = new XMLHttpRequest();
			if (req.overrideMimeType) 
			{
				req.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) 
		{
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e)
			{
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
	        	}



		req.onreadystatechange = function()
		{ 
			document.getElementById("zone").innerHTML = "Loading...";
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					document.getElementById("zone").innerHTML  = req.responseText;	
				}	
				else	
				{
					document.getElementById("zone").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		}; 
		req.open("GET", "http://www.coupondorks.com/data.php?merchantid=" + ad.value, true); 
		req.send(null); 
	} 
	
function submitEmail()
	{   var email = document.getElementById('newemail');
	    var merchantname = document.getElementById('merchantname');
	    
	    
	    
		var req = null; 

		document.getElementById("zed").innerHTML = "Started...";
 
		if (window.XMLHttpRequest)
		{
 			req = new XMLHttpRequest();
			if (req.overrideMimeType) 
			{
				req.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) 
		{
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e)
			{
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
	        	}



		req.onreadystatechange = function()
		{ 
			document.getElementById("zed").innerHTML = "Loading...";
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					document.getElementById("zed").innerHTML  = req.responseText;	
				}	
				else	
				{
					document.getElementById("zed").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		}; 
		req.open("GET", "http://www.coupondorks.com/dataemail.php?email=" + email.value + "&merchantname=" + merchantname.value, true); 
		req.send(null); 
	} 

function bookmark(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


	
