/*Setup Global arrays for regex and other standards*/
var global_regex = new Array("/[^a-zA-Z0-9]/g, '-'", "/[^0-9]/g, ''");
/*End Globals & Arrays*/
function menuGo(menu) {
if (document.all&&document.getElementById) {
	navRoot = document.getElementById(menu);

	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", "");
			}
		}
	}

}
}

function logo_ro(logo, InorOut){
	var theUrl = 'http://lib.artsandtv.com/img/';
	switch(logo){
		case 'logo_aas':
			logo_aas.src=theUrl+'actionandsports.com/logo-web-med'+ InorOut +'.gif';
			break;
		case 'logo_atv':
			logo_atv.src=theUrl+'artsandtv.com/logo-web-med'+ InorOut +'.gif';
			break;
		case 'logo_mvn':
			logo_mvn.src=theUrl+'musicvision.com/logo-web-med'+ InorOut +'.gif';
			break;
		case 'logo_tag':
			logo_tag.src=theUrl+'techandgamers.com/logo-web-med'+ InorOut +'.gif';
			break;
	}
}


function menuGo2(menu, objectfind, className2){
if (document.all&&document.getElementById){
	navRoot = document.getElementById(menu);
	//b = new getObj('b');
	for (i=0; i<navRoot.childNodes.length; i++){
		node = navRoot.childNodes[i];
		//window.alert( 'The value of the text node is:\n' + node );
		if(node.nodeName==objectfind){
			node.onmouseover=function(){
			if(this.className != className2)
				this.className+=className2;
//list='';list=this.parentElement.childNodes; list=this.nextSibling.id;list = this.childNodes.classNames;
				for(x=0; x<this.parentElement.childNodes.length; x++){
					//list = list+','+ this.parentElement.childNodes[x].className+'='+this.id;
					if( this.id != this.parentElement.children[x].id  
						&& this.parentElement.childNodes[x].className == className2)
						this.parentElement.children[x].className
							=this.parentElement.children[x].className.replace(className2, "");
//this.children[x].parentNode=this.children[x].parentNode.className.replace(" over", "");//alert( 'The value of the text node is:\n' + list );
				}//b=b.replace(" over", "");//this.nextSibling=this.nextSibling.replace(" over", "");
			}//node.onclick = function () { this.parentNode.removeChild(this); };
		}
	}

}
}
function MM_jumpMenu(targ, add_pre, selObj, add_post, restore){ //v3.0
  eval(targ+".location='"+ add_pre +selObj.options[selObj.selectedIndex].value+ add_post +"'");
  if (restore) selObj.selectedIndex=0;
}



var hide  = true;
function showhide(obj, lyr, valX, valY){
	var x = new getObj(lyr);
	hide = !hide;x.style.visibility = (hide) ? 'hidden' : 'visible';
	setLyr(obj, lyr, valX, valY);
}

function switchForm( toanchor, divID, valX, valY){
	var x = new getObj(currentDiv);var y = new getObj(divID);
	x.style.left=-1000;	
	y.style.left = getPos( toanchor, 'x') + valX;y.style.top = getPos( toanchor, 'y') + valY;
	currentDiv=divID;
}

function setLyr(obj, lyr, valX, valY){
	var newX = findPosX(obj) + valX;
	var newY = findPosY(obj) + valY;
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
	/*tobeClosed(lyr);*/
}

/*function closeMenu(lyr){
		closeMenuThis = new getObj(lyr);
		closeMenuThis.style.visibility = 'hidden';
		//hide = !hide;
		//setTimeout( "closeMenuThis.style.visibility = (hide) ? 'hidden' : 'visible';", 3000);
}*/

/*function tobeClosed(lyr){
	closeMenuThis = document.getElementById('menuSearch');
	closeMenuThis.onMouseOut = function() {
		hide = !hide;
		setTimeout( "closeMenuThis.style.visibility = (hide) ? 'hidden' : 'visible';", 3000);
	}
}*/

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;
}

/*
var currentMenu = 'menuMember';
var menu = document.getElementById('menuMember');
menu.onmouseout = function() {
	a=1;
	setTimeout('if(a==1){currentMenu.style.visibility = "hidden"};',10000);
};*/


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){
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}

function getPos(el, rettype) {
//var x, w, y, h;
	if (document.getBoxObjectFor) {
		box = document.getBoxObjectFor(el);
		x = box.x;
		w = box.width;
		y = box.y;
		h = box.height;
	}else if (el.getBoundingClientRect) {
		box = el.getBoundingClientRect();
		x = box.left;
		w = box.right - box.left;
		y = box.top;
		h = box.bottom - box.top;
	}

	switch (rettype) {
		case 'x':
			return x; break;
		case 'y':
			return y; break;
		case 'w':
			return w; break;
		case 'h':
			return h;
	}

}

function ss(w){
window.status=w; return true;
} 
function cs(){
window.status='';
}
function ga(o,e){
if (document.getElementById){
	a=o.id.substring(1); p = "";r = "";g = e.target;
	if(g){ 
		t = g.id;f = g.parentNode;
		if(f){
			p = f.id;h = f.parentNode;
			if(h) r = h.id;
		}
	}else{h = e.srcElement; f = h.parentNode;
		if (f) p = f.id; t = h.id;
	}

	if (t==a || p==a || r==a) return true;
	location.href=document.getElementById(a).href;
}
}

function qs(el, x) {
kw = el.value.replace(global_regex[x]); 
return kw;
/*
if(window.RegExp && window.encodeURIComponent){
var qe=encodeURIComponent(el);

if(el.href.indexOf("/kw-")!=-1){kw=el.href.replace(new RegExp("/kw-[^&$]*"),"/kw-"+qe);
}else{kw="/kw-"+qe;
}
}
*/
}