﻿/****************************************************************
*	Another Excellent product of								*
*	  ___     __  __        _ _         ___						*
*	 / __|___|  \/  |___ __| (_)__ _   / __|_ _ ___ _  _ _ __	*
*	| (__/ _ \ |\/| / -_) _` | / _` | | (_ | '_/ _ \ || | '_ \	*
*	 \___\___/_|  |_\___\__,_|_\__,_|  \___|_| \___/\_,_| .__/	*
*														|_|		*
*										Interactive Productions	*
*	Web:http://www.comediagoup.com								*
*	Email:contact@comediagroup.com								*
****************************************************************/

function moveForward(){
	if(currentStage<numStages){
		if(checkFields())
			moveToStage(currentStage+1);
		return true;
	}
	document.resume.submit();
	
	return false;
}

function moveBackward(){
	if(currentStage>=2){
		moveToStage(currentStage-1);
		return true;
	}
	return false;	
}

function moveToStage(stageNum){
	if(stageNum!=1 && !checkFields()){
		return;
	}

	if(stageNum==1){
		getObj(document, "back_button").innerHTML="<input class=\"butt_decor\" type=\"button\" name=\"back\" value=\"הקודם\" onClick=\"javascript:document.location='index.php?id=28&show_basket=true';\" style=\"font-size:10;\">";
	}else{
		getObj(document, "back_button").innerHTML="<input class=\"butt_decor\" type=\"button\" name=\"back\" value=\"הקודם\" onClick=\"return moveBackward();\" style=\"font-size:10;\">";	
	}

	if(currentStage==numStages){
		document.resume.forward.value="המשך";
	}

	if(stageNum==numStages){
		document.resume.forward.value="צפה בקורות חיים";
		getObj(document, "send_it").innerHTML="<input class=\"butt_decor\" type=\"button\" name=\"back\" value=\"שלח קורות חיים\" onClick=\"return sendResume();\" style=\"font-size:10;\">";
	}



	getStage(currentStage).style.position="absolute";
	getStage(currentStage).style.z_index="-1";
	changeValue('stage_'+currentStage, "hidden");	

	currentStage=stageNum;
	

	getStage(currentStage).style.position="";
	getStage(currentStage).style.z_index="1";
	changeValue('stage_'+currentStage, "visible");
}

function getStage(num){
	return getObj(document, 'stage_'+num);
}
