

function blogClick(){
	window.open("http://www.socalworkout.com/wpblog" ,"_blog", "menubar=1,resizable=1,location=1,status=1,scrollbars=1,toolbar=1,width=850,height=600");
}
function changeBG(){
  var bg = document.getElementsByName("td");
      for (i = 0, j = bg.length; i < j; i++) {
    bg[ i ].onmouseover=function() {
    this.className='navhoverover';
    }
    bg[ i ].onmouseout=function() {
    this.className='navhover';
    }
  }
}
window.onload=function(){ 
changeBG();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function CallMeClick(){
	window.open("http://www.socalworkout.com/openCall.html" ,"_callme", "menubar=1,resizable=1,location=1,status=1,scrollbars=1,toolbar=1,width=320,height=280");
}

var win_array = Array();

function open_win(url, win_name, options) {
	var cur_win = win_array[win_name];
	var is_popup_defined = (typeof(cur_win) == 'object');
	var is_win_open = (is_win_defined)
		? !(cur_win.closed)
		: false;

	if ( is_win_defined && is_win_open ) {
		cur_win.document.write (' ');
		cur_win.focus();
		cur_win.location.href = url;
		cur_win.focus();
	} else if ((is_win_defined && !is_win_open) || !is_win_defined) {
		win_array[win_name] = window.open(url, win_name, options);
	}
}

function doSignup(theForm, url, options, landing_page, hover) {
	var email_reg = /[_a-zA-Z0-9.-]+@[_a-zA-Z0-9.-]+[.][_a-zA-Z0-9.-][_a-zA-Z0-9.-]+/;
	var res = email_reg.test(document.newsletter_form.category3.value);
	
	if (theForm.category2.value == '' ) {
		alert('Please enter your name!');
		theForm.category2.focus();
		return false;
	} else if (!res) {
		alert('Please enter a valid email address');
		theForm.category3.focus();
		return false;
	} else {
		
		var wSource = window;
		var wRes = window.open(url, 'win_signup', options);
		
		theForm.action = url;
		theForm.target = 'win_signup';
		
		if (landing_page != '') {
			if(hover) {
				exp = new Date();
				exp.setTime(exp.getTime()+1000*60*60*24*1);
				document.cookie = "hover=off" + "; path=/";
			}
			//if (landing_page == 'http://www.socalworkout.com') {
				//wSource.location.href = 'http://dev.socalworkout.com'; //for testing
			//} else {
				wSource.location.href = landing_page;
			//}
			return true;
			
		} else {
			wSource.document.newsletter_form.category2.value = '';
			wSource.document.newsletter_form.category3.value = '';
			if(typeof wSource.iPop_close == 'function'){iPop_close();}
			return true;
		}
		
	}
}

function doSignup2(theForm, url, options) {
	var email_reg = /[_a-zA-Z0-9.-]+@[_a-zA-Z0-9.-]+[.][_a-zA-Z0-9.-][_a-zA-Z0-9.-]+/;
	var res = email_reg.test(document.newsletter_form.category3.value);
	
	if (theForm.category2.value == '' ) {
		alert('Please enter your name!');
		theForm.category2.focus();
		return false;
	} else if (!res) {
		alert('Please enter a valid email address');
		theForm.category3.focus();
		return false;
	} else {
		
		var wSource = window;
		var wRes = window.open(url, 'win_signup', options);
		
		theForm.action = url;
		theForm.target = 'win_signup';
		
		if(typeof wSource.iPop_close == 'function'){iPop_close();}
		return true;
	}
}