function setZoom() {
	var theIframe=document.frames["ImgHolder"];
	if (theIframe){
		var theImage=theIframe.document.images[0];
		if (theImage) {
			var theTitle=theIframe.document.location.search;
			theImage.title=unescape(theIframe.document.location.search.substring(1,theIframe.document.location.search.length));
			theIframe.document.body.style.backgroundColor='#777777';
			theIframe.document.body.style.textAlign='center';
			if (document.getElementById) {var zoomAmount=(document.getElementById("oImgHolder").style.pixelWidth / theImage.width) * 100}
			else {var zoomAmount=((theIframe.document.body.clientWidth + 17) / theImage.width) * 100}
			if (zoomAmount>100) {zoomAmount=100}
			theIframe.document.body.style.zoom=zoomAmount + '%';
			if (document.getElementById) {document.getElementById("oImgHolder").style.pixelHeight=parseInt(theImage.height * (zoomAmount / 100))}
			}
		}
	}


function addToPortfolio(PID,Message,SiteRoot) {
	var strPIDlist=FSfncReadCookie("Portfolio");
	var dtExpires= new Date();
	dtExpires.setFullYear(dtExpires.getFullYear() + 1)
	if (("," + strPIDlist).indexOf("," + PID + ",")==-1) {FSfncSetCookie("Portfolio",strPIDlist + PID + ",",dtExpires,SiteRoot)}
	document.getElementById("PortfolioButton").disabled=true;
	alert(Message);
	}

function removeFromPortfolio(PID,Message,SiteRoot) {
	var strPIDlist=FSfncReadCookie("Portfolio");
	var dtExpires= new Date();
	dtExpires.setFullYear(dtExpires.getFullYear() + 1)
	if (("," + strPIDlist).indexOf("," + PID + ",")>-1) {
		strPIDlist=("," + strPIDlist).replace("," + PID + ",",",");
		if (strPIDlist.substring(0,1)==",") {strPIDlist=strPIDlist.substring(1,strPIDlist.length)}
		FSfncSetCookie("Portfolio",strPIDlist,dtExpires,SiteRoot);
		}
	document.getElementById("PortfolioButton").disabled=true;
	alert(Message);
	}

function FSfncReadCookie(key) {
	var cookie_string='' + document.cookie;
	var cookie_array=cookie_string.split('; ');
	for (var i=0; i<cookie_array.length; i++) {
		var single_cookie=cookie_array[i].split('=');
		if (single_cookie.length!=2) {continue}
		if (key==unescape(single_cookie[0])) {return unescape(single_cookie[1])}
		}
	return "";
	}

function FSfncSetCookie(name,value,expires,path,domain,secure) {
	document.cookie=name + '=' + escape(value) + ((expires == null) ? '' : ('; expires=' + expires.toGMTString())) + ((path == null) ? '' : ('; path=' + path)) + ((domain == null) ? '' : ('; domain=' + domain)) + ((secure == true) ? '; secure' : '');
	}

