		function validator(theForm)
			{
			if (checkReq () == false)
				{
				return (false)
				}
			else
			  {
			  return (true);
		    }
			}

		function checkReq ()
			{

		var i;
		var atchar;
		var dotchar;

			if (document.forms[0].EmailAddress.value == '' || document.forms[0].EmailAddress.value == null)
				{
				alert("Please enter an email address.");
				document.forms[0].EmailAddress.focus()
				return (false)
			  }
			  		
			else
			  {
        var s;
  		  for (i=2;i<=document.forms[0].EmailAddress.value.length;i++)
	        {
			    s = document.forms[0].EmailAddress.value.charAt(i - 1);                  
					if (s == "@")
						{
						atchar = 1;
					  }          
					if (s == ".")
						{
						dotchar = 1;
					  }          
					}

				if (atchar != 1 || dotchar != 1)
					{
					alert("Please enter a valid email address.");
					document.forms[0].EmailAddress.focus()
		    	return (false)
			    }          
				}
			}



	function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
	}		


function getRef() {

hu = document.referrer;
rf = 'nk';


if (hu=='')
{
rf = 'dt';
}

if (hu.indexOf('ezesoftware')!=-1)
{
rf = 'cn_ez';
}
if (hu.indexOf('free2collect')!=-1)
{
rf = 'cn_f2';
}
if (hu.indexOf('dcemu')!=-1)
{
rf = 'cn_dc';
}
if (hu.indexOf('recipes4us')!=-1)
{
rf = 'cn_r4';
}
if (hu.indexOf('icollectit')!=-1)
{
rf = 'cn_ic';
}

if (hu.indexOf('mp3easy')!=-1)
{
rf = 'cn_m3';
}
if (hu.indexOf('monkeon')!=-1)
{
rf = 'cn_mk';
}
if (hu.indexOf('lenshoods')!=-1)
{
rf = 'lh';
}
if (hu.indexOf('stores.ebay.co.uk')!=-1)
{
rf = 'es';
}
if (hu.indexOf('wiids')!=-1)
{
rf = 'wd';
}
if (hu.indexOf('lenshoods')!=-1)
{
rf = 'lh';
}
if (hu.indexOf('alt-flix')!=-1)
{
rf = 'af';
}
if (hu.indexOf('in-miniature')!=-1)
{
rf = 'im';
}

if (hu.indexOf('google.co.uk')!=-1)
{
rf = 'gs';
  if (hu.indexOf('google.co.uk/products')!=-1)
  {
    rf = 'gp';
  }
}

return rf;

}

function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}






			function showcodeopenwindow(strcode, siteurl, limit, p, q)
			{
				if(strcode != '')
					{
						document.getElementById(strcode).style.display='block';
						document.getElementById(strcode+'link').style.display='none';
				
						for(i=1;i<limit;i++)
						{
							document.getElementById(strcode+'_'+i).style.display='block';
							document.getElementById(strcode+'_'+i+'link').style.display='none';
						}

						if(siteurl != '')
							{



							if(q=2)
							{
								var affid = getRef();								
								siteurl = siteurl.replace("[affid]", affid);
							}


							if(p==0 || p=='' || p==null)
								{
									AFWin=window.open(siteurl, strcode, config='width=400, height=400,top=0,left=0, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, directories=yes, status=yes');
									AFWin.blur();
								}
								

								else
								{
									AFWin=window.open(siteurl, strcode);

								}
				
		

							}



								


					}
			}








			function showoffer(siteurl)
			{

						if(siteurl != '')
							{


									var affid = getRef();								
									siteurl = siteurl.replace("[affid]", affid);
									AFWin=window.open(siteurl);



if (siteurl.indexOf('churchill.com')!=-1)
{
top.location="http://track.omguk.com/?PID=1392&AID=61310&CID=2839463&MID=1236&WID=20410&UID=" + affid;
}
		

							}



								


			}




			function showcodeinnewwindow(rid, siteurl, l)
			{
				if(rid != '')
					{

						AFWin=window.open('http://www.promotionalvoucherdiscountcodes.co.uk/index.asp?t=' + rid + "&s=" + l, rid);


						if(siteurl != '')
							{
							top.location=siteurl;
							}
					}
			}

