var popup;
var Location = false;
var ExpectedHash = "";

onload = function ()
{
    PollHash();
	GetPage(GetLocation());
}

function MakeHistory(newHash){  window.location.hash = newHash;  ExpectedHash = window.location.hash;  return true;}function HandleHistory(){  if ( window.location.hash != ExpectedHash )  {    ExpectedHash = window.location.hash;
    GetPage(GetLocation());  }  return true;}function PollHash() {  HandleHistory();  window.setInterval("HandleHistory()", 400);  return true;}

GetLocation = function()
{
    var loc = window.location.hash.substring(1);
    if(loc) {
        return loc;
    } else {
        return "";
    }
}

GetPage = function (loc)
{
	if(loc) {
		new Ajax.Updater('content', loc+'?inc=1', {asynchronous:false,evalScripts:true});
	}
}


ShowPopup = function(passLink)
{
	if(!popup || popup.closed) {
    	popup = window.open(passLink, "dustysworldradio", "width=600,height=500,toolbar=no,menubar=no,status=no,location=no");
		popup.focus();
    	popup.moveTo(100,200);
	} else {
		popup.focus();
	}
}

UpdateBody = function(passLink,hashName)
{
    if(PageLocation != HomeLocation) {
        window.location = HomeLocation+"#"+hashName;
    } else {
	   window.location.hash = "#"+hashName;
	   urchinTracker(hashName);
    }
	return false;
}

_uacct = "UA-3933220-1";urchinTracker();
