function submitToTarget(f, action, target){
	var act = f.action;
	f.action = action;
	f.target=target;
	f.submit();
	f.action = act;
	f.target='';
}

function openWin(link, name, width, height){
	window.open(link, name, 'width='+width+',height='+height+',toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,screenX=50,screenY=30'); 
}
 
function openWinWithDir(link, name, width, height){
	window.open(link, name, 'width='+width+',height='+height+',toolbar=0,directories=0,menubar=1,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,screenX=50,screenY=30'); 
}

 function openPrint(order,w,h,c) { 
	var OpenW = this.open("print.php?order="+order+"&c="+c+"","view","scrollbars=yes,width="+w+",height="+h+",top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=1,resizable=yes");
	OpenW.focus();
}

function calc(b, bid, us, tarif, status){
	var b = document.b;
	var act = b.action;
	b.action = '../rezervacija/calc_page.php?bid='+bid+'&us='+us+'&tarif='+tarif+'&tarif_status='+status;
	b.target = "calc_frame";
	b.submit();
	b.action = act;
	b.target = '';
}

function calc1(b, bid){
	var b = document.b;
	var act = b.action;
	b.action = '../rezervacija/calc_page1.php?bid='+bid;
	b.target = "calc_frame1";
	b.submit();
	b.action = act;
	b.target = '';
}

function emptyUserInfoFields(){
	var f = document.f;
	var fields = new Array('firstname','lastname','city','country','address','email','phone','fax','license','license_issue_year','license_exp_year','passport','pass_country','pass_issue_year','pass_exp_year','birth_place','birth_date_year');
	for (var i=0; i<fields.length; i++){
		e = eval("document.f."+fields[i]);
		e.value = '';
	}
	f.license_issue_day.selectedIndex = 0;
	f.license_issue_mon.selectedIndex = 0;
	f.license_exp_day.selectedIndex = 0;
	f.license_exp_mon.selectedIndex = 0;
	f.pass_issue_day.selectedIndex = 0;
	f.pass_issue_mon.selectedIndex = 0;
	f.pass_exp_day.selectedIndex = 0;
	f.pass_exp_mon.selectedIndex = 0;
}
