
var vzijia_id='';

var vzijia_date='';
function showViewdetail(tbs101_seq){
        
	window.open("http://www.shanghaitour.net/source/views/index.jsp?tbs101_seq="+tbs101_seq,"","");
	}

	function showfujia(free_chanpinID,n,t_name){
		if(n.indexOf('10元')!=-1){
		window.open("factor_info2.jsp?free_chanpinID="+free_chanpinID ,"","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
	   }
	   if(n.indexOf('20元')!=-1){
		window.open("factor_info2.jsp?free_chanpinID="+free_chanpinID ,"","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
	}
	if(t_name.indexOf('感受象山秋季美景')!=-1){
		if(n.indexOf('优惠包双人份')!=-1){
			window.open("index2.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠包单人份')!=-1){
			window.open("index3.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('感受泰式风情')!=-1){
		if(n.indexOf('优惠组合套餐(标准双人间)')!=-1){
			window.open("danren.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(普通单人间)')!=-1){
			window.open("suanren.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(标准间)')!=-1){
			window.open("biaozhun.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(标准房)')!=-1){
			window.open("paoshan2.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}

	}
	if(t_name.indexOf('天宁宝塔开光大典')!=-1){
		if(n.indexOf('优惠组合套餐')!=-1){
			window.open("index1.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}

	if(t_name.indexOf('象山海鲜美食')!=-1){
		if(n.indexOf('优惠包双人份')!=-1){
			window.open("index2.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠包单人份')!=-1){
			window.open("index3.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('感受象山美景')!=-1){
		if(n.indexOf('优惠包双人份')!=-1){
			window.open("index2.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠包单人份')!=-1){
			window.open("index3.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('美兰湖')!=-1){
		if(n.indexOf('高尔夫度假双人套餐')!=-1){
			window.open("index4.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(n.indexOf('指南')!=-1){
			   editfm.action="factor_info.jsp";
		       editfm.target="_blank";
		       editfm.submit();
	}
	if(t_name.indexOf('溱湖国家湿地公园')!=-1){
		if(n.indexOf('打包价')!=-1){
			   editfm.action="zhuyi.htm";
		       editfm.target="_blank";
		       editfm.submit();
		}
	}
	if(t_name.indexOf('天宁宝塔开光大典')!=-1){
		if(n.indexOf('常州天宁宝塔')!=-1){
			window.open("tianning.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('唐风露天温泉')!=-1){
		if(n.indexOf('优惠组合套餐(A套)')!=-1){
			window.open("zijiaka.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(B套)')!=-1){
			window.open("zizhu.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(C套)')!=-1){
			window.open("caoji.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('感受象山美景')!=-1){
		if(n.indexOf('散客度假优惠套餐')!=-1){
			window.open("sanke.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('特色金华')!=-1){
		if(n.indexOf('夏日优惠组合套餐')!=-1){
			window.open("youhui.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('感受行云野鹤')!=-1){
		if(n.indexOf('散客度假优惠套餐')!=-1){
			window.open("xingyun.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('感受太湖源风情')!=-1){
		if(n.indexOf('A套')!=-1){
			window.open("liana.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('B套')!=-1){
			window.open("lianb.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('C套')!=-1){
			window.open("lianc.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('九咆界游山玩水')!=-1){
		if(n.indexOf('家庭组合套餐')!=-1){
			window.open("jiating.html","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('赏清凉南山竹海')!=-1){
		if(n.indexOf('活动售价')!=-1){
			window.open("tongyi.html","","height=280,width=630,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('导航费用')!=-1){
			window.open("daohang.html","","height=100,width=630,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('浪漫风情豪华酒店')!=-1){
		if(n.indexOf('暑期优惠套餐')!=-1){
			window.open("shuqi.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('田园风光青草湖')!=-1){
		if(n.indexOf('超值优惠套餐')!=-1){
			window.open("tianyuan.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('泡汤山颐尚温泉')!=-1){
		if(n.indexOf('统一打包价')!=-1){
			window.open("paoshan.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('儿童票价')!=-1){
			window.open("childshan.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		if(n.indexOf('优惠组合套餐(标准间)')!=-1){
			window.open("paoshan2.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
	}
	if(t_name.indexOf('赏桐庐三大风景')!=-1){
		if(n.indexOf('超级组合套餐')!=-1){
			window.open("tonghu.htm","","height=514,width=514,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=yes,location=no");	
		}
		
	}
	}


function delzijia(zijia_id){
	     
 
		var url="AjaxAction/delzijia.jsp";
		  pars="zijia_id="+zijia_id;
	 var myAjax = new Ajax.Request(url,{method:"get",parameters:pars,onComplete:Returndelzijia});
}
function Returndelzijia(request){
       window.location.href="http://www.shanghaitour.net/shoppingcart/index.jsp";
           
}

 function movezijianum(sumprice,newnum,onenum){
 
	var changesum=Number(stripWhitespace(document.all.formorder.elements[newnum].value));
 
	var newprice= parseFloat(parseFloat(stripWhitespace(onenum))*changesum);
	 
    document.all.formorder.elements[sumprice].value=parseFloat(newprice) ;
	movezijiaallnum();
    return true;
  }
function movezijiaallnum(){
 var count=0.00;
	var hotelpricesize=Number(stripWhitespace(document.all.formorder.elements["hotelpricesize"].value));
    var scapepricesize=Number(stripWhitespace(document.all.formorder.elements["scapepricesize"].value));
	var factorpricesize=Number(stripWhitespace(document.all.formorder.elements["factorpricesize"].value));
	 
	 for(var h=1;h<=hotelpricesize;h++){
	   count+=parseFloat(stripWhitespace(document.all.formorder.elements["hotelsumprice"+h].value));
	 }
	 for(var s=1;s<=scapepricesize;s++){
	   count+=parseFloat(stripWhitespace(document.all.formorder.elements["scapesumprice"+s].value));
	 }
	for(var f=1;f<=factorpricesize;f++){
	   count+=parseFloat(stripWhitespace(document.all.formorder.elements["fujiasumprice"+f].value));
	 }

    document.all.formorder.elements["totalprice"].value=parseFloat(count) ;
    return true;
  }

  function updatezijia(zijia_id,zijia_date){
        vzijia_id=zijia_id;
	    vzijia_date=zijia_date;
		var url="AjaxAction/updatezijia.jsp";
		pars="zijia_id="+zijia_id;
		pars+="&hotelpricesize="+document.all.formorder.elements["hotelpricesize"].value;
		pars+="&scapepricesize="+document.all.formorder.elements["scapepricesize"].value;
		pars+="&factorpricesize="+document.all.formorder.elements["factorpricesize"].value;
		pars+="&totalprice="+document.all.formorder.elements["totalprice"].value;
		var hsize=Number(stripWhitespace(document.all.formorder.elements["hotelpricesize"].value));
		var ssize=Number(stripWhitespace(document.all.formorder.elements["scapepricesize"].value));
		var fsize=Number(stripWhitespace(document.all.formorder.elements["factorpricesize"].value))
  for(var h=1;h<=fsize;h++){
		 if(isNaN(stripWhitespace(document.all.formorder.elements["factortnum"+h].value))||document.all.formorder.elements["factortnum"+h].value=="")
	  {
		  alert("请输入正确的数字");
	      return;
	  }else{
	   pars+="&fujiasumprice"+h+"="+stripWhitespace(document.all.formorder.elements["fujiasumprice"+h].value);
	   pars+="&factortnum"+h+"="+stripWhitespace(document.all.formorder.elements["factortnum"+h].value);
	  }
  }
  for(var s=1;s<=ssize;s++){
	   if(isNaN(stripWhitespace(document.all.formorder.elements["scapetnum"+s].value))||document.all.formorder.elements["scapetnum"+s].value=="")
	  {
		  alert("请输入正确的数字");
	      return;
	  }else{
	  pars+="&scapesumprice"+s+"="+stripWhitespace(document.all.formorder.elements["scapesumprice"+s].value);
	  pars+="&scapetnum"+s+"="+stripWhitespace(document.all.formorder.elements["scapetnum"+s].value);
	  }
  }
  for(var f=1;f<=hsize;f++){
	  	   if(isNaN(stripWhitespace(document.all.formorder.elements["roomnum"+f].value))||document.all.formorder.elements["roomnum"+f].value=="")
	  {
		  alert("请输入正确的数字");
	      return;
	  }else{
	  pars+="&hotelsumprice"+f+"="+stripWhitespace(document.all.formorder.elements["hotelsumprice"+f].value);
	  pars+="&roomnum"+f+"="+stripWhitespace(document.all.formorder.elements["roomnum"+f].value);
	  }
  }
		
    var myAjax = new Ajax.Request(url,{method:"get",parameters:pars,onComplete:Returnupdatezijia});
}


function Returnupdatezijia(request){
//	var returnText=request.responseText;
//		var itemOrder=$("change");
//		itemOrder.innerHTML=returnText;
	    // nTabszijia('zijia',vzijia_id,vzijia_date);
		  window.location.href="http://www.shanghaitour.net/shoppingcart/index.jsp";
}

function rebackzijia(id){
  window.location.href="http://www.shanghaitour.net/zijiayou/tripdetail.jsp?tbs121_seq="+id;
}