// JavaScript Document
function hideLogin () {
 document.getElementById("login-container").style.display='none';
}
function LoginTimeout () {
	loginTimeout = setTimeout("hideLogin()",300)	
}
function verifyReg(formName) {	
	var emailField, formSubmit, passField, cpassField, aliasField, siteField;	
	emailField = formName + ".eml.value";	
	emailCon = formName + ".emlc.value";
	passField = formName + ".pwd.value";
	cpassField = formName + ".cpwd.value";
	aliasField = formName + ".palias.value";
	siteField = formName + ".psite.value";
	formSubmit = formName + ".submit();";
	
	if ( eval(emailField) == '' || eval(emailField).indexOf('@') < 1 || eval(emailField).indexOf('.') < 1 ) {
		alert("Please insert a valid email address"); 
		return false;} 
	if ( eval(emailField) != eval(emailCon) ) {
		alert("Email addreses do not match"); 
		return false;}
	if ( eval(passField) == '' ) {
		alert("Please enter a password"); 
		return false;}
	if ( eval(passField) != eval(cpassField) ) {
		alert("Password and Confirm Password do not match"); 
		return false;}
	if ( eval(aliasField) == '' ) {
		alert("Please enter a Primary Site Alias"); 
		return false;}
	if ( eval(siteField) < 0 ) {
		alert("Please select the site for your alias"); 
		return false;
	} 	
	eval(formSubmit);
}

function valNFR() {	
	if ( document.getElementById("falias").value == '' ) {
		alert("Please insert desired forum alias"); 
		return false;}	 	
	document.forms["newForumReg"].submit();
}

function valEFR() {	
	if ( document.getElementById("username").value == '' ) {
		alert("Please insert current forum alias"); 
		return false;}	
	
	document.forms["existingForumReg"].submit();
}

function openOddsCalc() {
  window.open('/tools/pokercalculator.asp','oddscalc','scrollbars=0,height=600,width=961,titlebar=0,outerwidth=0,outerheight=0');
}


function cc()
{
 /* check for a cookie */
  if (document.cookie == "") 
  {
	document.cookie = 'cookiecheck' + escape('nothing')
    /* if a cookie is not found - alert user -
     change cookieexists field value to false */
    alert("COOKIES need to be enabled!");

    /* If the user has Cookies disabled an alert will let him know 
        that cookies need to be enabled to log on.*/ 

    //document.Form1.cookieexists.value ="false"  
  } else {
   /* this sets the value to true and nothing else will happen,
       the user will be able to log on*/
    //document.Form1.cookieexists.value ="true"
	alert("cookie cookie cookie")
  }
}
function runTeaser() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="430" height="190">')
	document.write('<param name="movie" value="/images/home/dock.swf">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="/images/home/dock.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="430" height="190"></embed>')
	document.write('</object>')
}
function runRightBanner(fileName,bannerID,path) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="160" height="600" id=ShockwaveFlash1>')
	document.write('<param name="movie" value="/images/banners/' + fileName + '">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="menu" value="false">')
	document.write('<param name="FlashVars" value="' + path + '">')
	document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="/images/banners/' + fileName + '" flashVars="' + path + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="160" height="600"></embed>')
	document.write('</object>')
}
function runLeftBanner(fileName,bannerID,path) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="205" height="90" id=ShockwaveFlash1>')
	document.write('<param name="movie" value="/images/banners/' + fileName + '">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="menu" value="false">')
	document.write('<param name="FlashVars" value="clickTag=/banneradmin/clickthroughproc.asp?bannerid=' + bannerID +'%26viewedPage=' + path + '">')
	//document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="/images/banners/' + fileName + '" flashVars="clickTag=/banneradmin/clickthroughproc.asp?bannerid=' + bannerID + '%26viewedPage=' + path + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="205" height="90"></embed>')
	document.write('</object>')
}
function runTopBanner(fileName,bannerID,path) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="468" height="60" id=ShockwaveFlash1>')
	document.write('<param name="movie" value="/images/banners/' + fileName + '">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="menu" value="false">')
	document.write('<param name="FlashVars" value="clickTag=/banneradmin/clickthroughproc.asp?bannerid=' + bannerID +'%26viewedPage=' + path + '">')
	//document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="/images/banners/' + fileName + '" flashVars="clickTag=/banneradmin/clickthroughproc.asp?bannerid=' + bannerID + '%26viewedPage=' + path + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed>')
	document.write('</object>')
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/* Set a cookie to be sure that one exists.
   Note that this is outside the function*/
//document.cookie = 'killme' + escape('nothing')

var t			
function swapSlide(active,totalSlides) {
 var i = active	
 var z = totalSlides
 var y = 1

 //var delay = 5500 
 var slide
clearTimeout(t);
 while (y <= z ) 
 {
	 document.getElementById('slide-0' + y).style.display = 'none'
	 document.getElementById('sslnk-0' + y).style.color = ''	 
	 y = y + 1
 } 
 document.getElementById('sslnk-0' + i).style.color = '#990000'
 jQuery.noConflict();
 jQuery('#slide-0' + i).fadeIn('fast');
 if (i == z) {
	slide = "swapSlide(1," + z + ")"	
	t=setTimeout(slide,5500);
 } else {
	i = i+1
	slide = "swapSlide(" + i + "," + z + ")"			
	t=setTimeout(slide,5500);
 }			 			 
}

function stopSlide() {
 clearTimeout(t);	
}

function SHOWUPDT(VAL) {
		document.getElementById('UPDT-' + VAL).style.display = ""
		document.getElementById('CHPC-' + VAL).style.display = "none"
		document.getElementById('NOTS-' + VAL).style.display = "none"
		document.getElementById('TWTS-' + VAL).style.display = "none"
		document.getElementById('UBS-' + VAL).style.display = ""
		document.getElementById('UBO-' + VAL).style.display = "none"
		document.getElementById('CBO-' + VAL).style.display = ""
		document.getElementById('CBS-' + VAL).style.display = "none"
		document.getElementById('NBO-' + VAL).style.display = ""
		document.getElementById('NBS-' + VAL).style.display = "none"
		document.getElementById('RTO-' + VAL).style.display = ""
		document.getElementById('RTS-' + VAL).style.display = "none"
	}
	function SHOWCHPC(VAL) {		
		document.getElementById('UPDT-' + VAL).style.display = "none"
		document.getElementById('CHPC-' + VAL).style.display = ""
		document.getElementById('NOTS-' + VAL).style.display = "none"
		document.getElementById('TWTS-' + VAL).style.display = "none"
		document.getElementById('CBS-' + VAL).style.display = ""
		document.getElementById('CBO-' + VAL).style.display = "none"
		document.getElementById('UBS-' + VAL).style.display = "none"
		document.getElementById('UBO-' + VAL).style.display = ""
		document.getElementById('NBS-' + VAL).style.display = "none"
		document.getElementById('NBO-' + VAL).style.display = ""
		document.getElementById('RTO-' + VAL).style.display = ""
		document.getElementById('RTS-' + VAL).style.display = "none"
		
	}
	function SHOWNOTS(VAL) {		
		document.getElementById('UPDT-' + VAL).style.display = "none"
		document.getElementById('CHPC-' + VAL).style.display = "none"
		document.getElementById('NOTS-' + VAL).style.display = ""
		document.getElementById('TWTS-' + VAL).style.display = "none"
		document.getElementById('NBS-' + VAL).style.display = ""
		document.getElementById('NBO-' + VAL).style.display = "none"
		document.getElementById('CBO-' + VAL).style.display = ""
		document.getElementById('CBS-' + VAL).style.display = "none"
		document.getElementById('UBO-' + VAL).style.display = ""
		document.getElementById('UBS-' + VAL).style.display = "none"
		document.getElementById('RTO-' + VAL).style.display = ""
		document.getElementById('RTS-' + VAL).style.display = "none"
	}
	function SHOWTWTS(VAL) {		
		document.getElementById('UPDT-' + VAL).style.display = "none"
		document.getElementById('CHPC-' + VAL).style.display = "none"
		document.getElementById('NOTS-' + VAL).style.display = "none"
		document.getElementById('TWTS-' + VAL).style.display = ""
		document.getElementById('NBS-' + VAL).style.display = "none"
		document.getElementById('NBO-' + VAL).style.display = ""
		document.getElementById('CBO-' + VAL).style.display = ""
		document.getElementById('CBS-' + VAL).style.display = "none"
		document.getElementById('UBO-' + VAL).style.display = ""
		document.getElementById('UBS-' + VAL).style.display = "none"
		document.getElementById('RTO-' + VAL).style.display = "none"
		document.getElementById('RTS-' + VAL).style.display = ""
	}

function showTable(TID){
	document.getElementById('showtable').innerHTML = "<iframe src='/tournaments/finaltable.asp?tid=" + TID + "' frameborder='0' scrolling='no'  width='420' height='264'></iframe>"
	document.getElementById('hideshow').style.visibility = "visible";	
}
function hideTable(){	
	document.getElementById('hideshow').style.visibility = "hidden";	
}

//AJAX FOR HOME NEWS PAGING
// JavaScript Document
function pageHmNews(str)
{
if (str.length==0)
  { 
  document.getElementById("other-news-container").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/includes/hm/other-news-paging.asp";
url=url+"?pagenum="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=setHmNewsHTML;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function setHmNewsHTML() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("other-news-container").innerHTML=xmlHttp.responseText;
}
}


jQuery(document).ready(function($){	
jQuery.noConflict();
var sbPath = '/images/searchbar/';
$('#sbLive').click(function() {$('#sbType').attr('value', '1');$('#sbLive').attr('src',sbPath + 'live-on.png');$('#sbOnline').attr('src',sbPath + 'online-off.png');});   
$('#sbOnline').click(function() {$('#sbType').attr('value', '2');$('#sbOnline').attr('src',sbPath + 'online-on.png');$('#sbLive').attr('src',sbPath + 'live-off.png');});
//ADJUST SITE WRAP
//var affLnk = "http://serv12.bluffmedia.com/servlet/click/media?zid=0&mid=1510"
//$('#siteWrap').removeClass('noWrap')
//$('#siteWrap').addClass('ubWrap')
//$('#wrapLeft').addClass('showPointer')
//$('#wrapRight').addClass('showPointer')
//$('#wrapLeft').click(function(){window.open(affLnk)})
//$('#wrapRight').click(function(){window.open(affLnk)})
})
