<!--
//-->
/*************************************************************
little bit o faq'in div givr by: cuce & christoval
*************************************************************/
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
	curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	curtop += obj.y;
	return curtop;
}
function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	//newY -= -20;
	//newX -= -133;
	newY += 20; //vertical use -= to move to the top, += to go the bottom
	newX -= 26; //horizontal use -= to move to the left, += to go the right
	var x = new getObj(lyr);
	//x.style.position = 'relative';
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
	x.style.display = 'block';
	//alert('top: ' + x.style.top + '\n left: ' + x.style.left);//Debugging tool
}
function getObj(name)
{
	if (document.getElementById)
	{
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all)
	{
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
	else if (document.layers)
	{
		if (document.layers[name])
		{
			this.obj = document.layers[name];
			this.style = document.layers[name];
		}
		else
		{
			this.obj = document.layers.testP.layers[name];
			this.style = document.layers.testP.layers[name];
		}
	}
}
function hidediv(divtohide){
	divname = document.getElementById(divtohide);
	divname.style.display = 'none';
}
/*************************************************************
GIV3R accessible site search by: cuce & christoval
*************************************************************/
function giver() {
	var accessiblecontent = document.getElementById("searchcontent"); // this defines a variable for controlling the div  containing the actual sitemap etc...
	var hiddenshiz = document.getElementById("search"); // this defines a variable so we can control the main sitemap containing div (the one that contains the button and the actual sitemap content div)
	var button = document.getElementById("button"); // this defines a variable so we can control the button
	var movelimit = 75; // this is the how many pixels you want the div to come up(from zero)
	var howfastisdatbiatch = 25; // this is the rate that the div will move
	var divoffset = 25; // offset value for ie
	var ieoffset=(movelimit +divoffset-2)*-1; // determine how many pixels ie will offset the thing in relation to the div size
	var currentposition = 25; //  starting point
	/* I wouldn't edit below here if I was you. */
	button.onclick = function() { intervalID = setInterval(up, 50);}
	function up() {if (currentposition < movelimit)
	{
		currentposition += howfastisdatbiatch;	// determine howfastdatbiatch actually is
		accessiblecontent.style.display = "block"; // unhide the sitemap or whatever now
		hiddenshiz.style.bottom = currentposition + "px"; // move up incrementally
		if (typeof document.body.style.maxHeight == "undefined"){/*EF EXPLORER MAN EFFIN EFF THEM MAN. They made me write this */ if( -1 != navigator.userAgent. indexOf ("MSIE") ){ hiddenshiz.style.bottom = currentposition + ieoffset + "px"; }}
		if (currentposition >= movelimit){button.setAttribute('onclick', 'down();');button.onclick = function() { intervalID = setInterval(down, 50); }}// change the button so it goes down next click
	}
	else
	clearInterval(intervalID);
	}
	function down() {
		if (currentposition > 0)
		{
			currentposition -= howfastisdatbiatch;	// determine howfastdatbiatch actually is
			hiddenshiz.style.bottom = currentposition + "px";  // move up incrementally
			if (currentposition<=divoffset){accessiblecontent.style.display = "none";} // hide the sitemap once its down so you cant scroll down to see it
			if (typeof document.body.style.maxHeight == "undefined"){/*EF EXPLORER MAN EFFIN EFF THEM MAN. They made me write this */ if( -1 != navigator.userAgent.indexOf ("MSIE") ) {if (hiddenshiz.style.bottom != ieoffset + "px"){accessiblecontent.style.display = "block";hiddenshiz.style.bottom = currentposition + ieoffset + "px";}if (hiddenshiz.style.bottom ==ieoffset + "px"){accessiblecontent.style.display = "none";hiddenshiz.style.bottom = currentposition - 2 + "px";} }}
			
			
			if (currentposition <= 0){button.setAttribute('onclick', 'up();');button.onclick = function() { intervalID = setInterval(up, 50); }}// change the button so it goes up next click
		}
		else
		clearInterval(intervalID);
	}

}
/********************
End GIV3R
********************/

/*****************************************************************************************
compliant swap - by:cuce based on some dudes notes on webmasterworld.com
******************************************************************************************/
function compliantswap() {
	if (!document.getElementById) return
	var aPreLoad = new Array();;var sTempSrc;;var aImages = document.getElementsByTagName('img');
	for (var i = 0; i < aImages.length; i++) {if (aImages[i].className == 'swap') {var src = aImages[i].getAttribute('src');;var ftype = src.substring(src.lastIndexOf('.'), src.length);	var hsrc = src.replace(ftype, '-o'+ftype);aImages[i].setAttribute('hsrc', hsrc);aPreLoad[i] = new Image();aPreLoad[i].src = hsrc;aImages[i].onmouseover = function() {sTempSrc = this.getAttribute('src');this.setAttribute('src', this.getAttribute('hsrc'));}
	aImages[i].onmouseout = function() {if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('-o'+ftype, ftype);this.setAttribute('src', sTempSrc);}}}}
	/* end compliant swap */

	function givertop() { if(document.getElementById("faqtab")){

		var button = document.getElementById("faqtab");
		var theshiz = document.getElementById("whatthefaq");
		var movelimit = -15;
		var howfastisdatbiatch = 5;
		var currentposition = -35;
		button.onclick = function() { intervalID = setInterval(down, 15); }
		function down() {
			if (currentposition < movelimit){currentposition += howfastisdatbiatch;	theshiz.style.top = currentposition + "px";
			if (currentposition >= movelimit){button.setAttribute('onclick', 'up();');
			button.onclick = function() { intervalID = setInterval(up, 15); }}}else clearInterval(intervalID);}
			function up() {
				if (currentposition > -35){currentposition -= howfastisdatbiatch;	theshiz.style.top = currentposition + "px";
				if (currentposition >= -35){button.setAttribute('onclick', 'down();');
				button.onclick = function() { intervalID = setInterval(down, 15); }}}else clearInterval(intervalID);}
	}
	}
	/* window.onload multiple functions */
	function addLoadEvent(func) { var oldonload = window.onload;  if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() {oldonload(); func(); } } }
	addLoadEvent(compliantswap);
	addLoadEvent(giver);

	addLoadEvent(givertop);
