// JavaScript Document

window.onresize = setDimensions;

function setDimensions() {
	wrap = document.getElementById('wrapper');
	cont = document.getElementById('content');
	
	if (typeof window.innerHeight != 'undefined') {
			// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
  			viewportheight = window.innerHeight
 		} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !=
    					 'undefined' && document.documentElement.clientWidth != 0) {
 
			// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

	       viewportwidth = document.documentElement.clientWidth,
    	   viewportheight = document.documentElement.clientHeight
 		} else  {
			// older versions of IE
 		      viewportheight = document.getElementsByTagName('body')[0].clientHeight
 	}
	
	wh = (viewportheight - 60);
	ch = wh - 65;
		
			if (wrap.style) {	
 				wrap.style.height = wh + "px";
				cont.style.height = ch + "px"
 			} else {
		 
				document.all['wrapper'].style.height= wh + "px";
				document.all['content'].style.height= ch + "px";
				
 			}
			
			
	wrap.style.display="block";
}

function showHighlight(areaId) {
	clearAllHighlights();
//alert(document.getElementById(areaId + "Over").className);
	document.getElementById(areaId + "Over").className="highlightOn";
}

function hideHighlight(areaId) {
	document.getElementById(areaId + "Over").className="highlightOff";
}

function clearAllHighlights() {
	hideHighlight('home');
	hideHighlight('lineup');
	hideHighlight('location');
	hideHighlight('tickets');
		hideHighlight('history');
		hideHighlight('media');
		hideHighlight('partners');
		hideHighlight('advertise');
		hideHighlight('contact');
}

function submitSignup() {
	fld = document.getElementById('emailSignup');
	if (!echeck(fld.value)) {
		alert('Please enter a valid email address');	
	} else {
		document.forms['emailSignupForm'].submit();	
	}
}

function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(at,(lat+1))!=-1){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(dot,(lat+2))==-1){
		//	alert("Invalid E-mail Address")
			return false
		}

		if (str.indexOf(" ")!=-1){
		//	alert("Invalid E-mail Address")
			return false
		}

		return true
	}

