// JavaScript Document
var dealpop = '';
function jscopy(meintext,url1,eid)
{
	if (window.clipboardData){
		window.clipboardData.setData("Text", meintext);
		document.getElementById(eid).innerText = 'Copied!';
		setTimeout("document.getElementById("+eid+").innerText = ''",1250)
	} else if (window.netscape){
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=meintext;
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid=Components.interfaces.nsIClipboard;
		if (!clip) return false;
		clip.setData(trans,null,clipid.kGlobalClipboard);
		document.getElementById(eid).innerText = 'Copied!';
		setTimeout("document.getElementById("+eid+").innerText = ''",1250)
	}
	gothere(url1,eid);
	return false;
}
//-->

function jscopy2(meintext,url1,eid)
{
	if (window.clipboardData){
		window.clipboardData.setData("Text", meintext);
		document.getElementById(eid).innerText = 'Copied!';
		setTimeout("document.getElementById("+eid+").innerText = ''",1250)
	} else if (window.netscape){
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=meintext;
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid=Components.interfaces.nsIClipboard;
		if (!clip) return false;
		clip.setData(trans,null,clipid.kGlobalClipboard);
		document.getElementById(eid).innerText = 'Copied!';
		setTimeout("document.getElementById("+eid+").innerText = ''",1250)
	}
	gothere(url1,eid.substr(1));
	return false;
}

function rapfir(url1, url2){
		dealpop = window.open(url1,"popup","height=480,width=800,scrollbars,resizable");
		dealpop.onload(setTimeout("dealpop.location='"+url2+"'",1250));
}

function gothere(url,did){
	dealpop = window.open('http://www.vouchercodesmart.co.uk/forums/couponpop.php?did='+did,"popup","height=480,width=800,scrollbars,resizable");
	document.location.href = url;
}

function couponpop(sid,catid){

		dealpop = window.open('http://www.vouchercodesmart.co.uk/couponpop.php?sid='+sid+'&cid='+catid,"popup","height=480,width=800,scrollbars,resizable");
//	document.location.href = url;
}



function hidecomments(cid){
	document.getElementById(cid).style.display = 'none';
}

function viewcomments(ID){
	
	document.all[ID].style.pixelLeft = window.event.clientX;
	document.all[ID].style.pixelTop = window.event.y + document.documentElement.scrollTop;
	document.all[ID].style.zIndex = 5000;
	document.all[ID].style.display = 'block';
	document.all[ID].style.pixelLeft -= document.all[ID].rows[0].clientWidth;

}

function gotoStore(obj){
	document.location.href = 'http://www.vouchercodesmart.co.uk/forums/'+obj.value+'-coupon.html';
	//return true;
}

function goto(loc){
	newwin2 = window.open(loc,'newwin','menubar,resizable,height=640,width=480,left=400,top=0,scrollbars=yes,location=no,toolbar=yes');
	if(newwin2.closed){
		newwin2 = window.open(loc,'newwin','menubar,resizable,height=640,width=480,left=400,top=0,scrollbars=yes,location=no,toolbar=yes');
	}else{
		newwin2.location.href = loc;
		newwin2.focus();
	}

}
function setcookie(loc){
	newwin = window.open(loc,'newwin','menubar,resizable,height=640,width=480,left=400,top=0,scrollbars=yes,location=no,toolbar=yes');		
	newwin.blur();
	window.focus();
	if(newwin.closed){
		newwin = window.open(loc,'newwin','menubar,resizable,height=640,width=480,left=400,top=0,scrollbars=yes,location=no,toolbar=yes');
		newwin.blur();
		window.focus();
	}else{
		newwin.location.href = loc;
		newwin.blur();
		window.focus();
	}
}	

function verifyRequired() {
  if (document.icpsignup["fields_email"].value == "") {
    document.icpsignup["fields_email"].focus();
    alert("The Email field is required.");
    return false;
  }

    if (
      !document.icpsignup["listid:9869247"].checked &&
      !document.icpsignup["listid:9946232"].checked &&
      true)  {
    alert("The Lists field is required.");
    return false;
  } 

return true;
}

function log_out()
{
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('$vbphrase[sure_you_want_to_log_out]'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}
