// USE ALT STYLE SHEETS
function BrowserInfo() {
	var agent = window.navigator.userAgent;
	if (agent.indexOf("MSIE") != -1) {
			var start = agent.indexOf("MSIE");
			this.name = "MSIE";
			this.version = parseFloat(agent.substring(start + 5, agent.indexOf(";", start)));
	} else if (agent.indexOf("Firefox") != -1) {
			var start = agent.indexOf("Firefox");
			this.name = "Firefox";
			this.version = agent.substring(start + 8, agent.length);
			var firstDec = this.version.indexOf(".") + 1;
			while (this.version.indexOf(".", firstDec) != -1)
				this.version = this.version.substring(0, firstDec) + this.version.substring(firstDec).replace(".", "");
			this.version = parseFloat(this.version);
	} else {
			this.name = "Unknown";
			this.version = 0;
	}
}

var info = new BrowserInfo();
var isIE6 = (info.name == "MSIE" && info.version < 7);


if (info.name == "MSIE" && info.version < 7)
	document.writeln('<link href="/stylesIE6.css" rel="stylesheet" type="text/css" />');
else
	document.writeln('<link href="/stylesDynamic.css" rel="stylesheet" type="text/css" />');



// RENDERFLASH
function renderFlash(src, width, height, features) {
	document.writeln('<embed src="' + src + '" quality="high" width="' + width + 
					 '" height="' + height + '" align="middle" allowscriptaccess="sameDomain" ' +
					 'type="application/x-shockwave-flash" ' + features + 
  					 'pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}



// WRITE PNG'S
var userAgent = window.navigator.userAgent
var isIE = (window.navigator.userAgent.indexOf("MSIE") != -1);
var isFirefox = (window.navigator.userAgent.indexOf("Firefox") != -1);
var isIE6 = (parseFloat(userAgent.substring(userAgent.indexOf("MSIE ") + 5)) <= 6);
var isSafari = (navigator.userAgent.indexOf("Safari") > 0);

function writePngImage(url, width, height, alt) {
	if (!isIE6)
		document.write("<img alt=\"" + alt + "\" src=\"" + url + "\" style=\"width: " + width + "px; height: " + height + "px;\">");
	else
		document.write("<img src=\"/spacer.png\" style=\"width: " + width + "px; height: " + height + 
			"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod=scale);\">");
}



// RENDERFLASH OR DISPLAY ALT
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;

function checkFlash(swf, width, height, id) {
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (!hasReqestedVersion) {
		document.write('<div class="photo_flip_alt">' +
					   'This content requires the latest version of Flash.' +
					   '<br />' +
					   '<a href="http://www.adobe.com/shockwave/download/" target="_blank">Click here to download</a>' +
					   '</div>');
	} else {
		renderFlash(swf, width, height, 'wmode="transparent"');
	}
}

