﻿function parseTerms(e) {
	var terms = document.getElementById(e).value.split(" ");
	var parsed = ""
	for (i = 0; i < terms.length; i++) {
		parsed += "t" + i + "=" + terms[i] + "&";
		}
	var url = "search.aspx?" + parsed;
	location.href = url.substring(0,url.length-1);
}
function showMenu(e, d) {
	var m = document.getElementById("MenuPopUpSub_" + e.id.split("_")[1]);
	if (m.style.display != d) {
		m.style.display = d;
		m.style.position = 'absolute';
		m.style.zIndex = 999;
	}
}
function showMenuSub(e, d) {
	var m = document.getElementById("MenuPopUpSub_" + e.id.split("_")[1]);
	if (m != null) {
		if (m.style.display != d) {
			m.style.display = d;
			m.style.position = 'absolute';
			m.style.zIndex = 999;
			m.style.top = Top(e) + 'px';
			m.style.left = (Left(e) + 210) + 'px';
		}
	}
}
function keepMenu(e, d, c, b) {
	if (e.style.display != d) {
		e.style.display = d;
		swapColor(document.getElementById(e.id.replace("MenuPopUpSub","MenuItem")),c,b); 
	}
}
function Left(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	while (1) {
		curleft += obj.offsetLeft;
		if (!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if (obj.x)
	curleft += obj.x;
	return curleft;
}
function Top(obj) {
	var curtop = 0;
	if (obj.offsetParent)
	while (1) {
		curtop += obj.offsetTop;
		if (!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if (obj.y)
	curtop += obj.y;
	return curtop;
}
function showImage(i) {
	document.getElementById("hover_" + i).style.display = "inline";
	document.getElementById("normal_" + i).style.display = "none";
}
function hideImage(i) {
	document.getElementById("hover_" + i).style.display = "none";
	document.getElementById("normal_" + i).style.display = "inline";
}
function swapColor(e, c, b) {
//	var theRules = new Array();	
//	for (s=0;s<document.styleSheets.length;s++) {
//		if (document.styleSheets[s].cssRules)
//			{ theRules = document.styleSheets[s].cssRules; }
//	 	else if (document.styleSheets[s].rules)
//	 		{ theRules = document.styleSheets[s].rules;	}
//	 	for (n in theRules)	
//	 		{ 
//	 		if (theRules[n].selectorText == "." + e.className)
//	 			{
//		 			if (c == '') { c = theRules[n].style.color; }
//		 			if (b == '') { b = theRules[n].style.backgroundColor; }
	 				if (e.style.color != c) 
	 				{
	 					e.style.color = c;
	 					e.style.backgroundColor = b;
	 					e.parentNode.style.backgroundColor = b;
	 				}
//	 				else if (h == "out" && e.style.color != c)
//	 				{
//	 					e.style.color = c;
//	 					e.style.backgroundColor = b;
//	 					e.parentNode.style.backgroundColor = b; 
//	 				}
//	 			}
//	 		}
//	 	}
	}
function gotoSlide(increment,run) {
	if (bolAuto == run) {
		document.getElementById('slideshow' + intFrame).style.zIndex = "1";
	    Effect.Fade('slideshow' + intFrame);
	    intFrame = intFrame + increment;
	    if (intFrame > intCount) { intFrame = 1; }
	    if (intFrame == 0) { intFrame = intCount; }
	    setTimeout("Effect.Appear('slideshow" + intFrame + "');", 0);
	    if (bolAuto == true) { setTimeout("gotoSlide(1,true)",intMilliseconds); }
	}
}
function showBig(e,d) {
	document.getElementById(d).src = e.src.toLowerCase().replace("_thumbnail","_880X490");
}
