if(DATE_FORMAT =="") DATE_FORMAT = 'MMM dd,yyyy';
if(DATE_STANDAR_FORMAT =="") DATE_STANDAR_FORMAT = 'M/d/y';

var NEW_CHAR ="\"";
var TARGET_REXP = /_/gi;

var today_	= formatDate(new Date(), DATE_STANDAR_FORMAT);

function showRooms(value, top){	
	value	= eval(value);
							
	//showRChildAges(value, top);
																								
	for(i=value; i >0; i--){		
		changeVisibility(true, 'R'+i);								
		changeVisibility((document.HotelSrch['ckdr'+i].value >0), 'ageSel'+i);
	}
							
	for(j=(value +1); j <= top; j++){
		changeVisibility(false, 'R'+j);
		changeVisibility(false, 'ageSel'+j);
	}
							
	showAgesOfChildsPanel(top);
}
						
function showAgesOfChildsPanel(rooms){
	var show_panel = false;
							
	for(i=1; i <= rooms; i++)								
		show_panel	= show_panel	|| (document.getElementById('ageSel'+i).style.display != 'none');
								
	changeVisibility(show_panel, 'ageFrame');
}
						
function showRChildAges(room){							
	value	= eval(room);
	//var letter	= document.HotelSrch['letters'].value.split(",")[value -1];
							
	var	room_str	= new String(room);
							
	var childs	= document.HotelSrch['ckdr' + room];
							
	for(i=eval(childs.value); i >0; i--)								
		changeVisibility(true, 'ages_' + room +i);
							
	for(j=(eval(childs.value) +1); j <= childs.length; j++)
		changeVisibility(false, 'ages_' + room +j);
							
	changeVisibility((childs.value >0), 'ageSel'+ value);
							
	showAgesOfChildsPanel(document.HotelSrch['.crom'].length);
}

function Hide(id){
	changeVisibility(false, id);
}
	
function Show(id){
	changeVisibility(true, id);
}

function f(id){
	var d = document.getElementById(id);
		
	d.style.display = (d.style.display == "none")?"block":"none";
}

function f1(){
	var d = document.getElementById(".T3").style.display;
		
	document.getElementById(".T3").style.display = (d == "none")?"block":"none";
	
	//changeContent('.t2', (d == 'none')?'Hide the rest...':'Show the rest...', 'text');
}

function f2(val){
	var d = val.split("|");
	
	if((d.length != null) || (d.length == 1)){
		changeVisibility((d[1] == 2), '.cg2')
	}
}

function showMyPrices(tclass, age, count){
	var bindex	= document.getElementById(tclass + '_bindex');
	
	if(bindex != null && bindex.getAttribute('value') != ""){
		for(i=1; i <= count; i++)			
			changeVisibility(false, tclass + bindex.getAttribute('value') + '_' + i);		
	}
	
	bindex.setAttribute('value', age);

	for(i=1; i <= count; i++)
		changeVisibility(true, tclass + age + '_' + i);	
}

function validate(f, result_page){
	f.action = result_page;
	f.submit();
	
	return true;
}

function touch_period(f){
	var oneHour = 1000 * 60 * 60;
	var oneDay = oneHour * 24;	
		
	if(!isNaN(Date.parse(f['.fdep'].value)) && !isNaN(Date.parse(f['.fret'].value))){		
		f['.pd'].options.length =0;
			
		chi =new Date(f['.fdep'].value);
		cho =new Date(f['.fret'].value);

		for(i=1,j=Math.round((cho -chi)/oneDay); i<= j; i++)
			f['.pd'].options[i -1] =new Option(i, i);
				
		f['.pd'].selectedIndex =0;
	}		
}
	
function check_dep_date(f, warning){
	if(f['.rt'][1].checked)
		if(emptyField(f['.fdep'].value)){
			alert(warning.replace(TARGET_REXP, NEW_CHAR));
				
			f['.rt'][0].checked =true;
			f['.rt'][1].checked =false;
				
			changeVisibility(false, '.rettr');
		}else changeVisibility(true, '.rettr');
}

function touch_subtotal(f, sufix_, sindex, tctotal){
	var itotal	=0;
	var s, c;
	var exp_ =(f['price_exp']!=null)?f['price_exp'].value:PRICE_SHT_EXP;

	for(tc=0; tc <=tctotal; tc++)
		if((f['rd_' +sufix_ +sindex][tc] !=null) && f['rd_' +sufix_ +sindex][tc].checked)
			changeContent('td_' +sufix_ +sindex, exp_.replace("[x]", get_float_numb(real_round(eval(f['rd_' +sufix_ +sindex][tc].value), 2)), 'text'));
}

function touch_price_pos(f, sufix, ppos){
   ccoords =f['pcoords_' +sufix].value;
   cparts  = ppos.split('.');	
	
   parts = ccoords.split(';');
   if((ccoords.lastIndexOf('.' +cparts[1]) !=-1) && (parts.length !=null)){	
   	ccoords ='';
		
   	for(j=0; j<parts.length; j++)
   		if(parts[j].lastIndexOf('.' +cparts[1]) ==-1){
   			if(ccoords !='') ccoords +=';';
	
   			ccoords +=parts[j];
   		}
   }	
	
   if(ccoords !='') ccoords +=';';	
   ccoords +=ppos;

   f['pcoords_' +sufix].value =ccoords;
   
   //alert(f['pcoords_' +sufix].value);
}

function srch_validate(f, result_page){
	if((f['chk4n_'][1].checked) && emptyField(f['.n'].value)){
		alert(f['err_n'].value.replace(TARGET_REXP, NEW_CHAR));
				 
		return false;
	}
	
	if((f['chk4p_'][1].checked) && (emptyField(f['.lp'].value) || emptyField(f['.up'].value) || isNaN(f['.lp'].value) || isNaN(f['.up'].value) || (eval(f['.lp'].value) >eval(f['.up'].value)))){
		alert(f['err_p'].value.replace(TARGET_REXP, NEW_CHAR));
				 
		return false;
	}
	
	var ft_ = getFval(f, '.ft', 'r');
	
	var location_;
	
//	alert('srch_validate(f, result_page) -->> ft_=' +ft_);
	
	if(ft_ =='1')
		location_ = getFval(f, 'dpv', 'r') +"|" +getFval(f, 'dlc', 'r') +"|" +getFval(f, 'apv', 'r') +"|" +getFval(f, 'alc', 'r')
	else if(ft_ =='2')
		location_ = getFval(f, 'dwr', 'r') +"|" +getFval(f, 'dct', 'r') +"|" +getFval(f, 'dic', 'r') +"|" +getFval(f, 'apv', 'r') +"|" +getFval(f, 'alc', 'r')
	else
		location_ = getFval(f, 'awr', 'r') +"|" +getFval(f, 'act', 'r') +"|" +getFval(f, 'aic', 'r') +"|" +getFval(f, 'dpv', 'r') +"|" +getFval(f, 'dlc', 'r')

//	alert('srch_validate(f, result_page) -->> location_=' +location_);
	
	if(location_.indexOf('-1.') >=0) result_page = f.altResultPage.value;
	
	if(result_page !=''){
		f.action = result_page;
		f.submit();
	}

	return true;
}

function shopping_validate(f, url){
   if(emptyField(f['name'].value)){
    alert(f['err_name'].value.replace(TARGET_REXP, NEW_CHAR));
		 
    return false;
   }	

   if((f['email'] !=null) && emptyField(f['email'].value)){
	 alert(f['err_email'].value.replace(TARGET_REXP, NEW_CHAR));
		 
	 return false;
	}	
	
   if(emptyField(f['.fdep'].value)){
    alert(f['err_.fdep'].value.replace(TARGET_REXP, NEW_CHAR));
		 
    return false;
   }
   
   if(DATE_FORMAT =="") DATE_FORMAT = 'MMM dd,yyyy';
   
   if((f['.tc'].options.length >0) && (f['.tc'].selectedIndex ==0)){
    alert(f['err_.tc'].value.replace(TARGET_REXP, NEW_CHAR));
		 
    return false;
   }   

   if((f['homecity'] !=null) && emptyField(f['homecity'].value)){
	alert(f['err_.homecity'].value.replace(TARGET_REXP, NEW_CHAR));
		 
    return false;   
   }
   
   var tc_		= getFval(f, '.tc', 's');
   var grn_tc_	= f['.grn.tc'].value;

   var dep_		=formatDate(new Date(f['.fdep_standar'].value), DATE_FORMAT);
   var grn_dep_	=formatDate(new Date(f['.grn.fdep'].value), DATE_FORMAT);
   
   var grn_ = ((f['.grn.fadlts'].value!=getFval(f, '.fadlts', 's')) || (f['.grn.finfs'].value!=getFval(f, '.finfs', 's')) || (f['.grn.fchs'].value!=getFval(f, '.fchs', 's')) || (tc_!=grn_tc_) || (dep_!=grn_dep_));

   if(f['.fret'] !=null){
	var ret_		=formatDate(new Date(f['.fret_standar'].value), DATE_FORMAT);		
	var grn_ret_	=formatDate(new Date(f['.grn.fret'].value), DATE_FORMAT);	
   
    grn_ = grn_ || (ret_!=grn_ret_);
   }
   
   if(!grn_)
	goTo(f, url);
   else
   	alert(f['err_.grn'].value.replace(TARGET_REXP, NEW_CHAR));
}

function touch_dest(f, lb_, id_){
/*
	changeContent(sufix_ +'locn_', lb_, 'text'); 
	changeValue('.' +sufix_ +'ln_', name_); 
	changeValue('.' +sufix_ +'lno_','');

	if(f['..' +sufix_ +'id'] !=null){
		if(f['..' +sufix_ +'id'].value !='') changeVisibility(false, '.' +sufix_ +'_' +f['..' +sufix_ +'id'].value);
			
		f['..' +sufix_ +'id'].value =id_;
		changeVisibility(true, '.' +sufix_ +'_' +id_);			
	}
		
	f['.' +sufix_ +'t'].value =type_;
*/
}

function touch_mychilds(f, fsufix_, findex_, conten_field){
	var	ch_count, ch_fname;
	
//	alert("touch_mychilds ..> f['" +fsufix_ +findex_ +"'].value=" +f[fsufix_ +findex_].value);
	
	var parts	= f[fsufix_ +findex_].value.split(';'); // ch_field_name;total;count
	
	ch_fname	=parts[0];
	ch_total	=eval(parts[1]);
	ch_count	=eval(parts[2]);
	
//	alert('touch_mychilds ..> ch_fname=' +ch_fname +', ch_total=' +ch_total +', ch_count=' +ch_count);
	
	if(ch_fname != 0){
		if((f[conten_field] !=null) && (f[conten_field].value !='')){
			myindex_ = f[conten_field].value;
			
//			alert('touch_mychilds ..> ' +myindex_ +'==(' +fsufix_ +'+' +findex_ +')');
			if(myindex_ ==(fsufix_ +findex_))
				checkFormRdinGrpIntvField(f, ch_fname, false, ch_total, ch_count)
				//checkFormRdinGrpField(f, ch_fname, -1, ch_count)
			else
				rec_touch_mychilds(f, myindex_);
			
			changeGrpVisibility(false, myindex_, ch_count);
		}
		
		checkFormRdinGrpField(f, ch_fname, -1, ch_count);		
	}
	
	changeGrpVisibility(true, fsufix_ +findex_, ch_count);

	f[conten_field].value = fsufix_ +findex_;
}

function rec_touch_mychilds(f, fname_){
	var	ch_total, ch_count, ch_fname;
	var j;

//	alert('rec_touch_mychilds ..> f[' +fname_ +'].value=');

	if(f[fname_] !=null){
		var parts	= f[fname_].value.split(';'); // ch_field_name;count
	
		ch_fname	=parts[0];	
		ch_total	=eval(parts[1]);
		ch_count	=eval(parts[2]);
		
//		alert('rec_touch_mychilds ..> ch_fname=' +ch_fname +', ch_total=' +ch_total +', ch_count=' +ch_count);
		
		if(ch_count != 0){			
			for(j=0;j <=ch_count; j++){
//				alert('rec_touch_mychilds ..> ' +fname_ +j);
				
				if(f[fname_ +j] !=null) rec_touch_mychilds(f, fname_ +j);
			}

//			alert('rec_touch_mychilds ..> //////');
			
			if(ch_total ==1){
				f[ch_fname].checked = false;
				
//				alert('rec_touch_mychilds ..> ' +ch_fname);
			}else{
//				alert('rec_touch_mychilds ..> ' +ch_fname +' ' +ch_total +', ' +ch_count);
				
				checkFormRdinGrpIntvField(f, ch_fname, false, ch_total, ch_count);
			}
			
			changeGrpVisibility(false, fname_, ch_count);		
		}
	}	
}

function touch_ft(f, val){
	changeGrpVisibility(false, 'td_', 5);
	
	changeContent('deplb', '', 'html');
	f['depart'].value	=	"";
	
	changeContent('arrlb', '', 'html');
	f['depart'].value	=	"";
	
	if(f['.dwr'].value !=""){
		rec_touch_mychilds(f, f['.dwr'].value);
		
		checkFormRdinGrpField(f, 'dwr', -1, (f['dwr'].length == null)?0:f['dwr'].length);
	}
	
	if(f['.dpv'].value !=""){
		rec_touch_mychilds(f, f['.dpv'].value);
		
		checkFormRdinGrpField(f, 'dpv', -1, (f['dpv'].length == null)?0:f['dpv'].length)
	}
	
	if(f['.awr'].value !=""){
		rec_touch_mychilds(f, f['.awr'].value);
		
		checkFormRdinGrpField(f, 'awr', -1, (f['awr'].length == null)?0:f['awr'].length);
		
		setEnableFormRdinGrpIntvField(f, 'awr', false, 0, (f['awr'].length == null)?0:f['awr'].length);
	}
	
	if(f['.apv'].value !=""){
		rec_touch_mychilds(f, f['.apv'].value);
		
		checkFormRdinGrpField(f, 'apv', -1, (f['apv'].length == null)?1:f['apv'].length)
		
		setEnableFormRdinGrpIntvField(f, 'apv', false, 0, (f['awr'].length == null)?0:f['awr'].length);
	}
												
	if(val == 1){
		changeVisibility(true, 'td_0');
		changeVisibility(true, 'td_3');
	}else if(val == 2){
		changeVisibility(true, 'td_2');
		changeVisibility(true, 'td_4');								
	 }else{
		changeVisibility(true, 'td_1');
		changeVisibility(true, 'td_5');								 
	  }
}

function touch_caption(f, labelid_, content_fname, lb, iname){
	lb	= lb.replace('[x]', '<B>' +iname +'</B>');
	
	changeContent(labelid_, lb, 'html');
	
	if(f[content_fname] !=null) f[content_fname].value = iname;
}

// Iframe functions
		
function ifr_touch_ft(f, val){
	changeGrpVisibility(false, 'td_', 5);

	f['.ldep'].selectedIndex = 0;
	f['.larr'].selectedIndex = 0;

	f['.idep'].selectedIndex = 0;
	f['.iarr'].selectedIndex = 0;
			
	changeContent('dep_caption', '', 'html');
	changeContent('arr_caption', '', 'html');
								
	if(val == 1){
		changeVisibility(true, 'td_0');
		changeVisibility(true, 'td_3');
	}else if(val == 2){
		changeVisibility(true, 'td_2');
		changeVisibility(true, 'td_4');
	 }else{
		changeVisibility(true, 'td_1');
		changeVisibility(true, 'td_5');
	  }
}
		
function ifr_touch_caption(f, capid_, val){
	var parts_		= "";
	var category_	= '';		
			
	if(val.lastIndexOf('wr_') ==0){
		parts_ = val.replace('wr_', '').split('.');
				
		val			= parts_[1];
		category_   = 'wr_caption';
				
	}else if(val.lastIndexOf('ct_') ==0){
		parts_ = val.replace('ct_', '').split('.');

		val			= parts_[2];
		category_   = 'ct_caption';
				
	}else if(val.lastIndexOf('ic_') ==0){
		parts_ = val.replace('ic_', '').split('.');

		val			= parts_[3];
		category_   = 'lc_caption';
				
	}else if(val.lastIndexOf('pv_') ==0){
		parts_ = val.replace('pv_', '').split('.');

		val			= parts_[1];
		category_   = 'pv_caption';
				
	}else if(val.lastIndexOf('lc_') ==0){
		parts_ = val.replace('lc_', '').split('.');

		val			= parts_[2];
		category_   = 'lc_caption';
	};
			
	var lb_		= (category_ == '')?'':f[category_].value.replace('[x]', '<B>' +val +'</B>');
			
	changeContent(capid_, lb_, 'html');
	/**/
}

function validate_travelinfo(f){
	var onehour		= 1000 * 60 * 60;
	var oneday		= onehour * 24;
	
	if(emptyField(f['.fdep'].value) && emptyField(f['.fret'].value)){
		alert(f['err_.fdep'].value.replace(TARGET_REXP, NEW_CHAR));
					
		return false;
	}else{
		var chi_ = today_;
		var cho_ = today_;
		
		var must_submit = true;
		
		if(!emptyField(f['.fdep'].value)){
			if((isNaN(Date.parse(f['.fdep_standar'].value))) || (Math.floor(Date.parse(f['.fdep_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday))){
				alert(f['err_.fdep'].value.replace(TARGET_REXP, NEW_CHAR));
					
				return false;
			}		
			
			if(!emptyField(f['.fret_standar'].value) && (isNaN(Date.parse(f['.fret_standar'].value))) && ((Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday)) || (Math.floor(Date.parse(f['.fret_standar'].value)/oneday) >Math.floor(Date.parse(f['.fdep_standar'].value)/oneday)))){
				f['.fret'].value = formatDate(new Date(Date.parse(f['.fdep_standar'].value) +oneday), DATE_FORMAT);
				f['.fret_standar'].value = formatDate(new Date(Date.parse(f['.fdep_standar'].value) +oneday), DATE_STANDAR_FORMAT);
				
				must_submit = false;
			}
		}
		
		if(!emptyField(f['.fret'].value)){
			must_submit	= !emptyField(f['.fdep'].value);
			
			if(emptyField(f['.fdep'].value)) f['.fdep'].value = formatDate(today_, DATE_FORMAT);
			
			if((isNaN(Date.parse(f['.fret_standar'].value))) || ((Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday)) || (Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(f['.fdep_standar'].value)/oneday)))){
				alert(f['err_.fret'].value.replace(TARGET_REXP, NEW_CHAR));
					
				return false;
			}
			
			if(!emptyField(f['.fdep'].value) && (isNaN(Date.parse(f['.fdep_standar'].value))) && ((Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday)) || (Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(f['.fdep_standar'].value)/oneday)))){
				f['.fdep'].value = formatDate(new Date(today), DATE_FORMAT);
				f['.fdep_standar'].value = formatDate(new Date(today), DATE_STANDAR_FORMAT);
				
				must_submit = false;
			}			
		}
	}

	if(f['.a'] != null)
		f['.a'].value = "/s";
		
	return must_submit;
}

function touch_myarrives(f, arrsufix, arrives){
//	alert('touch_myarrives ..> ' +arrives);
//	alert('touch_myarrives ..> f[' +arrsufix +'_arrives].value=' +f[arrsufix +'_arrives'].value);
	
	var arr_	= arrives.split('][');
	var tarr_	= f[arrsufix +'_arrives'].value.split('][');
	var ident_	= "";
	var target_ = -1;
		
	if(tarr_.length ==null)
		alert('just one')
	else
		tarr_[0]	= tarr_[0].replace('[', '');
		tarr_[tarr_.length -1]	= tarr_[tarr_.length -1].replace(']', '');
			
		for(j=0; j<tarr_.length; j++){				
			parts = tarr_[j].split('.');
				
//			alert('touch_myarrives ..> ' +arrsufix +'_rd' +parts[0] +', ' +arrsufix +parts[0] +'.n_0 =' +!disabled_ +',' +arrsufix +parts[0] +'.n_1 =' +disabled_);
				
			ident_	= parts[0];
			disabled_ = ((arrives !="-") && (arrives.indexOf("[" +ident_) ==-1));
				
//			alert('touch_myarrives ..> disabled ' +arrsufix +'_rd' +ident_ +'=' +disabled_);
				
			changeEnable(disabled_, arrsufix +'_rd' +parts[0]);
			changeVisibility(!disabled_, arrsufix +'n' +parts[0] +'_0');
			changeVisibility(disabled_, arrsufix +'n' +parts[0] +'_1');
				
			if(!disabled_ && (target_==-1)) target_ = parts[0];				
				
			for(j_=1; j_<(parts.length -1); j_++){
				ident_		= ident_ +'.' +parts[j_];
				disabled_	= ((arrives !="-") && (arrives.indexOf("[" +ident_) ==-1));
					
//				alert('touch_myarrives ..> disabled ' +arrsufix +'_rd' +ident_ +'=' +disabled_);
					
				changeEnable(disabled_, arrsufix +'_rd' +ident_);
				changeVisibility(!disabled_, arrsufix +'n' +ident_ +'_0');
				changeVisibility(disabled_, arrsufix +'n' +ident_ +'_1');				
			}

//			alert('touch_myarrives ..> ' +arrsufix +'_rd' +tarr_[j] +', ' +arrsufix +tarr_[j] +'.n_0, ' +arrsufix +tarr_[j] +'.n_1');
				
			disabled_ = ((arrives !="-") && (arrives.indexOf("[" +tarr_[j] +"]") ==-1));
//			alert('touch_myarrives ..> disabled ' +arrsufix +'_rd' +tarr_[j] +'=' +disabled_);
				
			changeEnable(disabled_, arrsufix +'_rd' +tarr_[j]);
			changeVisibility(!disabled_, arrsufix +'n' +tarr_[j] +'_0');
			changeVisibility(disabled_, arrsufix +'n' +tarr_[j] +'_1');
		}
//		alert(arrives);
//		alert(f[arrsufix +'_arrives'].value);
}

function ifr_srch_validate(f){
	var ft_	= getFval(f, '.ft', 's');
	var dep_val, arr_val;
							
	if(ft_ == 1){
		dep_val	= getFval(f, '.ldep', 's');
		arr_val	= getFval(f, '.larr', 's');
	}else if(ft_ == 2){
		dep_val	= getFval(f, '.idep', 's');
		arr_val	= getFval(f, '.larr', 's');
	 }else{
		dep_val	= getFval(f, '.ldep', 's');
		arr_val	= getFval(f, '.iarr', 's');
	  }			  			
			
	if(dep_val == '-'){
		alert(f['err_departure'].value.replace(TARGET_REXP, NEW_CHAR));
			 
		return false;
	}
			
	if(arr_val == '-'){
		alert(f['err_destination'].value.replace(TARGET_REXP, NEW_CHAR));
			 
		return false;
	}
		
	if(!emptyField(f['.fdep'].value) || !emptyField(f['.fret'].value)){
		var onehour		= 1000 * 60 * 60;
		var oneday		= onehour * 24;
	
		var must_submit = true;

		if(!emptyField(f['.fdep'].value)){
			if((isNaN(Date.parse(f['.fdep_standar'].value))) || (Math.floor(Date.parse(f['.fdep_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday))){
				alert(f['err_.fdep'].value.replace(TARGET_REXP, NEW_CHAR));
					
				return false;
			}		
			
			if(!emptyField(f['.fret'].value) && (isNaN(Date.parse(f['.fret_standar'].value))) && ((Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday)) || (Math.floor(Date.parse(f['.fret_standar'].value)/oneday) >Math.floor(Date.parse(f['.fdep_standar'].value)/oneday)))){
				f['.fret'].value = formatDate(new Date(Date.parse(f['.fdep_standar'].value) +oneday), DATE_FORMAT);
				f['.fret_standar'].value = formatDate(new Date(Date.parse(f['.fdep_standar'].value) +oneday), DATE_STANDAR_FORMAT);

				must_submit = false;
			}
		}
		
		if(f['.rt'][1].checked && !emptyField(f['.fret'].value)){
			must_submit	= !emptyField(f['.fdep'].value);

			if(emptyField(f['.fdep'].value)){
				f['.fdep'].value = formatDate(today_, DATE_FORMAT);
				f['.fdep_standar'].value = formatDate(today_, DATE_STANDAR_FORMAT);
			}
			
			if((isNaN(Date.parse(f['.fret_standar'].value))) || ((Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(today_)/oneday)) || (Math.floor(Date.parse(f['.fret_standar'].value)/oneday) <Math.floor(Date.parse(f['.fdep_standar'].value)/oneday)))){
				alert(f['err_.fret'].value.replace(TARGET_REXP, NEW_CHAR));
					
				return false;
			}
		}
	}
		
	f.submit();
			
	return must_submit;
}

function npattern_validate(f, result_page){
	if(emptyField(f['.n0'].value)){
		alert(f['err_n0'].value.replace(TARGET_REXP, NEW_CHAR));
				 
		return false;
	}
	
	if(result_page !=''){
		f['.flag'].value = "/p";
		
		f.action = result_page;
		f.submit();
	}
	
	return true;
}
