// JavaScript Docs
//<script type="text/javascript" language="javascript">
/* 
function BrowserInfo()
{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
}
*/

//==========================================================================
function closeArea(what) {
	var areaObj = document.getElementById("con"+what).style;
	areaObj.display = "none";
}

function openArea(what) {
	var areaObj = document.getElementById("con"+what).style;
	areaObj.display = "block";
}
//==========================================================================
//this checks for browser type, currently arent using. 
function PrintCorrectCSS(folder)
{
	if (navigator.appName == "Netscape") {
		document.write('<link href="'+folder+'_common/running_Netscape.css" rel="stylesheet" type="text/css">');
	} else {
		document.write('<link href="'+folder+'_common/running.css" rel="stylesheet" type="text/css">');
	}
}



// newWindow function care of Rick Ucker, thanks dude
function newWindow(url, height, width) {
	nameW='feature' 
	if (navigator.appVersion.indexOf('4') != -1) {
		// Vars for centering the new window on Version 4 Browsers
		xTop = screen.width/2 - (width/2);
		yTop = screen.height/2 - (height/2) - 50;
		window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=' + xTop + ',top=' + yTop + '');
	} else {
		window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
 	}
}

//New Window for the adding route section.
function RouteWindow(){
var RouteWindow = window.open("RoutePopUp.asp", "", "width=500, height=300, top=200")
}
//New Window for adding shoe section.
function ShoeWindow(){
var ShoeWindow = window.open("ShoePopUp.asp", "", "width=500, height=300, top=200")
}
// quick pole validation
function validatepole(frm) {
	return true;
}
// registration validation
function validateregistration(frm) {
	return true;
}
function interval(){

	if (document.logentry.lstRunTypes.selectedIndex==(document.logentry.lstRunTypes.length - 2)) {
	 document.logentry.advancedinterval.value="Advanced Interval Log"
	 document.logentry.advancedinterval.disabled = false
	}
	else if (document.logentry.lstRunTypes.selectedIndex==(document.logentry.lstRunTypes.length - 1)){
	 document.logentry.advancedinterval.value="Cross Training Notes"
	 document.logentry.advancedinterval.disabled = false
	}
	else{
	 document.logentry.advancedinterval.disabled= true
	 document.logentry.advancedinterval.value="----"
	}
}


/*function interval(){
    var number = (document.logentry.runtype.length - 1)
	
	alert("you selected " + (number))
	
	if (document.logentry.runtype.selectedIndex==document.logentry.runtype.items.count-1) {
	 document.logentry.advancedinterval.value="Advanced Interval Log"
	 document.logentry.advancedinterval.disabled = false
	 
	}
	else{
	 document.logentry.advancedinterval.disabled= true
	 document.logentry.advancedinterval.value="----"
	 
	}
}
*/
function getIntervalCrosstrainWindow(){
	if (document.logentry.lstRunTypes.selectedIndex==(document.logentry.lstRunTypes.length - 2)) {
	var IntervalWindow = window.location("createworkout.asp")
	}
	else if (document.logentry.lstRunTypes.selectedIndex==(document.logentry.lstRunTypes.length - 1)){
	var CrosstrainWindow = window.open("CrosstrainingPopUp.asp", "", "width=500, height=200, top=300")
	}
	else
	{return true}
}
function toggleLayer( whichLayer )
{  
var elem, vis;  
if( document.getElementById ) // this is the way the standards work    
elem = document.getElementById( whichLayer );  
else if( document.all ) 
// this is the way old msie versions work      
elem = document.all[whichLayer];  else if( document.layers ) 
// this is the way nn4 works    
elem = document.layers[whichLayer];  
vis = elem.style;  
// if the style.display value is blank we try to figure it out here  
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}