// JAVASCRIPT COLLECTION BY Grafikka
// ----------------------------------------------
// COPYRIGHT (C) 2001-2005 BY Grafikka
// ALL RIGHTS RESERVED
// WWW.GRAFIKKA.NET
// ----------------------------------------------

// NOTE: for this file to work insert into <BODY> tag like this: <body onload="removeBlur(), showDiv()">

// remove blur function - install note: insert into <BODY> onload="removeBlur()"
	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if (!document.getElementById) return
		links = document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = unblur
		}
	}
function removeBlur() {
			// removes the link boxes
			getLinksToBlur();
		}	
		
// PopUP window centered - install note: make href tag = javascript:popUp('your_page.html','popup',200,300,'scrollbars,resizable')
function popUp(file,name,width,height,parameters,align) {
	parameters += ',width='+width+',height='+height
	parameters += ',left='+(screen.availWidth - width)/2
	parameters += ',top='+(screen.availHeight - height)/2
	popup = window.open(file,name,parameters)
	popup.window.focus()
}		


// PRINT DOCUMENT - install note: make href tag = javascript:printit()
<!--

function printit(){
if (window.print) {
    window.print() ;
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";
}
}
//-->

// DEFAULT STATUSBAR STATUS
// defaultStatus ="[ Copyright (C) 1999-2009 Morten Grantzau | All Rights Reserved ]"


// PRATE MODIFIED NOSPAM MAIL SCRIPT 	// javascript:killSpam('morten','grantzau.com')
	function killSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
	}


//	LOAD EXTERNAL PAGES IN AJAX
//	USAGE: new loadXmlHttp('requested_url', 'target_element_id')

function loadXmlHttp(url, id) {
	var f = this;
	f.xmlHttp = null;
	/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
	/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
	try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
	@end @*/
	if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
	f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
	else if (/(object)|(function)/.test(typeof createRequest))
	f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
	else {
	f.xmlHttp = null;
	 // Internet Explorer 5 to 6, includes IE 7+ when local //
	/*@cc_on @*/
	/*@if(@_jscript_version >= 5)
	try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
	catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
	@end @*/
}
	if(f.xmlHttp != null){
		f.el = document.getElementById(id);
		f.xmlHttp.open("GET",url,true);
		f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
		f.xmlHttp.send(null);
}
	else alert('Your browser does not support AJAX!'); // substitute your desired request object unsupported code here
}

loadXmlHttp.prototype.stateChanged=function () {
	if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
		this.el.innerHTML = this.xmlHttp.responseText;
}
