// Coremetrics Tracking Calls
	//alert("gordons_cutom.js:line2");
	//cmSetProduction();
	
	function conversionTrack(page, pos, section, num)
	{
		cmCreateConversionEventTag(page, pos, section, num);
	}
	
	function footerTrack(page,section)
	{
		cmCreatePageviewTag(page, section, null);
	}
	
	
// Get flash version
	function getFlashVersion()
	{ 
		// ie 
	  	try
		{ 
			try
			{ 
		  		// avoid fp6 minor version lookup issues 
		  		// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ 
		  		var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); 
		  		try { axo.AllowScriptAccess = 'always'; } 
		  		catch(e) { return '6,0,0'; } 
			}
			catch(e){} 
			return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; 
	  		// other browsers 
	  	}
		catch(e)
		{ 
			try
			{ 
		  		if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
				{ 
					return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; 
		  		} 
			}
			catch(e) {} 
		} 
		return '0,0,0'; 
	} 
 

	
// Get parameters from URL
	function popup(linkRef,windowName,params)
	{
		if(!linkRef) linkRef='index.html'; 
		if(!windowName) windowName='Gordon\'s'; 
		if(!params) params='width=590,height=850,scrollbars=yes,resizable=yes';
		window.open(linkRef,windowName,params);
	}
	
	function historyWindow()
	{
		//alert('Gordon\'s History');
		popup('/Pages/history.aspx','History','width=526,height=350,scrollbars=yes,resizable=yes');
	}
	
	
// Get parameters from URL
	function getURLParam(strParamName)
	{
		var strReturn = "";
		var strHref = window.location.href;
		if ( strHref.indexOf("?") > -1 ) {
			var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
			var aQueryString = strQueryString.split("&");
			for ( var iParam = 0; iParam < aQueryString.length; iParam++ ) {
			  if (
				aQueryString[iParam].indexOf(strParamName + "=") > -1 ) {
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			  }
			}
		}
		return strReturn;
	}



// Mouse Over Swap Image Listener
	//var W3CDOM = (document.createElement && document.getElementsByTagName);
	
	//var mouseOvers = new Array();
	//var mouseOuts = new Array();

//window.onload = omo;
	function omo(id)
	{
		if (!W3CDOM) return;
		var nav = document.getElementById(id);
		var imgs = nav.getElementsByTagName('img');
		for (var i=0;i<imgs.length;i++)
		{
			imgs[i].onmouseover = mouseGoesOver;
			imgs[i].onmouseout = mouseGoesOut;
			var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
			mouseOuts[i] = new Image();
			mouseOuts[i].src = imgs[i].src;
			mouseOvers[i] = new Image();
			mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_omo" + suffix;
			imgs[i].number = i;
		}
	}
	
	function mouseGoesOver()
	{
		this.src = mouseOvers[this.number].src;
	}
	
	function mouseGoesOut()
	{
		this.src = mouseOuts[this.number].src;
	}
	

	/*
	* GET COOKIE:
	*/
	// this fixes an issue with the old method, ambiguous values 
	// with this test document.cookie.indexOf( name + "=" );
	function getCookie(check_name)
	{
		// first we'll split this cookie up into name/value pairs
		// note: document.cookie only returns name=value, not the other components
		var a_all_cookies = document.cookie.split( ';' );
		var a_temp_cookie = '';
		var cookie_name = '';
		var cookie_value = '';
		var b_cookie_found = false; // set boolean t/f default f
	
		for ( i = 0; i < a_all_cookies.length; i++ )
		{
			// now we'll split apart each name=value pair
			a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
			// and trim left/right whitespace while we're at it
			cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
			// if the extracted name matches passed check_name
			if ( cookie_name == check_name )
			{
				b_cookie_found = true;
				// we need to handle case where cookie has no value but exists (no = sign, that is):
				if ( a_temp_cookie.length > 1 )
				{
					cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
				}
				// note that in cases where cookie is initialized but no value, null is returned
				return cookie_value;
				break;
			}
			a_temp_cookie = null;
			cookie_name = '';
		}
		if ( !b_cookie_found )
		{
			return null;
		}
	}
