function open_iframe(targ,mypath,val) {
	my_val=document.getElementById(''+val+'').value;
	alert(my_val);
eval(targ+".location='"+mypath+"&"+val+"="+my_val+"'");
}

function go_to_url(targ,from,to,dest) {
eval(targ+".location='/maps/translate.php?from="+from+"&dest="+dest+"&to="+to+"&word="+document.getElementById('t1').value+"'");
}

function go_to_url_2(targ,from,to,dest,word) {
eval(targ+".location='/maps/translate.php?from="+from+"&dest="+dest+"&to="+to+"&word="+word+"'");
}

function my_jump_menu(targ,selObj,restore,path,field){ 
  eval(targ+".location="+field+"s"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function translate_text(targ,from,to,dest,val_name,val,auto) {
eval(targ+".location='/maps/translate.php?from="+from+"&dest="+dest+"&to="+to+"&val_name="+val_name+"&val="+val+"&auto="+auto+"'");
}


function clear_text(val,def) {
if (val==def) { document.getElementById('q').value = ""; } else { }
}
function number_format(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}


function hide_reg(reg,reg_2) {
	
		showHideElement(reg, 'show')
		showHideElement(reg_2, 'hide')
}

function showHideElement(element, showHide) {

	if (document.getElementById(element)) {
	
		if (showHide == "show") { document.getElementById(element).style.display = ""; } else if (showHide == "hide") { document.getElementById(element).style.display = "none";	}

	}
	
}

function do_hide_show(element) {

	if (document.getElementById(element)) {
	
		if (document.getElementById(element).style.display == "none") { document.getElementById(element).style.display = ""; } 
		else { document.getElementById(element).style.display = "none";	}

	}
	
}


function get_radio_value()
{
	if (document.shop_package.meal_type.length) {
				for (var i=0; i < length; i++) {
				   if (document.shop_package.meal_type[i].checked) {
					  var rad_val = document.shop_package.meal_type[i].value;
					  }
				   }
		}
		else {  var rad_val = document.shop_package.meal_type.value;  }
   return rad_val; 
}

function get_radio_flight_info()
{
	if (document.login.flight_info.length) {
				for (var i=0; i < length; i++) {
				   if (document.login.flight_info[i].checked) {
					  var rad_val = document.login.flight_info[i].value;
					  }
				   }
		}
		else {  var rad_val = document.login.flight_info.value;  }
   return rad_val; 
}


function create_option(atext,avalue)
{
  var elOptNew = document.createElement('option');
  elOptNew.text = atext;
  elOptNew.value = avalue;
  var elSel = document.getElementById('childs');
  try {
    elSel.add(elOptNew, null);
  }
  catch(ex) {
    elSel.add(elOptNew);
  }
}

function set_my_date(my_date,my_month,my_year) {
	
	document.getElementById('check_in_date').value=my_date;
	document.getElementById('check_in_month').value=my_month;
	document.getElementById('check_in_year').value=my_year;
	
}

function is_empty_field(field) {
	if (document.getElementById(field).value=="") { do_field_error(field,1); } else { do_field_error(field,2);   }
}

function do_field_error(field,error) {
	if (error==1) { document.getElementById('f_'+field+'').style.color="#CC0000"; }
	if (error==2) { document.getElementById('f_'+field+'').style.color=""; }
}
function do_submit(myfields) {

	
	for( var i =0; i <myfields.length; i++) {
	
	if (document.getElementById(myfields[i]).value=="") { do_field_error(myfields[i],1); document.getElementById(myfields[i]).focus();  return (false); } else { do_field_error(myfields[i],2); }  
	
	}
	 return(true); 
}

function drop_jump_menu(targ,selObj,restore,url,id){

  eval(targ+".location='"+url+"&"+id+"="+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}


 function open_window(page,width,height){
          window.open(page,"wellness","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width="+width+",height="+height+",resizable=no,z-index:1");
        }
