var fVer = 0;	
var bFlashOK = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('if (flash5Installed) then \n');	
	document.write('fVer=5 \n');	
	document.write('elseif (flash4Installed) then \n');	
	document.write('fVer=4 \n');	
	document.write('end if \n');	
	document.write('</SCR' + 'IPT\> \n');
}

function detectFlash(){	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			fVer = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		}
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) fVer = 2;	
	if (fVer >= 4) bFlashOK = true;

//	bFlashOK = false;
}

detectFlash();

var iViewPF=new Image(105,9); iViewPF.src="img/view-portfolio.gif";
var iViewPFo=new Image(105,9); iViewPFo.src="img/view-portfolioo.gif";
var iBP=new Image(72,9); iBP.src="img/buy-prints.gif";
var iBPo=new Image(72,9); iBPo.src="img/buy-printso.gif";
var iSH=new Image(68,9); iSH.src="img/shop-home.gif";
var iSHo=new Image(68,9); iSHo.src="img/shop-homeo.gif";
function patWindow() {
	window.open("main.htm","PatPope","toolbar=0,scrollbars=0,width=766,height=540");
}
function doSplashFlash() {
    if (bFlashOK) {
		document.write('<object width="766" height="109" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">');
		document.write('<param name="movie" value="splash.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#191919">');
		document.write('<embed src="splash.swf" bgcolor="#191919" width="766" height="109" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
	}
	else {
		document.write('<a href="javascript:patWindow()"><img src="img/splash.jpg" width="766" height="109" alt="pat pope  PHOTOGRAPHER" border="0" /></a>');
	}
}
function doPortfolioLink(iDotPos) {
    if (bFlashOK) {
		if (iDotPos==1)
			document.write('<img src="img/dot.gif" width="2" height="2" hspace="10" style="margin-bottom:9px" alt="." border="0" />');
		document.write('<a href="javascript:patWindow()" onmouseover="imgPF.src=iViewPFo.src" onmouseout="imgPF.src=iViewPF.src"><img src="img/view-portfolio.gif" name="imgPF" id="imgPF" width="105" height="9" style="margin-bottom:6px" alt="VIEW PORTFOLIO" border="0" /></a>');
		if (iDotPos==2)
			document.write('<img src="img/dot.gif" width="2" height="2" hspace="10" style="margin-bottom:9px" alt="." border="0" />');
	}
}
function doShopFlash() {
	document.write('<div class="swf">');
    if (bFlashOK) {
		document.write('<object width="543" height="220" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">');
		document.write('<param name="movie" value="img/shop/intro.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#ffffff">');
		document.write('<embed src="img/shop/intro.swf" bgcolor="#ffffff" width="543" height="220" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
	}
	else {
		document.write('<img src="img/shop/intro.jpg" width="543" height="220" alt="Online Shop - Buy high quality limited edition prints by Pat Pope" border="0" />');
	}
	document.write('</div>');
}
function popWindow(w,h) {
	var ppwindow=window.open("","ppwin","toolbar=no,location=no,directories=no,margin=0,status=no,menubar=no,scrollbars=yes,resizable=no,width="+w+",height="+h);
	ppwindow.focus();
}