// JavaScript Document

var domainroot="www.psiwebware.com"

function googleSearch(formobj){
	formobj.q.value="site:"+domainroot+" "+formobj.q.value;
}

function switchClass(element_id, new_class){
	var element = document.getElementById(element_id);
	element.className = new_class;
}

function addRollOver(element, element_class, element_roll_class){
	//var element = document.getElementById(element.id);
	obj = element;
	element.onfocus = function() {
		switchClass(element, element);
	}
	element.onmouseover = function() {
		switchClass(element, element);
	}
	element.onblur = function() {
		switchClass(element, element);
	}
	element.onmouseout = function() {
		switchClass(element, element);
	}
}

function validateRegForm(){
	
}

function openFootnote(footnote_num){
	new Effect.ScrollTo('footanchor', {duration: 0.7});
	var footnotes = $$('.footnote');
	for(i=0; i<footnotes.length; i++){
		new Effect.BlindUp(footnotes[i], { queue: 'end', duration: 0.2 });
		//footnotes[i].style.display = "none";
	}
	var footnote = $('footnote-'+footnote_num);
	//new Effect.BlindDown($('Footnotes'), { queue: 'end' });
	new Effect.BlindDown(footnote, { queue: 'end', duration: 0.4 });
	//new Effect.Pulsate('footnote-'+footnote_num, {pulses:2, duration:0.5, queue: 'end'});
	new Effect.Morph('footnote-'+footnote_num, {style: 'color:#BE9014', queue: 'end'});
		
}

function scrollToHash(lnk){
	var ankr = /#(.*)/.exec(lnk.href);
	var anchorTag = ankr[1];
	//var anchorTag = self.document.location.hash.substring(1);
	if(anchorTag!=''){
		// Then scroll to the content
		new Effect.ScrollTo(anchorTag+"-head");
		new Effect.Pulsate(anchorTag+"-head", {pulses:5, duration:2, queue:'end'});
	}
}

function scrollToHashFirst(){
	var anchorTag = self.document.location.hash.substring(1);
	if(anchorTag!=''){
		// First go to the top
		// Then scroll to the content
		new Effect.ScrollTo(anchorTag+"-head");
		new Effect.Pulsate(anchorTag+"-head", {pulses:5, duration:2, queue:'end'});
	}
}

Event.observe(window, "load", function(){
	window.scroll(0,0);
	var t=setTimeout("scrollToHashFirst()",1000);
});

var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
if(ie7){
	window.scroll(0,0);
}