

//2006-6-9代良举,总价计算函数
var reg=document.register;
function total1(){//计算注册费用
	var f1,f2,f3,f4,f5
	var startDate=new Date(); 
    var endDate= new Date("2007/9/2 00:00:00"); 
    var df=endDate.getTime()-startDate.getTime(); 
	if (df>0)
	{f1=300;
	f2=250;
	f3=250;
	f4=200;
	f5=200;}
	else
	{f1=350;
	f2=300;
	f3=300;
	f4=250;
	f5=250;}
	
	if(reg.FullParticipant_Person.length!=0 )	
	{reg.FullParticipant_USDxPerson.value=(parseInt(reg.FullParticipant_Person.value))*f1;	}
	
	if(reg.Student_Person.length!=0 )	
	{reg.Student_USDxPerson.value=(parseInt(reg.Student_Person.value))*f2;	}
	
	if(reg.Exhibitor_Person.length!=0 )
	{reg.Exhibitor_USDxPerson.value=(parseInt(reg.Exhibitor_Person.value))*f3;	}
	
	if(reg.Accompanying_Person.length!=0 )	
	{reg.Accompanying_USDxPerson.value=(parseInt(reg.Accompanying_Person.value))*f4;}
	
	if(reg.Accompanying_Person.length!=0 )	
	{reg.ODP2.value=(parseInt(reg.ODP.value))*f5;}
	
	reg.Subtotal1.value=parseInt(reg.FullParticipant_USDxPerson.value)+parseInt(reg.Student_USDxPerson.value)+parseInt(reg.Exhibitor_USDxPerson.value)+parseInt(reg.Accompanying_USDxPerson.value)+parseInt(reg.ODP2.value);
alltotalnum();
}	

function total2(){		//计算住宿费用
	if(reg.CrownePlaza_person.length!=0 && reg.CrownePlaza_Room.length!=0 && reg.CrownePlaza_Night.length!=0)
	{reg.CrownePlaza_total.value=(parseInt(reg.CrownePlaza_person.value))*250*(parseInt(reg.CrownePlaza_Room.value))*(parseInt(reg.CrownePlaza_Night.value));}
	
	if(reg.BeijingContinental_person.length!=0 && reg.BeijingContinental_Room.length!=0 && reg.BeijingContinental_Night.length!=0)
	{	reg.BeijingContinental_total.value=(parseInt(reg.BeijingContinental_person.value))*240*(parseInt(reg.BeijingContinental_Room.value))*(parseInt(reg.BeijingContinental_Night.value));}
	
	if(reg.CrownePlaza_Room.length!=0 && reg.BeijingContinental_Room.length!=0 )
	{reg.totalRoom.value=(parseInt(reg.CrownePlaza_Room.value))+(parseInt(reg.BeijingContinental_Room.value));}
	
	if(reg.CrownePlaza_total.length!=0 && reg.BeijingContinental_total.length!=0 )
	{reg.Subtotal2.value=(parseInt(reg.CrownePlaza_total.value))+(parseInt(reg.BeijingContinental_total.value));}
	
	if(reg.CrownePlaza_Night.length!=0 && reg.BeijingContinental_Night.length!=0 )
	{reg.TotalNight.value=(parseInt(reg.CrownePlaza_Night.value))+(parseInt(reg.BeijingContinental_Night.value));}
	alltotalnum();
}
function total3(){	//计算本地旅游费用
/*
	40 LOCALTOURS_01_persons
	35 LOCALTOURS_02_persons
	30 LOCALTOURS_03_persons
	50 LOCALTOURS_04_persons
	50 LOCALTOURS_05_persons
	
	Subtotal3*/
	//if(reg.LOCALTOURS_01_persons.length!=0 && reg.LOCALTOURS_02_persons.length!=0 && reg.LOCALTOURS_03_persons.length!=0 && reg.LOCALTOURS_04_persons.length!=0 && reg.LOCALTOURS_05_persons.length!=0 )
	{reg.Subtotal3.value=parseInt(reg.LOCALTOURS_01_persons.value)*48+parseInt(reg.LOCALTOURS_02_persons.value)*48+parseInt(reg.LOCALTOURS_03_persons.value)*47+parseInt(reg.LOCALTOURS_04_persons.value)*50;}
	alltotalnum();	
}

function total4(){	//POST or PRIOR CONGRESS TOURS费用
/* CONGRESSTOURS_01_persons 1480 880 730 640 Subtotal4*/
	{reg.Subtotal4.value=parseInt(reg.CONGRESSTOURS_01_persons.value)*391+parseInt(reg.CONGRESSTOURS_02_persons.value)*407;}
	alltotalnum();	
}
function total5(){	//AIRPORT TRANSFER INFORMATION FORM

	reg.p1.value=parseInt(reg.AIRPORT_Pickup.value)*40
	reg.Subtotal5.value=parseInt(reg.p1.value)+parseInt(reg.p2.value)+0;
	alltotalnum();	
}
function total6(){	//AIRPORT TRANSFER INFORMATION FORM
	//alert(subtotal5num);
	reg.p2.value=parseInt(reg.AIRPORT_Dropoff.value)*90
	reg.Subtotal5.value=parseInt(reg.p1.value)+parseInt(reg.p2.value)+0;
	alltotalnum();	
}

function alltotalnum(){//计算总费用+4%手续费
	var sum=0;
	if(reg.Subtotal1.length!=0 ){sum+=parseInt(reg.Subtotal1.value)};
	if(reg.Subtotal2.length!=0 ){sum+=parseInt(reg.Subtotal2.value)};
	if(reg.Subtotal5.length!=0 ){sum+=parseInt(reg.Subtotal5.value)};
	reg.TotalAmount0.value=sum;
	reg.TotalAmount1.value=(sum*0.04).toFixed(2);
	reg.TotalAmount.value=(sum*1.04).toFixed(2);
	reg.PAYMENT_transferredUSD.value=(sum*1.04).toFixed(2);
	reg.amount.value=(sum*1.04).toFixed(2);
}
