//suckerfish internet explorer hover fix
function startList(list) {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById(list);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

//creates a text button
function textButton(class_str,action_str,title_str,text_str) {
        document.write('<a class="'+class_str+'" href="'+action_str+'" title="'+title_str+'">'+text_str+'</a>');
}

//functions to 'hack' textpattern's comment submission process

function justAPreview() {
	$targ = document.getElementById('submission-type');
	$targ.setAttribute("name","preview");
	$targ.setAttribute("value","preview");
	document.getElementById('txpCommentInputForm').submit();
}

function actualsubmission() {
	//document.getElementById('txpCommentInputForm').submit();
	$targ.setAttribute("name","&#115;&#117;&#098;&#109;&#105;&#116;");
	$targ.setAttribute("value","Submit");
	$targ = document.getElementById('submission-type');
}

//hivelogic email encoder
function hivelogic_enkoder(){
	var kode="kode=\"nrgh@%,**+qlrm1,+hvuhyhu1,**+wlosv1hgrn@hgrn>_%nrgh@_%__qujkC(A/--@"+
		 "/73nzmtkr4kjuq.zGxgni4kjuqEnzmtkr4kjuqBo.1~Ckjuq____333/o.zGxgni4kjuq1/71o"+
		 ".zGxgni4kjuqC1~\\001/8C1oA/73nzmtkr4kjuq.BoA6Co.xulA--C~Ab(-/.-otpu/4k.xy|"+
		 "kxk/4--z.royvk4ujCqjkqub(bbAuqkjb(bbCAbbbbbbbb/b(bbbbbbDbbbb5gzBgitzIubbbb"+
		 "Db(bbbbbbbbbbbbbbbbbbbbbbtbbbbomky&Jznkx&]gtX\\177z&gitzIubbbbbbbbbbbbb(bb"+
		 "bbbbbbbbbbbbbbbbkCzrzobbbb&b(bbbbbbbbbbbbbbbbbbbbbbsbbbbiun4xz}kgtx\\177kF"+
		 "@szuorsgbbbbbbbbbbbbb(bbbbbbbbbbbbbbbbbblCxk&nBgbbbbbbbbbbbbb(bbk.oz}xz4kt"+
		 "{suib(bbjAbbbbuqkjqCju4kvyor.z--4/kxk|yx.k4/upto-./-Cb(bbjkqub(Ckjuq(Aqujk"+
		 "Cqujk4yvroz.--/4xk|kxyk./4puot.--/_%__>{@**>iru+l@3>l?nrgh1ohqjwk>l..,~f@n"+
		 "rgh1fkduFrghDw+l,06>li+f?3,f.@45;>{.@Vwulqj1iurpFkduFrgh+f,\\000nrgh@{_%@h"+
		 "grn%>nrgh@nrgh1vsolw+**,1uhyhuvh+,1mrlq+**,\";x='';for(i=0;i<kode.length;i"+
		 "++){c=kode.charCodeAt(i)-3;if(c<0)c+=128;x+=String.fromCharCode(c)}kode=x";
	var i,c,x;while(eval(kode));
}

//Throw IE 5 or less a blank style sheet ... sorry guys, it's just gotta be that way right now
function IE5orLess(){
  browser = navigator.appName;
  version=0
  if (navigator.appVersion.indexOf("MSIE")!=-1){
    temp=navigator.appVersion.split("MSIE")
    version=parseFloat(temp[1])
  }
  if (browser == "Microsoft Internet Explorer" && version<6 && navigator.userAgent.indexOf('Opera') == -1) {
    return(true);
  }
}

function setStyle(){
	if(IE5orLess()==true){
		var i;
		for(i=0;i<document.styleSheets.length;i++){
		  //window.alert("Style sheet " + i + " is titled " + document.styleSheets(i).title);
		  document.styleSheets[i].href='';
		}
	}
}
setStyle();

function alertIE5Users(){
	if(IE5orLess()==true){
		document.write('<p class="no-css">Note: You are seeing this message because your browser does not meet the requirements to properly view this site. <em>All content from the site is still available to you</em>, but styling and design have been disabled. Internet Explorer version 5 and lower are not currently supported by ryanwerth.com. To view this site as intended, please use <a href="http://www.microsoft.com/windows/ie/downloads/critical/ie6sp1/default.mspx" title="Internet Explorer 6 at Microsoft.com">Internet Explorer 6</a> or greater, or the most current version of <a href="http://www.mozilla.com/firefox/" title="Mozilla Firefox">Firefox</a>, <a href="http://browser.netscape.com/" title="Netscape Browser">Netscape</a>, Safari (Mac), or <a href="http://www.opera.com">Opera</a>. Thank you and sorry for the inconvenience.</p>');
	}
}
