function ValidateContactUs() {
	var form = document.getElementById('contact_us');
	
	if (form.nameField.value == '') {
		alert('Name cannot be blank');
		return false;
	}
	else if (form.ps_screenName.value == '') {
		alert('PS screen name cannot be blank');
		return false;
	}
	else if (form.email.value == '') {
		alert('Email cannot be blank');
		return false;
	}
	else if (email_check(form.email.value)==false) {
		return false;
	}
	else if (form.regarding.value == '') {
		alert('Select a category');
		return false;
	}
	else if (form.question.value == '') {
		alert('Type your question');
		return false;
	}
	else
		return true;
}

function validateNewPass() {
	var p1 = document.getElementById('new_password_1').value;
	var p2 = document.getElementById('new_password_2').value;
	
	if (p1 != p2) {
		alert("Both New Passwords Must Be The Same");
		return false;
	}
	
	var reg = /^\w{5,}\d+$/;
	if (reg.test(p1)) {
		return true;	
	}
	else {
		alert("Your new password must be at least 6 characters in length,\r\nincluding 1 (or more) numbers. Allowed characters are:\r\na-z, A-Z, 0-9, and _");
		return false;
	}
}

function kickOff() {
 	$.ajax({
	  url: 'ajax/kickoff.php',
	  success: function(data) {
	    if (data=="kick") {
	    	clearTimeout(psnNrBct);
	    }
	    else if (data=="ban") {
	    	window.location="banned.php";
	    }
	    else {
	    	setTimeout("kickOff();", 30000);
	    }
	  }
	});
}

function openMessenger() {
	var url = 'http://messenger.providesupport.com/messenger/bigbadbullets.html';
	window.open(url, '_blank', 'menubar=0,location=0,scrollbars=auto,resizable=1,status=0,width=600,height=550'); 
}
var checkImg = new Image();
checkImg.onload = checkImgOnload;
function checkLiveSupportStatus() {
	setTimeout("checkLiveSupportStatus()", 15000);
	checkImg.src = (location.protocol.indexOf("https")==0?"https":"http")+"://image.providesupport.com/online-presence-image/bigbadbullets?t=" + (new Date()).getTime();
}
function checkImgOnload() {
	if ($("#sitestatus")) {
		var w = checkImg.width;
		if (w == 2 && livechatserver != 'bbb') {
			$("#sitestatus").html("<a style=\"text-decoration: none;color:#ffffff;\">Currently <span style=\"color: #20d820;\">ONLINE</span></a>");
		} else {
			$("#sitestatus").html("<a style=\"text-decoration: none;color:#ffffff;\">Currently <span style=\"color: #ea3a3a;\">OFFLINE</span></a>");
		}
	}
}

function setMenuArrow() {
	var p = $("#menuItems").position();
	var offset = 0;
	var re = new RegExp('id=[a-z0-9]+');
	var m = re.exec(window.location);
	if (m != null) {
		if (m[0]=="id=1") offset+=87;
		if (m[0]=="id=pricing") offset+=177;
		if (m[0]=="id=specials") offset+=262;
		if (m[0]=="id=3") offset+=362;
	}
	$("#menuArrow").css("left", p.left + offset);
}

function init_v2() {
	//setMenuArrow(); 
	checkLiveSupportStatus();
	if ($(window).height()>$("#maincontentarea").height()) {
		$("#footer").height(208+($(window).height()-$("#maincontentarea").height()));
	}
}

