<!-- Hide script from old browsers

//Popup window functions
function popWin(type, id) {
	var newWin;
	if (type == "StarTimelineYr1") {
		var filename = "../StarSI/TimelineDetails06-07.aspx?ID=" + id;
		newWin = window.open(filename,"Presentation","width=550,height=450,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,status=no");
	}
	else if (type == "SummitAgenda07") {
		var filename = "../Summit/PresentationDetails.aspx?Type=" + type + "&ID=" + id;
		newWin = window.open(filename,"Presentation","width=500,height=440,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,status=no");
	}
	else if (type == "Audio") {
		var filename = "../MP3/mp3player.aspx?ID=" + id;
		newWin = window.open(filename,"Audio","width=315,height=125,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
	}
	else if (type == "Video") {
		var filename = "../Video/videoplayer.aspx?ID=" + id;
		newWin = window.open(filename,"Video","width=425,height=325,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
	}
	else if (type == "Videolarge") {
		var filename = "../Video/videoplayerlarge.aspx?ID=" + id;
		newWin = window.open(filename,"Video","width=450,height=375,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
	}
	else if (type == "VideoXlarge") {
		var filename = "../Video/videoplayer640.aspx?ID=" + id;
		newWin = window.open(filename,"Video","width=660,height=500,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
	}
    else if (type == "cart") {
//		var filename = "../Store/ProductDetails/" + id
		var filename = id;
		newWin = window.open(id,null,"width=550,height=450,left=0,top=10,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
    }
    else if (type == "contact") {
      	newWIn = window.open(id,null,"width=450,height=375,left=800,top=300,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
    }
    else if (type == "portal") {
      	newWin = window.open(id,null,"width=650,height=575,left=250,top=200,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,status=no");
	}
	else if (type == "default") {
      	newWin = window.open(id,null,"width=550,height=450,left=0,top=10,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
    } else {
		newWin = window.open(id,null,"width=550,height=450,left=0,top=10,toolbars=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no");
	}
    newWin.focus()
    return false;
}

//Link out to new site
function LinkOut(newSite) {
	var s="You are about to go to another Web site.\n\nYou will leave " +
	"this site, but you can return by clicking on your browser's BACK "+
	"button.\n\nAdvertising on external sites is not endorsed by CHESS.\n\n" +
	"Do you still want to leave?";
	if ( confirm(s) ) {top.location.href=newSite;}
}

//Show-Hide Function
var state = 'none';
var state2 = 'block'; 
function showhide(layer_ref, layer_ref2) { 
	if (state == 'block') { 
		state = 'none';
		state2 = 'block'; 
	} 
	else { 
		state = 'block';
		state2 = 'none'; 
	} 
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + layer_ref + ".style.display = state");
		eval( "document.all." + layer_ref2 + ".style.display = state2");
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[layer_ref].display = state;
		document.layers[layer_ref2].display = state2; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		hza.style.display = state;
		hza = document.getElementById(layer_ref2); 
		hza.style.display = state2; 
	} 
}

/*// Removes leading whitespaces
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
/*	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	if (value == ""){
		return "";
	}
	return LTrim(RTrim(value));
}*/
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function LTrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function RTrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function showhide1(id){
	if (document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block"
		try {
			document.getElementById(id + "I").src = "../Images/Icons/arrowHide_trans.gif";
		} catch(e) {}
	} else {
		document.getElementById(id).style.display = "none";
		try {
			document.getElementById(id + "I").src = "../Images/Icons/arrowShow_trans.gif";
		} catch(e) {}
	}
}
// End hiding script from old browsers -->
