	/*********************************************/		
    function getEl(id){
        /*** less wordy and good for firefox ***/
        return document.getElementById(id);
    }   
    
    function go(url,targ) {
    	if(!targ) {
	    	window.location = url;
	    }else {
			eval('window.' + targ + '.location = \'' + url + '\'');
	    }
    }
    
    /*********************************************/	
	function activeEmbed(src,id,height,width,divid,zindex,mediaType,returnMe,quality) {
		if(!quality) {
			quality = 'high';
		}
		if(!height) {
			height = '100%';
		}
		if(!width) {
			width = '100%';
		}
		
		if(!mediaType || mediaType == 'flash') {
			if(divid) {
				embd = '<div id="'+ divid + '"><embed height="' + height + '" width="' + width + '" src="' + src + '" menu="false" quality="'+ quality + '"  name="' + id + '"  wmode="transparent"  align="middle"  type="application/x-shockwave-flash" allowScriptAccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer"/></div>';
			}else {
				embd = '<embed height="' + height + '" width="' + width + '" src="' + src + '" menu="false" quality="'+ quality + '"  name="' + id + '"  wmode="transparent"  align="middle"  type="application/x-shockwave-flash" allowScriptAccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer"/>';
			}
			
			objd = '<object height="' + height + '" width="' + width + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  id="' +  id + '" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" align="middle">';
				objd +=	'<param name="allowScriptAccess" value="sameDomain" />';
				objd +=	'<param name="movie" value="'+ src + '" />';
				objd +=	'<param name="menu" value="true" />';
				objd +=	'<param name="quality" value="'+ quality + '" />';
				objd +=	'<param name="wmode" value="transparent" />';
				objd += embd;
			objd +=	'</object>';
		}else if(mediaType == 'video') {
			objd = '<embed height="' + height + '" width="' + width + '" src="' + src + '" menu="false" quality="'+ quality + '" name="' + id + '" id="' + id + '" wmode="transparent" align="middle" allowScriptAccess="sameDomain"/>';
		}
		
		if (returnMe) {
			injectTo = getEl(returnMe);
			injectTo.innerHTML = objd;
			return false;
			//return objd;
		}else {
			document.write(objd);
		}
	}
	
	function checkforFlash() {
	
	}
	
	/*********************************************/	
	function ieDisplay(objid,way){
	// Div show/hide (way: 0=hide; 1=show);
		var obj = document.getElementById(objid);
		obj.style.display = (way)?'inline':'none';
	}
	/** hardSwap(location,id)
	* Ignores TempImg catch and just swaps images
	* location = src of image to swap in
	* id = id of image
	*/	
	function hardSwap(location,id) {	
		imageTempOn = new Image();
		imageTempOn.src = location;
		document.images['' + id  + ''].src= imageTempOn.src;
	}
	
	/** hardSwap(location,id)
	* rememebrs what page you are on for navigation
	* 
	* 
	*/
	var TempImg = '';	
	function easySwap(location,id) {	
		if(id != TempImg) {
			imageTempOn = new Image();
			imageTempOn.src = location;
			document.images['' + id  + ''].src= imageTempOn.src;
		}else {
			TempImg = id;
		}
	}
	
	/*********************************************/	
	function setClassName(objId, className) {
    	document.getElementById(objId).className = className;
	}
	/*********************************************/	
	function printImage( popupURL){
		return window.open( popupURL, 'pop', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0' );
	}

	/*******************************************************
	* return a working call for the flash object
	*/
	function flashAccess(id) {
		var brs = whichBrs();
		if(brs == 'Mozilla' || brs == 'Firefox') {
			flash = window.document.eval(id);	
		}else if(brs == 'IE' || brs == 'Safari') {
			flash = window.eval(id);	 // safari works on this too
		}else {
			try {
				flash = window.document.eval(id);	
			}catch(e) {
				alert('Sorry, we are trying to access the Flash Object, but cant seem to do that on your browser');
				flash = window.eval(id);	
			}
		}
		return flash;
	}
	
	
	/** DETERMIN BROWSER TYPE --- used to access the Flash Object 
	*/
	function whichBrs() {
		var agt=navigator.userAgent.toLowerCase();
		if (agt.indexOf("opera") != -1) return 'Opera';
		if (agt.indexOf("staroffice") != -1) return 'Star Office';
		if (agt.indexOf("webtv") != -1) return 'WebTV';
		if (agt.indexOf("beonex") != -1) return 'Beonex';
		if (agt.indexOf("chimera") != -1) return 'Chimera';
		if (agt.indexOf("netpositive") != -1) return 'NetPositive';
		if (agt.indexOf("phoenix") != -1) return 'Phoenix';
		if (agt.indexOf("firefox") != -1) return 'Firefox';
		if (agt.indexOf("safari") != -1) return 'Safari';
		if (agt.indexOf("skipstone") != -1) return 'SkipStone';
		if (agt.indexOf("msie") != -1) return 'IE';
		if (agt.indexOf("netscape") != -1) return 'Netscape';
		if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
		if (agt.indexOf('\/') != -1) {
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
		return navigator.userAgent.substr(0,agt.indexOf('\/'));}
		else return 'Netscape';} else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
		else return navigator.userAgent;
	}
	function CreateBookmarkLink(title) {
		url = 'http://www.philthyrichrecords.com';
		if (window.sidebar) { // Mozilla Firefox Bookmark		
			window.sidebar.addPanel(title,url,"");	
		}else if( window.external ) { // IE Favorite		
			window.external.AddFavorite( url, title); 
		}else if(window.opera && window.print) { // Opera Hotlist

			return true; 
		} 
	} 
	/****************************************************************************
	*	ActiveX AJAX loader
	*
	*	Attach your own state_change function (along with the injection)
	*	- Use altVars to submit init vars to state_change functions
	*/
	function loadXMLDoc(url,target,altFunction,altVars){
		xmlhttp=null
		xmlhttp = getXmlHttpRequest();
		target = getEl(target);
		if (xmlhttp!=null)
		  {
		  
		  xmlhttp.onreadystatechange=function() {
		  	// Inject
		  	state_Change(target,altFunction,altVars);
		  }
		  xmlhttp.open("GET",url,true)
		  xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		  xmlhttp.send(null)
		  }
		else {
		  alert("Your browser does not support XMLHTTP.")
		}
	}
		
	function state_Change(target,altFunction,altVars){
		if (xmlhttp.readyState==4) {
		  if (xmlhttp.status==200) {
		 	
		 
			target.innerHTML = xmlhttp.responseText;
			
			if(altFunction) {	// Attach functions to process after new data has loaded
				if (typeof altFunction == 'function') var exLoad = altFunction;
		  		if(altVars) {	// Need to send variables to the altFunction

					var runMe = 'exLoad(';
					for(var i in altVars) {
						if(i > 0) {
							runMe += ',';
						}
						if(typeof altVars[i] == 'string') {
							runMe += '\''+ altVars[i] + '\'';
						}else {
							runMe += altVars[i];
						}
					}
					runMe += ')';
					
					eval(runMe);
		  		}else {			// run alternative functions
			  		exLoad();	
			  	}
			  	
		  	}	
		  }else{
		 	 alert("Problem retrieving data:" + xmlhttp.statusText)
		  }
		}
	}
	function getXmlHttpRequest(){
		var httpRequest = null;
		try{
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				httpRequest = null;
			}
		}
		if (!httpRequest && typeof XMLHttpRequest != "undefined"){
			httpRequest = new XMLHttpRequest();
		}
		return httpRequest;
	}