// JavaScript Document
function show_voucher(objid,merchantid,icid,storename,vouchercode) {
	document.getElementById('voucherreveal'+objid).innerHTML = vouchercode;
	document.getElementById('revealbtn'+objid).innerHTML = '';
	document.getElementById('revealmsg'+objid).innerHTML = '<br><b>Your discount code is shown above.<\/b><br><br><b>The '+storename+' website has been opened in a new window</b>. Simply copy and paste the code '+vouchercode+' and enter it at the checkout.<br><br><b>If the website did not open,<\/b> <a href=\"http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/\" target=\"_blank\">please click here<\/a>';
	window.open('http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/','','width=1000,height=700,left=20,top=20,toolbar=1,location=1,status=1,menubar=1,resizable=1,scrollbars=1').blur();
	window.focus();
}
function show_voucher_small(objid,merchantid,icid,storename,vouchercode) {
	document.getElementById('voucherreveal'+objid).innerHTML = '<div class=\"smallvoucher\">'+vouchercode+'</div>';
	document.getElementById('revealbtn'+objid).innerHTML = '';
	document.getElementById('revealmsg'+objid).innerHTML = '<div class=\"pad5\"><br>Your discount code is shown below. <br><b>The '+storename+' website has been opened in a new window</b>.<br>If the website did not open, <a href=\"http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/\" target=\"_blank\">click here<\/a></div>';
	window.open('http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/','','width=1000,height=700,left=20,top=20,toolbar=1,location=1,status=1,menubar=1,resizable=1,scrollbars=1').blur();
	window.focus();
}
function show_offer(objid,merchantid,icid,storename) {
	//document.getElementById('revealbtn'+objid).innerHTML = '';
	document.getElementById('revealmsg'+objid).innerHTML = '<br>The '+storename+' website has been opened in a new window. Let us know how you got on with this offer.<br><br><b>To open the website again,<\/b> <a href=\"http://www.voucherheaven.co.uk/outoffer/'+merchantid+'/'+icid+'/\" target=\"_blank\">please click here<\/a>';
}

function show_voucher002(objid,merchantid,icid,storename,vouchercode) {
	document.getElementById('voucherreveal'+objid).style.height='30px';
	document.getElementById('voucherreveal'+objid).style.background='#0368FF';
	document.getElementById('voucherreveal'+objid).style.color='#fff';
	document.getElementById('voucherreveal'+objid).innerHTML = vouchercode;
	//document.getElementById('revealbtn'+objid).innerHTML = '';
	document.getElementById('revealmsg'+objid).innerHTML = '<br><b>Your discount code is shown above.<\/b><br><br><b>The '+storename+' website has been opened in a new window</b>. Simply copy and paste the code '+vouchercode+' and enter it at the checkout.<br><br><b>If the website did not open,<\/b> <a href=\"http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/\" target=\"_blank\">please click here<\/a>';
}
function show_voucher_small002(objid,merchantid,icid,storename,vouchercode) {
	document.getElementById('voucherreveal'+objid).innerHTML = '<div class=\"smallvoucher\">'+vouchercode+'</div>';
	document.getElementById('revealbtn'+objid).innerHTML = '';
	document.getElementById('revealmsg'+objid).innerHTML = '<div class=\"pad5\"><br>Your discount code is shown below. <br><b>The '+storename+' website has been opened in a new window</b>.<br>If the website did not open, <a href=\"http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/\" target=\"_blank\">click here<\/a></div>';
}

function show_voucher_homepage(objid,merchantid,icid,storename,vouchercode) {
	document.getElementById('voucherreveal'+objid).innerHTML = '<div class=\"smallvoucher\">'+vouchercode+'</div>';
	document.getElementById('revealmsg'+objid).innerHTML = '<div class=\"pad5\"><br>Your discount code is shown above. <br><b>The '+storename+' website has been opened in a new window</b>.<br>If the website did not open, <a href=\"http://www.voucherheaven.co.uk/out/'+merchantid+'/'+icid+'/\" target=\"_blank\">click here<\/a></div>';
}

function getHTTPObject(){
if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest) return new XMLHttpRequest();
else {
alert("Your browser does not support AJAX.");
return null;
}
}
// Change the value of the outputText field
function setOutput(){
return true;
}
// Implement business logic
function doTrack(element,objId,dealid,vote){
httpObject = getHTTPObject();
	if (httpObject != null) {
	dst = element.href;
	src = document.location.href;
	httpObject.open("GET", "deal-vote.php?vote="+vote+"&dealid="+dealid+"", true);
	httpObject.send(null);
	httpObject.onreadystatechange = setOutput;
	}
}
var httpObject = null;
var src = null;
var dst = null;

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
