
// Some usefuls functions ============================================================

// Preload Icon Images
function preloadimages() {
	var myimages=new Array();
	
	for (i=0; i < preloadimages.arguments.length; i++) {
		myimages[i] = new Image();
		myimages[i].src=preloadimages.arguments[i]
	}
}

// Hide a spcified div
function hidediv(id) {
 	//safe function to hide an element with a specified id
 	if (document.getElementById) { // DOM3 = IE5, NS6
 		document.getElementById(id).style.display = 'none';
 	}
 	else {
 		if (document.layers) { // Netscape 4
 			document.id.display = 'none';
 		}
 		else { // IE 4
 			document.all.id.style.display = 'none';
 		}
 	}
 }

// Show a specified div
function showdiv(id) {
	 //safe function to show an element with a specified id

 	if (document.getElementById) { // DOM3 = IE5, NS6
 		document.getElementById(id).style.display = 'block';
 	}
 	else {
 		if (document.layers) { // Netscape 4
 			document.id.display = 'block';
 		}
 		else { // IE 4
 			document.all.id.style.display = 'block';
 		}
 	}
}


// Screen Size Detection Script
var screenW = 0, screenH = 0;

if (parseInt(navigator.appVersion) > 3) {
  screenW = screen.width;
  screenH = screen.height;
} else if (navigator.appName == "Netscape"
    	    && parseInt(navigator.appVersion) == 3
    		&& navigator.javaEnabled()) {
 	var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 	var jScreenSize = jToolkit.getScreenSize();
 	screenW = jScreenSize.width;
 	screenH = jScreenSize.height;
}

if (screenW >= 1280) {
 	document.write("<style type=\"text/css\">@import url(\"/wp-content/themes/m1kblog/style1280.css\");</style>");
} else {
 	document.write("<style type=\"text/css\">@import url(\"/wp-content/themes/m1kblog/style1024.css\");</style>");
}

//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("/wp-content/themes/m1kblog/images/blog_icon.png","/wp-content/themes/m1kblog/images/m1k_icon.png","/wp-content/themes/m1kblog/images/photo_icon.png");
