function next_page(page_idx) {

	//alert(page_idx);
	var whichEl = document.forms[0];


	if(page_idx==1.1) {		
		if(whichEl.ruser[0].checked) {
			forma.action = 'register_o2.php';
		} else {
			forma.action = 'register_select_profile.php';
		}
		forma.submit();		
	} else if(page_idx==1.2) {
		if(forma.ruser.value=="olduser") {
			forma.action = 'register_o3.php';
		} else {
			forma.action = 'register_s4.php';
		}
		forma.submit();
	} else if(page_idx==1) {
		if(whichEl.ruser[0].checked) {
			//window.location = 'register_o2.php';
			forma.action = 'register_o2.php';
		} else {
			//window.location = 'register_s4.php';
			forma.action = 'register_s4.php';
		}
		forma.submit();
	} else if(page_idx==2) {
		window.location = 'register_s3.php';
	} else if(page_idx=="o2") {
		window.location = 'register_o3.php';
	} else if(page_idx==3) {
		form1.submit();
		//window.location = 'register_s4.php';
	} else if(page_idx==4) {
		window.location = 'register_s5.php';
	}

}

function prev_page(page_idx) {

	if(page_idx==1.1) {
		forma.action = 'register_select_profile.php';
		forma.submit();
	}else if(page_idx==2) {
		window.location = 'register.php';
	} else if(page_idx=="o3") {
		//window.location = 'register_o2.php';		
		forma.action = 'register_select_profile.php';
		forma.submit();		
	} else if(page_idx==3) {
		window.location = 'register_s2.php';
	} else if(page_idx==4) {
		window.location = 'register.php';
	}

}

function toUpper(whichEl) {

	// String to Upper Case on Key Up
	whichEl.value = whichEl.value.toUpperCase();

	// Focus Serial Suffix Box when Serial Prefix Done
	if(whichEl.name=="serial_prefix" && whichEl.value.length==4) {
		document.forms[0].serial_suffix.focus();
	}

}
function backmain(){
	if (forma.back_url.value==""){
		window.location = '/index.php';
	}else{
		window.location = forma.back_url.value;
	}
}
