// $Id: default.js,v 1.5 2010-06-19 02:42:39 ams Exp $

function clearInputOnFocus(taa) {
    if (!taa.lastChange)
    {
	taa.value='';
    };
    taa.lastChange = 1;
    return true;
}

function setActiveStyleSheet(title) {
    var i, a;
    var vertailu = unescape(title).replace(/\+/g,' ');
    var links = document.getElementsByTagName("link");
    for(i=0; (a = links[i]); i++) {
	if (a.getAttribute("rel").indexOf("StyleSheet") != -1
	    && a.getAttribute("title")) {
	    a.disabled = true;
	    if(a.getAttribute("title") == vertailu) {
		a.disabled = false;
	    }
	}
    }
    document.cookie = "css=" + title + "; path=/~ams/";
    return 1;
}

function processCookies() {
    var namut = document.cookie.split(';');
    for(var i = 0; i < namut.length; ++i) {
    	var namu = namut[i];
	var indeksi = namu.indexOf("css=");
	if (indeksi != -1) {
	    setActiveStyleSheet(namu.substring(indeksi+4, namu.length));
	    return;
	}
    }
}
// Processing the cookies after window is done loading looks
// ugly because the google scripts take a while to process...
processCookies();
// window.onload = processCookies();

// Mainosten asetukset
google_ad_client = "pub-7531454665200897";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "333333";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_url = "999999";
google_color_text = "CCCCCC";

// EOF

