
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function addContent() { 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -	
	if($('inputPlanName').value=='') {
		alert('Please input Plan Name'); 
		accordion.showThisHideOpen(0);//newItineraryForm
		//$('inputPlanName').focus();
		return false;
	}
	if($('inputUserName').value=='' && $('inputPassword').value=='') {
		if($('inputName').value=='') {
			alert('Please input Name'); 
			accordion.showThisHideOpen(0);
			return false;
		}
		if($('inputEmail').value=='') {
			alert('Please input E-mail'); 
			accordion.showThisHideOpen(0);
			//$('inputEmail').focus();
			return false;
		}
		if(!isEmail($('inputEmail').value)){ 
			alert('Email incorect Please input again!'); 
			accordion.showThisHideOpen(0);
			return false;
		}
	} else {
		if($('inputUserName').value=='' || $('inputPassword').value=='') {
			alert('Please input UserName and Password'); 
			accordion.showThisHideOpen(0);
			return false;
		}
	}
	if($('inputKeyCode').value=='') {
		alert('Please input KeyCode'); 
		accordion.showThisHideOpen(0);
		//$('inputKeyCode').focus();
		return false;
	}

	if($('selectByRegion1').checked){
		if($('inputSelectProvince').value=='') {
			alert('Please select Province'); 
			accordion.showThisHideOpen(1);
			return false;
		}
	}else if($('selectByRegion2').checked){
		if($('selectPopular').value=='') {
			alert('Please select Popular Destination'); 
			accordion.showThisHideOpen(1);
			return false;
		}
	}

	 if(($('selectMin').value*1)>($('selectMax').value*1)){
		alert('Please select Maximun budget again!');
		accordion.showThisHideOpen(4);
		return false;
	 }

	var countChecked = 0;
	for(i=1;i<=$('inputMaxAttraction').value;i++) {
		if($('checkAttractionID'+i).checked) {
			countChecked++;
		}
	}
	if(countChecked<4) {
		alert('Please select your interest at least 4'); 
		accordion.showThisHideOpen(5);
		return false;
	}
	document.newItineraryForm.submit();
}

//alert('Captcha incorect Please input again!');

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function mod_ajax_loadProvince(JS_RegionID) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		var fileName = 'index-content.php?JS_Action=loadProvince&JS_RegionID='+JS_RegionID;
		new ajax(fileName , { method: 'get', update: 'area_province'}).request();
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function CheckEndDate(number,day,month,year) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		$('area_enddate').innerHTML = 'Calculating..';
		var fileName = 'index-content.php?JS_Action=chkenddate&JS_Number='+number+'&JS_Day='+day+'&JS_Month='+month+'&JS_Year='+year;
		new ajax(fileName , { method: 'get', update: 'area_enddate'}).request();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function ChangCurrency(Currency) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		$('MinBudget').innerHTML = 'Loading..';
		$('MaxBudget').innerHTML = 'Loading..';
		var fileName = 'index-content.php?JS_Action=MinBudget&JS_Currency='+Currency;
		new ajax(fileName , { method: 'get', update: 'MinBudget'}).request();
		
		var fileName = 'index-content.php?JS_Action=MaxBudget&JS_Currency='+Currency;
		new ajax(fileName , { method: 'get', update: 'MaxBudget'}).request();

}

