
var userAgent = " " + navigator.userAgent.toLowerCase();
	nn = userAgent.indexOf( "mozilla" ) > 0;

if( userAgent.indexOf( "compatible" ) > 0 )
	nn = false;
	ie = userAgent.indexOf( "msie" ) > 0;
	mac = userAgent.indexOf( "mac" ) > 0;

if(ie && !mac)
	{
	var vb= "";	
		vb += '<SCR' + 'IPT LANGUAGE=VBScript\> \n';
		vb += 'Function VBFlash() \n';
		vb += 'on error resume next \n';
		vb += 'Dim C \n';
		vb += 'set C = vbNull \n';
		vb += 'Dim tver \n';
		vb += 'set tver = 0 \n';
		vb += 'Dim svr \n';
		vb += 'svr = "ShockwaveFlash.ShockwaveFlash" \n';
		vb += 'set C = CreateObject(svr) \n';
		vb += 'if (IsObject(C)) then \n';
		vb += 'Dim mVer \n';
		vb += 'Dim sVer \n';
		vb += 'Dim cVer \n';
		vb += 'cVer = C.FlashVersion() \n';
		vb += 'mVer = int(cVer / 65536) \n';
		vb += 'sVer = cVer mod 65536 \n';
		vb += 'if (sVer < 100) then sVer = "0" + CStr(sVer) \n';
		vb += 'if (sVer < 10)  then sVer = "0" + CStr(sVer) \n';
		vb += 'tver = CStr(mVer) + ".0" + CStr(sVer) \n';
		vb += 'end if \n';
		vb += 'VBFlash = tver \n';
		vb += 'End Function \n';
		vb += 'Function VBGetFlashTE \n';
		vb += 'on error resume next \n';
		vb += 'Dim C \n';
		vb += 'set C = vbNull \n';
		vb += 'Dim svVer \n';
		vb += 'set svVer = 0 \n';
		vb += 'For i = 10 To 1 Step -1 \n';
		vb += 'Dim svr \n';
		vb += 'svr = "ShockwaveFlash.ShockwaveFlash." + CStr(i) \n';
		vb += 'set C = CreateObject(svr) \n';
		vb += 'if (IsObject(C)) then \n';
		vb += 'svVer = i \n';
		vb += 'Exit For \n';
		vb += 'end if \n';
		vb += 'Next \n';
		vb += 'VBGetFlashTE = svVer \n';
		vb += 'End Function \n';
		vb += '</SCR' + 'IPT\> \n';
	document.write(vb);
	}
if(ie && !mac)
	{
		var fVer = VBFlash() || 0;
			if (fVer == 3.0008){var svVer = VBGetFlashTE();
			if (svVer > fVer){fVer = 4.0000;}}
			else if (!fVer){fVer = VBGetFlashTE() || 0;}
			else if (fVer == 4){fVer = 4.0015;}}
		else{var fVer=0;}
		
	function setF(){
		arr = navigator.plugins;arrl = arr.length;
		
		for (var i=0; i < arrl; i++){plug = arr[i];desc   = plug.description;
		if (desc.indexOf("Shockwave Flash ") != -1){var vLoc = desc.indexOf("Shockwave Flash ");
		var vStr = desc.substring(vLoc + 16,desc.length);var sVer;var mVer;vLoc = vStr.indexOf(" r");
		if (vLoc != -1){mVer = vStr.substring(0,vLoc);sVer = vStr.substring(vLoc + 2,vStr.length);
			fnVer = parseFloat(mVer + (sVer < 100 ? "0" : "") + (sVer < 10 ? "0" : "") + sVer);}
		else{
			fnVer = parseFloat(vStr);}}}}
		var fnVer = 0;
			setF();
		var myFlash;
		if(!fVer || fVer==0){myFlash=fnVer;}
		else{myFlash=fVer;
	}
		
function hasFlash(bVer){if(myFlash<bVer){return false;}else{return true;}}
flashEnabled = hasFlash(7);

function ClearFooterSearch() {
	if (document.forms["frmKeyword"].query.value == "Search") {
	document.forms["frmKeyword"].query.value = "";
	}
}
	agt = navigator.userAgent.toLowerCase();
	ie = (agt.indexOf("msie") != -1);
	ns = (navigator.appName.indexOf("Netscape") != -1);
	opera = (agt.indexOf("opera") != -1);
	win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
	mac = (agt.indexOf("mac")!=-1);
	
	var quicktime = "FALSE";
	var pluginlist = "";
	var width = screen.width;
	var height = screen.height;

	if (ie && win){ 
		pluginlist = detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime"); 
	}
	if (opera){
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("video/quicktime","QuickTime");
	}
	if (ns || !win){
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("video/quicktime","QuickTime");
	}

function detectIE(ClassID,name){
	result = false;
		document.writeln('<SCRI'+'PT LANGUAGE=VBScript>');
		document.writeln('on error resume next');
		document.writeln('If ScriptEngineMajorVersion >= 2 then');
		document.writeln('result = False');
		document.writeln('result = IsObject(CreateObject("' + ClassID + '"))');
		document.writeln('If (err) then');
		document.writeln('result = False');
		document.writeln('End If');
		document.writeln('Else');
		document.writeln('result = False');
		document.writeln('End If');
		document.writeln('</SCRI'+'PT>');
	if (result) return name+','; else return '';
}

function detectNS(ClassID,name){
	n = ""; 
	if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
	}
	pluginlist += navigator.javaEnabled() ? "Java," : "";
	if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
	if (pluginlist.indexOf("QuickTime")!=-1) quicktime = "TRUE";

function findObj(n, d){
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function getURI(){
	var url = document.URL;
	var splitURL = url.split(document.domain);
	return splitURL[1];
}
	var gnavActive = false;
	var gnavCurrent = 'none';
	var gnavOffSwitch;
	
function gnavChange(gnavID){
	if (hdrCurrent != 'none'){
	if (hdr2Current != 'none'){
	layerHide(hdr2Current);
}
	layerHide(hdrCurrent);
	swapImgRestore4();
}
	gnavActive = true;
	clearTimeout(gnavOffSwitch);
	if (gnavCurrent != 'none'){
	layerHide(gnavCurrent);		
}
	gnavCurrent = gnavID;
	layerShow(gnavCurrent);		
}

function gnavHide(){
	if ((gnavCurrent != 'none') && (!gnavActive)){
	layerHide(gnavCurrent);		
}}

function gnavOut(){
	gnavActive = false;
	gnavOffSwitch = setTimeout("gnavHide();", 100);
}

function gnavOver(){
	gnavActive = true;
}
	var hdrActive = false;
	var hdrCurrent = 'none';
	var hdrOffSwitch;

function hdrChange(hdrID){
	swapImgRestore4();
	if( limitedBrowser() != true ){
	if ((hdr2Current != 'none') && (!hdr2Active)){
	layerHide(hdr2Current);		
}
	if (gnavCurrent != 'none'){
	if (hdr2Current != 'none'){
	layerHide(hdr2Current);
}
	layerHide(gnavCurrent);		
}
	hdrActive = true;
	clearTimeout(hdrOffSwitch);
	if (hdrCurrent != 'none'){
	layerHide(hdrCurrent);		
}
	hdrCurrent = hdrID;
	layerShow(hdrCurrent);
}}

function hdrHide(){
	if( limitedBrowser() != true ){
	if ((hdr2Current != 'none') && (!hdr2Active)){
	layerHide(hdr2Current);		
	}
	if ((hdrCurrent != 'none') && (!hdrActive)){
	layerHide(hdrCurrent);		
	swapImgRestore4();
}}}

function hdrOut(){
	if( limitedBrowser() != true )
	{
	hdrActive = false;
	hdr2Active = false;
	clearTimeout(hdrOffSwitch);
	hdrOffSwitch = setTimeout("hdrHide();", 100);
}}

function hdrOver(){
	hdrActive = true;
	}
	var hdr2Active = false;
	var hdr2Current = 'none';
	var hdr2OffSwitch;
	
function hdr2Change(hdr2ID){

	hdr2Active = true;
	clearTimeout(hdr2OffSwitch);
	hdr2Current = hdr2ID;
	layerShow(hdr2Current);		
}

function hdr3Change(hdr2ID){

	hdr3Active = true;
	clearTimeout(hdr3OffSwitch);
	hdr3Current = hdr3ID;
	layerShow(hdr3Current);		
}

function hdr2Out(){
	hdr2Active = false;
}

function hdr3Out(){
	hdr3Active = false;
}

function hdr2Over(){
	hdrActive = true;
	hdr2Active = true;
}

function hdr3Over(){
	hdrActive = true;
	hdr3Active = true;
}

function layerShow( layerName ){
	document.getElementById(layerName).style.visibility='visible';
}

function layerHide( layerName ){
	document.getElementById(layerName).style.visibility='hidden';
}

var moveMent;
var msrpRight = -172;

function msrpMove(){
	if (msrpRight < -2){
		document.getElementById("home_msrp").style.right = (msrpRight+10)+'px';
		msrpRight = msrpRight+10;
		clearTimeout(moveMent);
		moveMent = setTimeout("msrpMove();", 30);
	}
}
	

function navBrowserDetectLite() {
	var ua = navigator.userAgent.toLowerCase(); 
	this.ua = ua;

	this.isGecko     = (ua.indexOf('gecko') != -1);
	this.isMozilla   = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length);
	this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
	this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
	this.isOpera     = (ua.indexOf("opera") != -1); 
	this.isKonqueror = (ua.indexOf("konqueror") != -1); 
	this.isIcab      = (ua.indexOf("icab") != -1); 
	this.isAol       = (ua.indexOf("aol") != -1); 
	this.isWebtv     = (ua.indexOf("webtv") != -1); 
	this.isOmniweb   = (ua.indexOf("omniweb") != -1);
	this.isDreamcast = (ua.indexOf("dreamcast") != -1);
	this.isSafari	 = (ua.indexOf("safari") != -1);

	this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE);
	this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla);
	
	this.versionMinor = parseFloat(navigator.appVersion); 
	
	if (this.isNS && this.isGecko){
		this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
		}
	
		else if (this.isIE && this.versionMinor >= 4){
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
		}

	else if (this.isOpera){
		if (ua.indexOf('opera/') != -1){
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
		}
		else{
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
			}
		}
		
	else if (this.isKonqueror){
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
		}
	
	else if (this.isIcab) {
		if (ua.indexOf('icab/') != -1) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
		}
	else {
	this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
	}
}

// correct version number for WebTV
else if (this.isWebtv) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) );
}

this.versionMajor = parseInt(this.versionMinor); 
this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );

// platform
this.isWin   = (ua.indexOf('win') != -1);
this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) );
this.isMac   = (ua.indexOf('mac') != -1);
this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)

// specific browser shortcuts
this.isNS4x = (this.isNS && this.versionMajor == 4);
this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
this.isNS4up = (this.isNS && this.versionMinor >= 4);
this.isNS6x = (this.isNS && this.versionMajor == 6);
this.isNS6up = (this.isNS && this.versionMajor >= 6);

this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new navBrowserDetectLite();


function swapImgRestore4(){
	var i,x,a=document.sr4; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function limitedBrowser(){
	var browserDetect = new navBrowserDetectLite();
		if( browserDetect.isSafari)
		{return true;
		}else{
		return false;
	}
}
