window.onload = function(){
	if (document.getElementById) {
		//external links to open in a new window
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			if (anchor.getAttribute('href') &&  anchor.getAttribute('rel') == 'external') anchor.target = '_blank'; 
		}
		
		if (document.getElementById("callbackf")) {
			var formfields = document.forms[0];
			for (var i=0; i<formfields.length; i++){
				var formfield = formfields[i];
				formfields[i].onfocus=function(){ this.style.background="#f3f5ef" };
				formfields[i].onblur=function(){ this.style.background="#ffffff" };
			}
		}
	}
}

sfHover = function() {
	var sfEls = document.getElementById("top-menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

writeFlash = function(id) {
	switch(id){
		case 'banhome':
			document.getElementById(id).innerHTML = "<object type=\"application/x-shockwave-flash\" data=\"/img/flash/home.swf\" width=\"299\" height=\"118\"><param name=\"wmode\" value=\"opaque\" /><param name=\"movie\" value=\"/img/flash/home.swf\" /></object>";
			break    ;
	}
}