// Scripts by Stuart Smale
function toggle_content(id) {
		var div = jQuery('#'+id);
       var e = document.getElementById(id);
       if(e.style.display == 'none')
          div.slideDown('slow');
       else
          div.slideUp('slow');
    }
function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
function peek(overdivid, underdivid){ 
  document.getElementById(overdivid).style.backgroundPosition = "right";
  document.getElementById(underdivid).style.display = "block";
} 
function unpeek(divid){ 
  document.getElementById(divid).style.backgroundPosition = "left";
} 
function reveal(overdivid, underdivid){ 
  document.getElementById(overdivid).style.display = "none";
  document.getElementById(underdivid).style.display = "block";
} 
function button_over(buttondivid) {
  document.getElementById(buttondivid).style.backgroundPosition = "right";
}
function button_off(buttondivid) {
  document.getElementById(buttondivid).style.backgroundPosition = "left";
}
function clicked(clickdivid) {
	document.getElementById(clickdivid).style.display = "block";
}
function vbutton_over(buttondivid) {
  document.getElementById(buttondivid).src = "http://static.slashprices.co.uk/images/vbuttonover.jpg";
}
function vbutton_off(buttondivid) {
  document.getElementById(buttondivid).src = "http://static.slashprices.co.uk/images/vbutton.jpg";
}
function newStoreWindow(href) {
	storeWin = window.open(href,'_blank','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
	storeWin.blur();
	
}
function obutton_over(buttondivid) {
  document.getElementById(buttondivid).src = "http://static.slashprices.co.uk/images/obuttonover.jpg";
}
function obutton_off(buttondivid) {
  document.getElementById(buttondivid).src = "http://static.slashprices.co.uk/images/obutton.jpg";
}
function codeinstructions(dealid)
    {
		var parentdiv = "clicked" + dealid;
        var divTag = document.createElement("div");
        
        divTag.id = "instructions" + dealid;
        
        divTag.style.margin = "5px 0px 0px 0px";
		
		divTag.style.padding = "5px 5px 5px 5px";
        
        divTag.className ="newclicked";
        
        divTag.innerHTML = "For your convenience we have opened this store for you in a window underneath this one, highlight and copy the above code and when at the checkout simply paste it into the designated box to receive your discount.<br /><br /><strong>Store window didn't open? <a href='http://www.slashprices.co.uk/redirect/" + dealid + "'>Click here to go there directly</a></strong>";
        
        document.getElementById(parentdiv).appendChild(divTag);
    }
