// JavaScript Document
var mConfirm = 0;
var mConfirm2 = 0;
var mSucces;
var mRemove;
//
function loader(){
	getScreenSize();
}
//
function getScreenSize(){
	if(screen.width>=800){
	e=document.getElementById('center');
	e.style.width = 816 + 'px';}
}
function setMenuStyle(menu){
	document.getElementById(menu[1]).className = 'mAState';
}
//
function validateEmail(str,el){
	if(echeck(str)){
		document.getElementById(el).style.backgroundImage='url(img/go_confirm.gif)';
		document.getElementById(el).style.borderColor='#009900';
		mConfirm = 1;
		}else{
		document.getElementById(el).style.backgroundImage='url(img/go_out.gif)';
		document.getElementById(el).style.borderColor='#CCCCCC';
		mConfirm = 0;
			}
	}
//
function validateEmail2(str,el){
	if(echeck(str)){
		document.getElementById(el).style.backgroundImage='url(img/go_confirm.gif)';
		document.getElementById(el).style.borderColor='#009900';
		mConfirm2 = 1;
		}else{
		document.getElementById(el).style.backgroundImage='url(img/go_out.gif)';
		document.getElementById(el).style.borderColor='#CCCCCC';
		mConfirm2 = 0;
			}
	}
	//
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){
	   return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}
	 if (str.indexOf(at,(lat+1))!=-1){
		return false
	 }
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	 }
	 if (str.indexOf(dot,(lat+2))==-1){
		return false
	 }
	 if (str.indexOf(" ")!=-1){
		return false
	 }
	 return true					
	}
function addMember()
	{
	var qString = '&page=<?= $_REQUEST[page] ?>'
	var options = {
	method : 'post',
	parameters : qString,
	onSuccess: succes()
	};
	new Ajax.Request('inc/addMember.php', options);
	}