// JavaScript Document

if (document.images) {
	
	var IMAGES_ROOT = 'http://www.episleads.com/images/nav/';
		nav_img1_over= new Image(104,19);
		nav_img1_over.src=IMAGES_ROOT+"Profile-1-on.gif";  
		
		nav_img1_off= new Image(104,19);
		nav_img1_off.src=IMAGES_ROOT+"Profile-1-off.gif";
		
		nav_img2_over= new Image(104,19);
		nav_img2_over.src=IMAGES_ROOT+"Profile-2-on.gif";  
		
		nav_img2_off= new Image(104,19);
		nav_img2_off.src=IMAGES_ROOT+"Profile-2-off.gif";
	
}

function NavOver(imgName) {
	if (document.images) {
		imgOn=eval(imgName + "_over.src");
		document[imgName].src= imgOn;
	} 
}

function NavOff(imgName) {
	if (document.images) {
		imgOff=eval(imgName + "_off.src");
		document[imgName].src= imgOff;
	}
}



function confirmSubmit() 
{
var agree=confirm("Are you sure you'd like to delete this item?");
if (agree)
	return true ;
else
	return false ;
}



// SECONDARY NAVIGATION SHOW/HIDE
function showtab(headername, tabname) {
	// hide every element with class 'tab' 
	var headers = getElementsByClass('secondary_header_a');
	for(i=0; i<headers.length; i++)
		headers[i].style.color='#163A76';
	// hide every element with class 'tab'		
 
	document.getElementById(headername).style.color='#FAAA00';
	// show element with given tabname
	
	
	var tabs = getElementsByClass('tab');
	for(k=0; k<tabs.length; k++)
		tabs[k].style.display = 'none';
	// hide every element with class 'tab'		
 
	document.getElementById(tabname).style.display='block';
	// show element with given tabname
}


// FIND ELEMENT BY CLASS
function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}



// STYLIZE FORM
function changeStyle(id) {
	id.style.borderColor='#999999';
	id.style.background='#FFFFFF';
}

function removeStyle(id) {
	id.style.borderColor='#163A76';
	id.style.background='#F2F2F2';
}


// COOKIE FUNCTIONS
// set cookie

// get cookie
function getCookie(c_name) {
	if (document.cookie.length>0) {
		  c_start=document.cookie.indexOf(c_name + "=");
		  if (c_start!=-1) { 
				c_start=c_start + c_name.length+1; 
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
					return unescape(document.cookie.substring(c_start,c_end));
		  } 
	 }
	return "";
}

// check cookie
function checkCookie() {
	var intro_video=getCookie('intro_video');
	if (intro_video == 'yes') {
		document.getElementById('intro_video').style.display='none';
		document.getElementById('news_holder').style.display='block';
	} else {
		document.getElementById('intro_video').style.display='block';
		document.getElementById('news_holder').style.display='none';
			//alert('no cookie');
		/*username=prompt('Please enter your name:',"");
		if (username!=null && username!="") {
			setCookie('username',username,365);
		} */
	}
}

function newVideo() {
	document.getElementById('intro_video').innerHTML = "<script type=\"text/javascript\">AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','426','height','320','src','flash/intro_video','quality','high','wmode','transparent', 'play_movie', 'yes', 'pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/intro_video' ); //end AC code</script><noscript><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"426\" height=\"320\"><param name=\"movie\" value=\"flash/intro_video.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><embed src=\"flash/intro_video.swf\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"426\" height=\"320\"></embed></object></noscript>";
}
