$(document).ready(function(){
	// add listselect to the lang drop-downs
	$(".listselect").listselect();
	try {
		$(".flags").msDropDown();
	} catch(e) {
		alert("Error: "+e.message);
	}
	//$("#source_lang").msDropDown();

	// set the first step to be the active one.
	$("#quicktranslate #progress li:first").addClass("step-active");

});


function setHardCopy(){
	
	if (	$('#hardcopy').val() == 'yes'){
		$('#postalform').show();
	}
	else {
		$('#postalform').hide();
	}
	
}

function setDetails(step){
	highlightSelectedStep(step);

	$('#step1').show('slow');
	$('#step2,#step3,#step4,#step5').hide('slow');
}

function setAccount(step){

	
	if (!$('#source_lang').val().length) {
    	alert('Please select a source language');     
    	 return false;
    }
	
	highlightSelectedStep(step);
	
   

	$('#step2').show('slow');
	$('#step1,#step3,#step4,#step5').hide('slow');

	
}

function validateStepOne(){

	 if ($('#emailaddress').val().length < 1){
	 		/* 	alert('Email Address is a Required '); */
				 	return false;
	}
	 if ($('#fullname').val().length < 1){
	/*  	alert('Full Name Address is a Required '); */
				 	return false;
	}
	
	return true;
}

function setProducts(step){
	highlightSelectedStep(step);

	$('#step3').show('slow');
	$('#step1,#step2,#step4,#step5').hide('slow');
}

function setPayment(step){
	highlightSelectedStep(step);

	$('#step4').show('slow');
	$('#step1,#step2,#step3,#step5').hide('slow');
}

function setGo(step){
	highlightSelectedStep(step);

	$('#step5').show('slow');
	$('#step1,#step2,#step3,#step4').hide('slow');
}

function highlightSelectedStep(step){
	$("#quicktranslate #progress li").removeClass();
	$("#quicktranslate #progress li#" + step).addClass("step-active")
}

