function example(){
	window.open("example.html", "", "width=500,height=310, scrollbars=yes,resizable,screenX=100,screenY=100");
}
//
ok1 = false;
ok2 = false;
ok3 = false;
function cancel(){
	window.location.href = '../index.php';
}
//
function validar2(){
	var f2 = document.miembros2;
	if(!f2.user.value || !f2.pass.value){
			alert("Both fields are required");
			return;
		}
		f2.submit();
}
//
function openT(){
	window.open('terms.html', '', 'width=550, height=650, screenX=200, screenY=100, resizable, scrollbars=yes');
}
//*******************************************registration form ************************************
var read = false;
var choose = false;
var fillForm = false;
var chPlan = "";
//
//--------------------------------------------------------------confirm process
function step1(p){
	chPlan = p;
	if(!choose){
		document.getElementById('step1').style.color = '#009900';
		document.getElementById('step1').innerHTML = "step 1 completed!";
		choose = true;
		ok1 = true;
		chPlan = p;
	}else{
		return
	};	
}
//
function step2(){
	if(!read){
		document.getElementById('step2').style.color = '#009900';
		document.getElementById('step2').innerHTML = "step 2 completed!";
		read = true;
		ok2 = true;
	}else{
		return
	};
}
//
function step3(){
	if(!fillForm){
		document.getElementById('step3').style.color = '#009900';
		document.getElementById('step3').innerHTML = "step 3 completed!, click 'Pay Now'";
		fillForm = true;
		ok3 = true;
	}else{
		return
	};
}
//-------------------------------------------------validate registration form----------------
function fields(){
	var r = document.registration;
	for(i=0;i<r.length;i++){
		if(r[i].type == "text" || r[i].type == "password"){
			if(!r[i].value){
				return;
			};
		}
	};
	step3();
}
function validate(){
	var r = document.registration;
	var rg_mail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var rg_pass = /^\w{6,10}$/;
	var m = r._mail.value;
	var p = r._pass.value;
	var p2 = r._pass2.value;
	//
	for(i=0;i<r.length;i++){
		if(r[i].type == "text" || r[i].type == "password"){
			if(!r[i].value){
				r[i].focus();
				alert('all fields are required');
				return;
			};
		}
		
	};
	if (rg_mail.test(m)){
		
	} else {
		alert("Mail address appears to be invalid");
		r._mail.focus();
		return;
	};
	if(rg_pass.test(p)){
		
	}else{
		alert("Your password must contain 6 to 10 alphanumeric characters only");
		return;
	};
	if(p !== p2){
		alert("Password missmatch");
		r._pass2.focus();
		return;
	}
	//
	if(ok1 && ok2 && ok3){
		r.plans.value = chPlan;
		//alert("la clave unica es: <? print $_SESSION['uniq']?>");
		r.submit();
	}else{
		alert("You must complete the 3 steps");
	}
}