// JavaScript Document
function openSub() {
	var HTMLSTRING = ""
	HTMLSTRING = "<div id=trans></div>"
	HTMLSTRING = HTMLSTRING + "<div id=pageLayer><table width=650 height=640 cellpadding=10 cellspacing=5 border=0 align=center bgcolor=#999999>";	
	HTMLSTRING = HTMLSTRING + "<tr><td bgcolor=#000000>";
	HTMLSTRING = HTMLSTRING + "<table cellpadding=0 cellspacing=0 border=0 width=100%>";
	HTMLSTRING = HTMLSTRING + "<tr>";
	HTMLSTRING = HTMLSTRING + "<td align=right style=padding-bottom:10px><a href=javascript:void(0); class=navlink onclick=closeSub();>X CLOSE WINDOW</a></td>";
	HTMLSTRING = HTMLSTRING + "</tr>";
	HTMLSTRING = HTMLSTRING + "</table>";
	HTMLSTRING = HTMLSTRING + "<iframe src=http://www.themagstore.com/?ProductCode=FIG width=650 height=640 scrolling=auto frameborder=0 style=border-color:#00FF00></iframe>";
	HTMLSTRING = HTMLSTRING + "</td></tr></table></div>";	
	document.getElementById("subContainer").innerHTML = HTMLSTRING;
	document.getElementById("subContainer").style.visibility = 'visible';
}

function closeSub() {
	document.getElementById("subContainer").style.visibility = 'hidden';
}

var timeDelay = null;

function timeout(processFunct) {
	timeDelay = setTimeout(processFunct, "500");	
}
function resetTimeout() {
	if (timeDelay) {clearTimeout(timeDelay);}
	timeDelay = null;
}

function hideGirlMenu() {	
	document.getElementById("girlList").style.visibility = "hidden"	
}
function showGirlMenu() {	
	//resetTimeout();
	document.getElementById("girlList").style.visibility = "visible"	
}
function selectGirl(girl) {
	var show
	var hide
	hide = "girl-" + girl
	show = "girl-" + girl + "-v"	
	document.getElementById('girl-001-v').style.display = 'none'
	document.getElementById('girl-002-v').style.display = 'none'
	document.getElementById('girl-003-v').style.display = 'none'
	document.getElementById('girl-004-v').style.display = 'none'
	document.getElementById('girl-005-v').style.display = 'none'
	document.getElementById('girl-006-v').style.display = 'none'
	document.getElementById('girl-007-v').style.display = 'none'
	document.getElementById('girl-008-v').style.display = 'none'
	document.getElementById('girl-009-v').style.display = 'none'
	document.getElementById('girl-010-v').style.display = 'none'
	document.getElementById('girl-011-v').style.display = 'none'
	document.getElementById('girl-012-v').style.display = 'none'
	
	document.getElementById('girl-001').style.display = ''
	document.getElementById('girl-002').style.display = ''
	document.getElementById('girl-003').style.display = ''
	document.getElementById('girl-004').style.display = ''
	document.getElementById('girl-005').style.display = ''
	document.getElementById('girl-006').style.display = ''
	document.getElementById('girl-007').style.display = ''
	document.getElementById('girl-008').style.display = ''
	document.getElementById('girl-009').style.display = ''
	document.getElementById('girl-010').style.display = ''
	document.getElementById('girl-011').style.display = ''
	document.getElementById('girl-012').style.display = '' 
	
	document.getElementById(show).style.display = ''
	document.getElementById(hide).style.display = 'none'
	
	document.getElementById("GirlId").value = girl	
}

function girlVote() {	
	if (document.getElementById("GirlId").value == "") {
		alert("Please Vote Before Submitting ")
	} else {
		document.forms[0].submit()
	}
}

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 = '#FF6F00'		 	
 Effect.Appear('slide-0' + i, { duration: 0.5 })			 
 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 runOdds(active,totalSlides) {
 var i = active	
 var z = totalSlides
 var y = 1
 var t
 //var delay = 5500 
 var slide
clearTimeout(t);
 while (y <= z ) 
 {
	 document.getElementById('stats-' + y).style.display = 'none'
	 //document.getElementById('sslnk-0' + y).style.color = ''	 
	 y = y + 1
 } 
 //document.getElementById('sslnk-0' + i).style.color = '#990000'		 	
 Effect.Appear('stats-' + i, { duration: 0.3 })			 
 if (i == z) {
	slide = "runOdds(1," + z + ")"	
	t=setTimeout(slide,4500);
 } else {
	i = i+1
	slide = "runOdds(" + i + "," + z + ")"			
	t=setTimeout(slide,4500);
 }			 			 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
// LOAD HOMEPAGE CALENDAR ************************************************************************
function loadMonth(str)
{
if (str.length==0)
  { 
  document.getElementById("calcontainer").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/includes/ajax/hm-month.asp";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=setMonthHTML;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function setMonthHTML() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("calcontainer").innerHTML=xmlHttp.responseText;
}
}
