﻿// JScript File
//setInterval(updateLoc, 20);
//updateloc();
document.loc = "";

//setLocation(window.location.hash.toString().substr(1), '')
function updateLoc() {
	if (window.location.hash.toString().substr(1) != document.loc && !document.chill) 
	    {
	    //alert('updateLoc');
	    //setLocationToFlash(window.location.hash.toString().substr(1));
	    //alert(window.location.hash.toString().substr(1));
	    //setLocationToIFrame(window.location.hash.toString().substr(1));
	    setLocation(window.location.hash.toString().substr(1), '')
	    } else {
	        if (window.location.search.substring(1).indexOf("action=") == -1) {
	            window.frames['cFrame'].location.href = 'startpage.aspx';
	        }
    }
}

function setLocation(loc, title) { 
    //alert('setLocation ' + loc);
    //alert(window.location.hash);
	window.location.hash = loc;
	//alert(window.location.hash.toString().substr(1));
	document.loc = loc;
	document.title = "Bording, " + title;
	document.chill = true;
	setTimeout(killChill, 10);
	setLocationToIFrame(window.location.hash.toString().substr(1));
}

function setLocationToFlash(loc) {
	if ($('deasign').setLocation) $('deasign').setLocation(loc);
}

function setLocationToIFrame(loc) {
    //alert('setLocationToIFrame ' + loc);
    
    //alert(window.frames['cFrame']);
	//document.cFrame.location = 'page.aspx?page=' + loc;
	//document.getElementById('cFrame').src = 'page.aspx?page=' + loc;
	window.frames['cFrame'].location.href = 'page.aspx?page=' + loc;
}

function killChill() {
//alert('kill');
	document.chill = false;
}

