function setIframeSrc(frameid) {
	document.getElementById(frameid).src = document.getElementById(frameid).src + "&amp;colorCode=" + colorCode + "&amp;colorHex=" + colorHex.substr(1)+"&amp;tabBgHex=" + tabBgHex.substr(1);
}

function updateIFrame( height, iframeID) {
	var iframe = document.getElementById( iframeID );
	iframe.setAttribute( 'height', height );
}

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no" // THIS WAS YES BEFORE

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller(height, frameid) {
	var dyniframe=new Array()
	if (document.getElementById){
		resizeIframe(height, frameid);
}
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
	var tempobj=document.all? document.all[frameid] : document.getElementById(frameid)
	tempobj.style.display="block"
	}
}

function resizeIframe(height, frameid){
	var currentfr=document.getElementById(frameid)
	if (currentfr && !window.opera){
	currentfr.style.display="block"
	currentfr.height = height + (30/1); //for IE changes
	}
}

// write out feature links in product page feature subtab
function WriteCallOutButton(name, alignTo, lineTop, lineWidth, pageURL, display){
	  if (display == "")
	  	 display = name;
	  var result = "";
	  if (alignTo.toUpperCase() == "RIGHT")
	  	  result = "<div class=\"calloutDiv\" style=\"width: " + lineWidth + "px; text-align: right; top: " + lineTop + "px; right: 0px;\">\n";
	  else
	  	  result = "<div class=\"calloutDiv\" style=\"width: " + lineWidth + "px; text-align: left; top: " + lineTop + "px; left: 10px;\"\n>";
	  result = result + "  <a href=\"" + pageURL + "\" id=\"callout" + name + "\" class=\"grey\" onclick=\"return false;\" onmouseover=\"return switchCallout('callout" + name + "','calloutContent" + name + "');\">" + display + "</a>\n";
	  result = result + "</div>\n";
	  document.write(result);
}

// share this email link code
function email_link_click() {
	u=location.href;
	pname="";
	if (document.getElementsByTagName) {
		var productNameArray = document.getElementsByTagName('h1');
		for (var i=0; i<productNameArray.length; i++) {
			pname = productNameArray[i].textContent;
		}
	}
	window.open('http://www.simplehuman.co.uk/pop-email-friend.php?pname='+encodeURIComponent(pname)+'&amp;url='+encodeURIComponent(u),'sharer','toolbar=0,status=0,width=700,height=680');
	return false;
}

// share this facebook link code
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&amp;t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}

// share this twitter link code
function twt_click() {u=location.href;t=document.title;window.open('http://twitter.com/home?status='+encodeURIComponent(u)+'&amp;title='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=800,height=436');return false;}
