// JavaScript Document
var isIE=1;
var isSaf=0;
if (navigator.userAgent.indexOf("MSIE")==-1){isIE=0};
if (navigator.userAgent.indexOf("AppleWebKit")>=0){isSaf=1};



function getObj(objID) {
    // Chino's Super Duper DOM addressing script (xbrowser within limits..:-)
    if(document.getElementById && document.getElementById(objID)) {
	// W3C
	return document.getElementById(objID);
    } else if (document.all && document.all(objID)) {
	// IE4
	return document.all(objID);
    } else if (document.layers && document.layers[objID]) {
	// NS4 .. note: not perfect.. this will not find nested layers
	return document.layers[objID];
    } else {
    // returning 0, will not work for anything else
	return false;
    }
} 

function getElementsByTagNames(list,obj) {
	if (!obj) var obj = document;
	var tagNames = list.split(',');
	var resultArray = new Array();
	for (var i=0;i<tagNames.length;i++) {
		var tags = obj.getElementsByTagName(tagNames[i]);
		for (var j=0;j<tags.length;j++) {
			resultArray.push(tags[j]);
		}
	}
	var testNode = resultArray[0];
	if (!testNode) return [];
	if (testNode.sourceIndex) {
		resultArray.sort(function (a,b) {
				return a.sourceIndex - b.sourceIndex;
		});
	}
	else if (testNode.compareDocumentPosition) {
		resultArray.sort(function (a,b) {
				return 3 - (a.compareDocumentPosition(b) & 6);
		});
	}
	return resultArray;
}

function sbtnHot(id){getObj(id).className = "sbtn_r"};
function sbtnOff(id){getObj(id).className = "sbtn"};
toarray = new Array();
function showBtn(x){
	getObj("btn"+x).className = "vbtn";
	for(i=1000;i<1100;i++){getObj("btn"+i).className = "vbtn"};
	getObj("btn"+x).className = "vbtn";
	//n = parseInt(Math.random() * 2);
	//btn = "btn"+x;
	//toarray[n] = window.setTimeout("exShowBtn(btn)",1); 
}

function exShowBtn(btn){
	getObj(btn).className = "vbtn";
}
function hideBtn(x){
	getObj("btn"+x).className = "hbtn";
}
function showpage(p,t,b){
	getObj("btn"+b).className = "vbtn";
	for(x=1;x<t+1;x++){
		myPg = getObj("pg"+x);
		if(myPg != false){myPg.style.display = "none"};
	}
	getObj("pg"+p).style.display = "inline";
}
function showPageBtn(x){
	getObj("btn"+x).className = "vbtn";
}
function showMainBtn(x){
	for(i=1;i<5;i++){
		getObj("btn"+i).className = "vbtn";
	}
}
function btnRollover(id){
		getObj(id).className="btn_dn"
		getObj(id+"-b1").style.visibility="hidden";
		getObj(id+"-b2").style.color="#ffffff";
		}
function btnRollout(id){
		getObj(id).className="btn_up"
		getObj(id+"-b1").style.visibility="visible";
		getObj(id+"-b2").style.color="#000000";
		}
function doJrollin(id){
	if(getObj(id).className =="btndisabled"){ return(false) };
	getObj(id).src=eval(id+"_bd").src;
	}
function doJrollout(id){
	if(getObj(id).className =="btndisabled"){ return(false) };
	getObj(id).src=eval(id+"_bu").src;
	}
	
function doAlert(msg){
		alert(msg);
}
function enC(str){
	s = ""
	a = new Array();
	for(z=0;z<str.length;z++){
		a.push(str.charCodeAt(z));
		}
	for(z=0;z<a.length;z++){
		s+= String.fromCharCode(a[z] + 2);
		}
	return(escape(s));
	}
	
function denC(str){
	s = ""
	str = unescape(str);
	a = new Array();
	for(z=0;z<str.length;z++){
		a.push(str.charCodeAt(z));
		}
	for(z=0;z<a.length;z++){
		s+= String.fromCharCode(a[z] - 2);
		}
	return(escape(s));
	}
	
function cap1stChar(theString){
	ch = theString.slice(0,1);
	chs = theString.slice(1);
	ch = ch.toUpperCase();
	return(ch+chs);
}

function ellipsisted(theString, maxlength){
	if(theString.length>maxlength){
		theString = theString.slice(0, (maxlength-2)) + "...";
		}
	return(theString)
	}
	
function stopShoppingAndGoTo(thePage){
 	if(confirm("Leaving this shopping cart will terminate this session. You will lose the contents of your shopping cart. \n\nDo you wish to proceed? Press \"Ok\" to leave the cart, or \"Cancel\" to contine shopping.")){
		document.location = "http://www.barpokerleague.com/" + thePage;
		}
	return false;
	}
