// For the overlayed flash portfolios
function KeyValueP(value) {
	alert("www.iwebsolutions.co.uk is sorry but is unable to show you these screen shots via key values");
	return false;
}

function hidePortfolio() {
	MM_showHideLayers('portfolioBG','','hide');
	MM_showHideLayers('portfolioFlash','','hide');
	deleteFlashContent();
	if(topMenu == "up") {
		playFlash("true");
	}
}

function deleteFlashContent() {
	if (document.getElementById) {
    	document.getElementById('portfolioFlash').innerHTML = "&nbsp;";
	} else if (document.all) {
    	document.all.portfolioFlash.innerHTML = "&nbsp;";
    }
}


function writePortfolio(project, client, num, section) {
	// Change the window mode of the flash object for ie on a mac
if(is_mac && is_ie) {
	var wmode = "window";
} else {
	var wmode = "transparent";


	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
   		//Non-IE
		myWidth = window.clientWidth;
    	myHeight = window.innerHeight;
		htmHeight = document.documentElement.scrollHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
   		//IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
		htmHeight = document.documentElement.scrollHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	//IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
		htmHeight = document.body.offsetHeight;
	}
	//
	if (document.layers) {
		document.all.portfolioBG.height = htmHeight;
	} else 	if (document.all) {
		if(is_mac && is_ie) {
			document.getElementById('portfolioBG').style.height = htmHeight+"px";
		} else {
			document.all.portfolioBG.style.height = htmHeight;
		} 
	} else 	if (!document.all && document.getElementById) {
		document.getElementById('portfolioBG').style.height = htmHeight+"px";
	}
	//
	MM_showHideLayers('portfolioBG','','show');
	MM_showHideLayers('portfolioFlash','','show');
	//
	var flashVars = 'sServerPath='+myURL+'&projectID='+project+'&clientID='+client+'&nCurr='+num+'&section='+section;
	//
	if (!useRedirect) {
  		if(hasRightVersion) {
   	 		var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    		+ 'WIDTH="100%" HEIGHT="'+myHeight+'"'
    		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="player">'
    		+ '<PARAM NAME="MOVIE" VALUE="'+myURL+'flash/portfolio/player.swf">'
   	 		+ '<PARAM NAME="PLAY" VALUE="true">'
   	 		+ '<PARAM NAME="QUALITY" VALUE="high">'
			+ '<param name="scale" value="noscale" />'
    		+ '<PARAM NAME="MENU" VALUE="false">'
			+ '<param name="wmode" value="'+wmode+'">'
			+ '<param name="allowScriptAccess" value="sameDomain" />'
			+ '<param name="FlashVars" value="'+flashVars
			+ '" />'
    		+ '<EMBED SRC="'+myURL+'flash/portfolio/player.swf"'
			+ 'name="player"'
			+ 'scale="noscale"'
    		+ 'width="100%"'
			+ 'height="'+myHeight+'"'
			+ 'wmode="'+wmode+'"'
    		+ 'PLAY="true"'
    		+ 'LOOP="false"'
			+ 'allowScriptAccess="sameDomain"'
    		+ 'QUALITY="high"'
    		+ 'MENU="false"'
			+ 'flashvars="'+flashVars
			+'"'
    		+ 'TYPE="application/x-shockwave-flash"'
    		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
    		+ '<\/EMBED>'
    		+ '<\/OBJECT>';
  		} else {
			var oeTags = '<a href="http://www.macromedia.com/go/getflashplayer" onclick="MM_showHideLayers(\'portfolioBG\',\'\',\'hide\');" target="_blank" class="hC" style="width:'+myWidth+'px;height:'+myHeight+'px;">To view this content you need the latest Macromedia Flash plugin.<br />Click here to download the latest version.</a>';
		}
		moveobject();
		if (document.getElementById) {
    		document.getElementById('portfolioFlash').innerHTML = oeTags;
		} else if (document.all) {
    		document.all.portfolioFlash.innerHTML = oeTags;
    	}
		playFlash("false");
	}
	}
}
//
var portfolioFlash;
var theTop = 0;
var old = theTop;
//
function moveobject() {
	if (window.innerHeight) {
		pos = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		pos = document.documentElement.scrollTop;
	} else if (document.body) 	{
		pos = document.body.scrollTop;
	}
	//
	if (pos == old) {
		if (document.layers) {
			document.all.portfolioFlash.top = pos;
		} else 	if (document.all) {
			document.all.portfolioFlash.style.top = pos;
		} else 	if (!document.all && document.getElementById) {
			document.getElementById('portfolioFlash').style.top = pos+"px";
		}
	}
	old = pos;
	temp = setTimeout('moveobject()', 200);
}