﻿
/*
 *  Site JS Script from James.Milne@MyriadTech.com.au
 *
 */

function SetTheme(cssName) {

	if (cssName!=null) { 	
	
		var cssNode=document.createElement("link");
		cssNode.setAttribute("rel", "stylesheet");
		cssNode.setAttribute("type", "text/css");
		
		var cssString = "/blog/James/_catalogs/masterpage/"+cssName;
		cssNode.setAttribute("href", cssString);
		
		var headID = document.getElementsByTagName("head")[0]; 
		headID.appendChild(cssNode);
		//document.head.appendChild(cssNode);
	}
}

// If it is FF
//if (window.addEventListener){
//	window.addEventListener('load', SetTheme_OnLoad, false);
//} else 
//if its Windows Explorer
//if (window.attachEvent){
	window.attachEvent("onload", new Function("SetTheme_OnLoad();"));
//}

function SetTheme_OnLoad() {

	SetTheme(GetCookie('JMTheme')+"/trim.css");

}



