// JavaScript Document
function ShowMenu(){
	
						   
		
										 
				//if the id of this object is not blank, add the HOT class to it.						 
				if(this.id !=''){$('.linkHeader[id='+this.id+']').addClass('linkHeaderHot');}
				
				//figure out the one that we are going to show.								
				var oneToShow = ".subHeader[id="+this.id+"]";	
				
				
				//alert(oneToShow)
					

						//hide other subheaders
						$(".subHeader[id!="+this.id+"]").hide();	
						//remove the linkheader hot class from others
						$(".linkHeader[id!="+this.id+"]").removeClass('linkHeaderHot');
						
						//show the one we want		
						$(oneToShow+':hidden').show('blind');
							
				
						$('.turnOff, .contentMain').mouseenter(function () {
							$(oneToShow).hide()
							$(".linkHeader").removeClass('linkHeaderHot');
						});
					
						//when we roll off of the one that is showing.
						$(oneToShow).mouseleave(function () {
							//hide the one 
							$(oneToShow).hide()
							// change link back to cold
							$(".linkHeader").removeClass('linkHeaderHot');
						});
				
						
}
	
	

function doNothing(){
	
	
	//alert('short')
	
}
	
						   
	
	$(document).ready(function() {	
							   
							   
		var config = {    
				over: ShowMenu, // function = onMouseOver callback (REQUIRED)    
				timeout: 750, // number = milliseconds delay before onMouseOut    
				out: doNothing // function = onMouseOut callback (REQUIRED)    
		};
		
		$(".linkHeader").hoverIntent( config )
		
		
		
		
		

						   
	$("#showMenu").click(function () {	$('#slideMenu').show("blind");	});
	$("#hideMenu").click(function () {	$('#slideMenu').hide("blind");	});
	
	
			 
	
//hover over links on left//////////////////////////////////////
	$('.hoverItem').hover(function() {
	
			$(this).addClass('hoverClass');
	
		}, function() {
	
			$(this).removeClass('hoverClass');
	
	});
	

//Hover for WCA///////////////////////////////////////////////////////////
$('img#channelWCA').mouseenter(function(x) {   
   $(this).attr("src","images/btn_ch_WCAHover.jpg"); 	
});

$('img#channelWCA').mouseleave(function(x) {   
   $(this).attr("src",$(this).attr("hoversrc")); 
 
});

//Hover for HG///////////////////////////////////////////////////////////
$('img#channelHG').mouseenter(function(x) {   
   $(this).attr("src","images/btn_ch_healthgramHover.jpg"); 	
});

$('img#channelHG').mouseleave(function(x) {   
   $(this).attr("src",$(this).attr("hoversrc")); 	
});

//Hover for PPC///////////////////////////////////////////////////////////
$('img#channelPPC').mouseenter(function(x) {   
   $(this).attr("src","images/btn_ch_primaryHover.jpg"); 	
});

$('img#channelPPC').mouseleave(function(x) {   
   $(this).attr("src",$(this).attr("hoversrc")); 	
});


//CHECKS TO SEE IF THE EMAIL SPECIFIED ALREADY EXISTS IN THE SYSTEM!////////////////////////////////////////////


	

});	//end doc ready/////////////////////////////////////////////////////////////////////////////////////





function setChannel(x) {
		//alert(x)
		var proxy = new myProxy();
		proxy.setCallbackHandler(callbackHandler);
		//proxy.setErrorHandler(errorHandler);
		//proxy.setForm('myform');
		proxy.setChannel(x);
		//alert(x)
} 

function callbackHandler(res) {
	
	//alert(res)
	$(document).ready(function() {	
							   
	window.location.href='index.cfm'
							  



});}



//Timer code to do the flipping of slides!/////////////////////////////////////////////////////////////////////

var c=1;
var t;
var timer_is_on=0;

function timedCount(x)
{
	
	if (typeof(x)!="undefined"){
		
		c=x	
		
	}
	//workaround for numbers like 21 and such showing up?
	if (c>3){
		
		c=1
		
	}
	
	
//this is where the action goes!////////////////////////////////////////////////////////////////////
		//hide all slides
		$(".slide").hide()					
		//create the id for the slide to show.
		var SlideToShow = '#'+ currentChannel + (c)
		//fade the slide in
		$(SlideToShow).fadeIn(2000);
		//create variable for box to highlight
		var boxToHighlight = '.currentSlide[id=' + (c) + ']' + "'";
		//change all boxes to grey
		$('.currentSlide').css('background-color', '#999');
		//highlight the corresponding box
		$(boxToHighlight).css('background-color', '#369');
		
//END this is where the action goes!////////////////////////////////////////////////////////////////////

//alert(c)
if (c<3){
	
		c=c+1;
}
else{
		c=1
}
t=setTimeout("timedCount()",7500);
}

function doTimer(x)
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount(x);
  }
}


//
//function stopCount()
//{
//clearTimeout(t);
//timer_is_on=0;
//}
//



function changeSlide(x)
{
	
	clearTimeout(t);
	timer_is_on=0;
	timedCount(x)

}


$(document).ready(function() {doTimer()});



