<!--
//-------------------------------------------------------------------------------------
// JavaScript version: 1.2
// File Dependancies: none
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//				G L O B A L    V A R I A B L E S 
//-------------------------------------------------------------------------------------
var g_bIsFlash = false;
var g_oBrowser = new cBrowser();
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//	adding an event handler... use with caution! =)
//-------------------------------------------------------------------------------------
function arbAttachEventToElement(oElement, sEventName, sCode){
	var bOut = false;
	if(oElement[sEventName]){
		var s = new String(oElement[sEventName]);
		oElement[sEventName] = new Function(s.replace("function anonymous()", "") + " ; " + sCode);
		bOut = true;
	} else {
		oElement[sEventName] = new Function(sCode);
		bOut = true;
	}//fi
	return(bOut);
}//arbAttachEventToElement()
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
// retrieves a q.string var. for the current window
//-------------------------------------------------------------------------------------
function getQueryStringVariable(sName){
	var re = new RegExp(sName + "\\=([^\\\&]+)", "i");
	var aResults = re.exec(window.document.location.search);
	return( aResults ? RegExp.$1 : "");
}
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//				F L A S H    D E T E C T I O N     A N D     H A N D L I N G
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//	used for building the query string for the top navigation flash
//-------------------------------------------------------------------------------------
function addTopNavLink(sUrl, sQ, i){
	(/\<a href\=\"([^\"]*)\"/i).exec(sUrl);
	return( (sQ ? '&' : '') + 'URL' + i + '=' + escape(RegExp.$1) ); 
}
//-------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------
//	writes a flash 5 object/embed html sequence
//-------------------------------------------------------------------------------------
function writeFlash5(sSource, iWidth, iHeight, sId){
	var sParamName, sExtraParamEmbed = ''; 
	var oExtraParams = new Object();
	if(arguments.length > 4) oExtraParams = arguments[4];
	with(document){
		open();
		write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
		write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
		write('width="' + iWidth + '" height="' + iHeight + '" id="' + sId + '">');
		write('<param name="movie" value="' + sSource + '">');
		write('<param name="quality" value="high">');
		write('<param name="menu" value="false">');
		for(sParamName in oExtraParams){
			write('<param name="' + sParamName + '" value="' + oExtraParams[sParamName] + '">');
			sExtraParamEmbed += sParamName + '="' + oExtraParams[sParamName] + '" ';
		}
		write('<embed src="' + sSource + '" quality="high" menu="false" ' + sExtraParamEmbed);
		write('width="' + iWidth + '" height="' + iHeight + '" name="' + sId + '" ');
		write('align="" type="application/x-shockwave-flash" ');
		write('pluginspace="http://www.macromedia.com/go/getflashplayer">');
		write('</embed>');
		write('</object>');
		close();
	}
}
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
// FLASH DETECTION FUNCTION:
//-------------------------------------------------------------------------------------
//		iCheckForFlashVersion: Flash Version to check for, eg: 4,5,6
//		sDetectionMethod: Agressive or Passive, eg: 'A', 'P', if invalid defaults to passive
//-------------------------------------------------------------------------------------
function isFlash(iCheckForFlashVersion, sDetectionMethod, oBrowser)
{
	bIsFlash = false;
	if (oBrowser.fVersion > 3) {
	
		//////////////////////////////////////////////////////
		// source: juxtinteractive.com
		// description: Flash 3, 4 AND 5 Detection
		// Author: anthony@juxtinteractive.com
		// credits: netscape communications (client sniff)
		// Permission granted to reuse and distribute
		// Last Modified: 10-03-00
		//////////////////////////////////////////////////////
		
		//////////////////////////////////////////
		// Flash Detection
		// Last Modified: 10-03-00
		// NOT checking for enabledPlugin (buggy)
		//////////////////////////////////////////
		var iPluginFlashVersion = 0;
	
		if (navigator.plugins) { //MACie4.5 doesn't support
			if (navigator.plugins["Shockwave Flash"]) {
	
				var iPluginFlashVersion = navigator.plugins["Shockwave Flash"].description.split(" ");
	
				for (var i = 0; i < iPluginFlashVersion.length; ++i) {
	
					if (isNaN(parseInt(iPluginFlashVersion[i])))
						continue;
		
					iPluginFlashVersion = iPluginFlashVersion[i];
				}
				iPluginFlashVersion = parseInt(iPluginFlashVersion);
			}
		}
			
		if (oBrowser.bIE && oBrowser.bWin32) { // Check IE on windows for flash 3, 4 AND 5 using VB Script
			document.write('<SCRIPT LANGUAGE="VBScript"\>\n');
			document.write('on error resume next\n');
			document.write('bIsFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+iCheckForFlashVersion+'")))\n');
			document.write('<'+'/SCRIPT> \n');
		}
	
	}

	if ( iPluginFlashVersion >= iCheckForFlashVersion )
		bIsFlash = true;

	return bIsFlash;	

}
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//				B R O W S E R    D E T E C T I O N
//-------------------------------------------------------------------------------------
function getBrowserName()   {   
	return navigator.appName;     
}
//-------------------------------------------------------------------------------------
function getBrowserVersion()   {   
	return navigator.appVersion;     
}
//-------------------------------------------------------------------------------------
function getBrowserCodeName()   {   
	return navigator.appCodeName;     
}
//-------------------------------------------------------------------------------------
function getBrowserUserAgent()   {   
	return navigator.userAgent;     
}
//-------------------------------------------------------------------------------------
// 	Returns browser object containing the browser name and details.
//--------------------------------------------
//	bNS 	: Browser is Netscape
//	bIE 	: Browser is Internet Explorer
//	bWin	: Windows platform
//  bWin95 	: Windows 95 platform
// 	bWin16 	: Windows 16 bit platform
// 	bWin31	: Windows 3.1 platform
// 	bWin98	: Windows 98 platform
//	bWinnt	: Windows NT platform
//	bWin32	: Windows 32 bit platform
//	bMac	: Mac
//	bIE45Mac: IE 4.5 on Mac
// 	fVersion: Version of Browser
// 	sName	: Full browser name
//---------------------------------------------------------------------------------
function cBrowser()
{
	this.sName = getBrowserName();
	this.fVersion = getBrowserVersion(); 

	var sAgt = getBrowserUserAgent().toLowerCase();
	
	//////////
	// Browser 
	//////////
	this.bNS  = ((sAgt.indexOf('mozilla')!=-1) && (sAgt.indexOf('spoofer')==-1) && (sAgt.indexOf('compatible') == -1) && (sAgt.indexOf('opera')==-1) && (sAgt.indexOf('webtv')==-1));
	this.bIE   = (sAgt.indexOf("msie") != -1);

	////////////
	// Platform
	////////////
	this.bWin   = ((sAgt.indexOf("win")!=-1) || (sAgt.indexOf("16bit")!=-1));
	this.bWin95 = ((sAgt.indexOf("win95")!=-1) || (sAgt.indexOf("windows 95")!=-1));
	this.bWin16 = ((sAgt.indexOf("win16")!=-1) || (sAgt.indexOf("16bit")!=-1) || (sAgt.indexOf("windows 3.1")!=-1) || (sAgt.indexOf("windows 16-bit")!=-1) );
	this.bWin31 = ((sAgt.indexOf("windows 3.1")!=-1) || (sAgt.indexOf("win16")!=-1) || (sAgt.indexOf("windows 16-bit")!=-1));
	this.bWin98 = ((sAgt.indexOf("win98")!=-1) || (sAgt.indexOf("windows 98")!=-1));
	this.bWinnt = ((sAgt.indexOf("winnt")!=-1) || (sAgt.indexOf("windows nt")!=-1));
	this.bWin32 = (this.bWin95 || this.bWinnt || this.bWin98 || ((parseInt(this.fVersion) >= 4) && (navigator.platform == "Win32")) || (sAgt.indexOf("win32")!=-1) || (sAgt.indexOf("32bit")!=-1));
	this.bMac   = (sAgt.indexOf("mac")!=-1);
	/////////////////////////////////////
	// Detect IE 4.5 on the mac
	// Mucho Problemos with this browser
	/////////////////////////////////////
	this.bIE45Mac  = (this.bMac && this.bIE && (sAgt.indexOf("msie 5.0")==-1) && (sAgt.indexOf("msie 5.5")==-1) && (sAgt.indexOf("msie 4.5")!=-1));
	
	// If the browser is Netscape or IE then extract the version
	if (this.sName.toLowerCase() == "netscape") {
		this.fVersion = this.fVersion.substring(0,4);
		if (this.fVersion.toString() == '5.0 ') {
			this.fVersion = '6.0'
		}	
	}
	else if (this.sName.toLowerCase() == "microsoft internet explorer") {
		this.fVersion = this.fVersion.substring(this.fVersion.indexOf("MSIE") + 5, this.fVersion.indexOf("MSIE") + 8);
	}
}
//---------------------------------------------------------------------------------

//-->