function PassFlash(){
	var URLStr = window.location.toString();
	URLStr = URLStr.split("?");
	URLStr = URLStr[0];
	URLStr = URLStr.substring(7, URLStr.length);
	URLStr = URLStr.substring(URLStr.indexOf("/"), URLStr.length);
	window.document.navigation.SetVariable("location",  URLStr);
}

function changeIt(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
function amazonPopUp(URL,NAME) {
	amznwin=window.open(URL,NAME,'location=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=380,height=450,screenX=10,screenY=10,top=10,left=10');
	amznwin.focus();
}


function popUp(url,name,width,height)	{
	var toolbar="toolbar=no,scrollbars=yes,width="+width+",height="+height;
	window.open(url,name,toolbar);
}

function getBanner(){
	if (Math.round(Math.random()*(5))  == 1){
		out = "<a href=\"http://www.tuliptopia.com/\" target=\"_blank\" ><img src=\"/images/banners/ad_tuliptopia_468x60.jpg\" border=\"0\"></a>";
	}else{
		out = "<iframe marginwidth=\"0\" marginheight=\"0\" width=\"468\" height=\"60\" scrolling=\"no\" frameborder=\"0\" src=\"http://rcm.amazon.com/e/cm?t=premiereradionet&l=st1&search=aliens&mode=books&p=13&o=1&bg1=FFFFFF&fc1=FF0000&lc1=083194&lt1=_blank&f=ifr\">";
		out += "<MAP NAME=\"boxmap-p13\"><AREA SHAPE=\"RECT\" COORDS=\"379, 50, 460, 57\" HREF=\"http://rcm.amazon.com/e/cm/privacy-policy.html?o=1\" target=main><AREA COORDS=\"0,0,10000,10000\" HREF=\"http://www.amazon.com/exec/obidos/redirect-home/premiereradionet\" target=main></MAP><img src=\"http://rcm-images.amazon.com/images/G/01/rcm/468x60.gif\" width=\"468\" height=\"60\" border=\"0\" usemap=\"#boxmap-p13\" alt=\"Shop at Amazon.com\">";
		out += "</iframe>";
	}
	return out;
}

 /**
  * displays preloader message, while page loading
  * @return boolean
  */
 
 function pageLoad(){
	try {
	  var host = window.location.host;
	  if(host!='archive.coasttocoastam.com' && host!='coast.webmaster.premiereradio.net:1111'){
		  window.location='http://beta.coasttocoastam.com';
		}
		else{
      $("wait-message").innerHTML = 'Please wait... loading';
      $("bg1").style.display = "none";
    }
		$("loaderBox").style.display = "none";
	} 
	catch (e) {
		return false;
	}
	return true;
 }
 
