function submitEmail() {
	useremail = document.getElementById('emailinput').value;
	userphone = document.getElementById('phone1').value + "-" + document.getElementById('phone2').value + "-" + document.getElementById('phone3').value;
	userzip = document.getElementById('zip').value;
	if (useremail == "") {
		$('#emailError').html('Please enter your email address.');
	} else {
		$.get("submitemail.php", { email: useremail, phone: userphone, zip: userzip },
			function(data){
    			//alert("Data Loaded: " + data);
				if (data == '1') { 
					$('#emailSuccess').show();
					$('#emailError').html('');
				}
				else { $('#emailError').html('There was an error with your submission'); }
			});
	}
}

/* Check if Enter is pressed */
function keyup(arg1) { 
	if (arg1 == 13) submit_msg(); 
}

var SITE_PREFIX = "";
var IMAGES_NAV_DIR = "images/nav/";

var navImgOff = new Array();
var navImgOver = new Array();
if (document.images) {
	//var navList = new Array('umphcom', 'umphreaks', 'umlive');
	var navList = new Array('umphcom', 'umphreaks', 'umlive', 'thefloor');
    for (var i=0; i<navList.length; i++) {
        navImgOff[navList[i]] = new Image();
        navImgOff[navList[i]].src = SITE_PREFIX+IMAGES_NAV_DIR+navList[i]+'-off.gif';
        navImgOver[navList[i]] = new Image();
        navImgOver[navList[i]].src = SITE_PREFIX+IMAGES_NAV_DIR+navList[i]+'-on.gif';
    }
}

// mouseover image functions
function navOff(navName) {
    if (navName && navName.length && document.images) {
		//document.getElementById('navName').style.zIndex += 3;
		document[navName].src = navImgOff[navName].src;
    }
}

function navOver(navName) {
    if (navName && navName.length && document.images) {
		//alert(document.getElementById(navName).style.zIndex);
	    for (var i=0; i<navList.length; i++) { document.getElementById(navList[i]).style.zIndex = 10; }
		document.getElementById(navName).style.zIndex = 20;
		document[navName].src = navImgOver[navName].src;
    }
}

function displayWidget() {
	var content = '<center><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="330" height="400" title="Umphrey\'s McGee"><param name="movie" value="http://www.umphreys.com/swf-bin/widget/um.swf" /><param name="quality" value="high" /><embed src="http://www.umphreys.com/swf-bin/widget/um.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="330" height="400"></embed></object>';
	content += '<br/><br/><a href="#" onclick="tb_remove();return false;"><img src="images/lightboxclose.gif" width="355" height="20" alt="CLOSE" /></a></center>';
	document.getElementById('widgetBox').innerHTML = content;
}



/****************************************************************
 * Most Simple Ajax Chat Script (www.linuxuser.at)		*
 * Version: 3.1							*
 * 								*
 * Author: Chris (chris[at]linuxuser.at)			*
 * Contributors: Derek, BlueScreenJunky (http://forums.linuxuser.at/viewtopic.php?f=6&t=17)
 *								*
 * Licence: GPLv2						*
 ****************************************************************/
 
/* Settings you might want to define */
	var waittime=4000;

/* Internal Variables & Stuff */
	//chatScroll.focus()
	//document.getElementById("chatScroll").innerHTML = "loading...";

	var xmlhttp = false;
	var xmlhttp2 = false;

/* Request for Reading the Chat Content */
function ajax_read(url) {
	if(window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
		if(xmlhttp.overrideMimeType){
			xmlhttp.overrideMimeType('text/xml');
		}
	} else if(window.ActiveXObject){
		try{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e){
			}
		}
	}

	if(!xmlhttp) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}

	xmlhttp.onreadystatechange = function() {
	if (xmlhttp.readyState==4) {
		document.getElementById("chatScroll").innerHTML = xmlhttp.responseText;
		$('#chatScroll').jScrollPane({dragMaxHeight:18,scrollbarWidth:7});
		document.getElementById("chatScroll").scrollTo(document.getElementById("chatScroll").scrollHeight);

		zeit = new Date(); 
		ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds(); 
		intUpdate = setTimeout("ajax_read('chat.txt?x=" + ms + "')", waittime)
		}
	}

	xmlhttp.open('GET',url,true);
	xmlhttp.send(null);
}

/* Request for Writing the Message */
function ajax_write(url){
	if(window.XMLHttpRequest){
		xmlhttp2=new XMLHttpRequest();
		if(xmlhttp2.overrideMimeType){
			xmlhttp2.overrideMimeType('text/xml');
		}
	} else if(window.ActiveXObject){
		try{
			xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try{
				xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e){
			}
		}
	}

	if(!xmlhttp2) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}

	xmlhttp2.open('GET',url,true);
	xmlhttp2.send(null);
}

/* Submit the Message */
/*function submit_msg(){
	nick = document.getElementById("chatnick").value;
	msg = document.getElementById("chatmsg").value;

	if (nick == "") { 
		nick = "anonymous"; 
	} 

	document.getElementById("chatmsg").value = "";
	$.get("submitchat.php",{m:msg,n:nick});
	//ajax_write("w.php?m=" + msg + "&n=" + nick);
}
*/
/* Submit the Message */
function submit_msg(){
	nick = document.getElementById("chatnick").value;
	msg = document.getElementById("chatmsg").value;

	if (nick == "") { 
		nick = "anonymous"; 
	} 

	document.getElementById("chatmsg").value = "";
	ajax_write("w.php?m=" + msg + "&n=" + nick);
}

/* Start the Requests! ;) */
//var intUpdate = setTimeout("ajax_read('chat.txt')", waittime);

