﻿/*获取数组中最大数
  var k =[3,100,4,7,90],
  	  j = k.Max();//返回100
*/
Array.prototype.Max = function(){
   var i, Max = this[0];
   for (i = 1; i < this.length; i++){
	   if (Max < this[i])
	   Max = this[i];
   }
   return Max;
}

Array.prototype.Min = function(){
   var i, Min = this[0];
   for (i = 1; i < this.length; i++){
	   if (Min > this[i])
	   Min = this[i];
   }
   return Min;
}

var loadImg = Class($_$,{
	creat:function(){},
	loadImg:function(){
		var J = $("img[lang]").get(),
			_J = J.length,
			K = Math.ceil(_J/5),
			L = [],
			TT = [],
			M,N,O,A;
		for(M = 0;M<K;M++){
			if(M<K){
				N = J.slice(0,5);
				L.push(N);
				J.splice(0,5)
			}
		}
		
		for(O=0;O<K;O++){
			var B;
			for(B=0;B<L[O].length;B++){
				var P = L[O][B].lang;
				/*$.getJSON($_$.D+O_o.E+O_o.I+P+O_o.J, function(json){
					$("img[lang='"+ json.value +"']").attr("src",json.url)
				})*/

				$.getJSON("/Ajax/AjaxImgUrl.aspx?image="+P, function(json){
					$("img[lang='"+ json.value +"']").attr("src",json.url)
				})
			}
		}
	}
}),
carCkeck = Class($_$,{
	creat:function(t){
		this.t = t;
		carCkeck.o_O = this.t;
		carCkeck.people.T = function(){return $("#"+ t)};
		carCkeck.people.mT = function(){return $("#selectAll")};
		carCkeck.people.aT = function(){return $("#"+ t + " td input[disabled!=true]")};
		carCkeck.people.K = function(){return $("#"+ t + " td input[disabled!=true]").length};
		carCkeck.people.J = [];
	},
	ckeck:function(){
		carCkeck.people.mT().click(function(){
			if($(this).attr("checked") == true){
				carCkeck.clearAll(this);
			}
			if($(this).attr("checked") == false){
				carCkeck.selectAll(this);
			}			  
		})
		carCkeck.whosOn();
	},
	whosOn:function(){
		var _aT = carCkeck.people.aT();
		for(var I =0;I < _aT.length;I++){
			(function(){
				var _I = I,C;	
				_aT[_I].onclick = function(){
					C = $("#"+ carCkeck.o_O + " td").find("input[checked=true]").filter("[disabled!=true]").length;
					if(C == carCkeck.people.K()){
						carCkeck.people.mT().attr("checked",true);
					}
					if(C != carCkeck.people.K()){
						carCkeck.people.mT().attr("checked",false);
					}
					carCkeck.whoWillGo();
				}
			})()
		}
		carCkeck.whoWillGo();
	},
	selectAll:function(ps){
		carCkeck.people.aT().removeAttr("checked");
		$(ps).removeAttr("checked");
		carCkeck.whoWillGo();
		
	},
	clearAll:function(ps){
		$(ps).attr("checked","checked");
		carCkeck.people.aT().attr("checked","checked");
		$(ps).attr("checked");
		carCkeck.whoWillGo();
	},
	whoWillGo:function(){
		carCkeck.people.J = [];
		var _ID = $("#"+ carCkeck.o_O + " td").find("input[checked=true]").filter("[disabled!=true]");
		for(var A = 0;A<_ID.length;A++){
			if($(_ID[A]).attr("checked") != false){
				carCkeck.people.J.push($(_ID[A]).attr("id"));
				$("#someGood").val(carCkeck.people.J + ",");
			}
		}
		if(_ID.length==0){$("#someGood").val("");}
	},
	people:{},
	o_O:""
}),
ckeckCarInfo = Class($_$,{//Drip!
	creat:function(n,m,url,fn){
		this.n = n;
		this.m = m;
		this.url = url;
		this.fn = fn;
		ckeckCarInfo.o = {};
		ckeckCarInfo.o.ev = this.n;
		ckeckCarInfo.o.pW = ($("body").outerWidth() -960)/2;
	},
	innt:function(){
		if($("#ajaxTR").html() != ""){
			$("#" + this.m + " tr").removeAttr("class");
			$("#ajaxTR").remove();
		}
		var n = this.n,
			tag = $(n),
			url = this.url,
			fn = this.fn,
			closeBut,
			pU	= url.substring(0,url.indexOf("?")),
			dat	= url.substring(url.indexOf("?")+1,url.length),
			PP = tag.parent().parent(),
			colspanNode=PP.find('td').length,
			M = $("#" + this.m + " tr");
			
		ckeckCarInfo.creatTR(PP,colspanNode);
		PP.addClass("carOn");
		closeBut = $("#carProduct span[close='close']");
		var toClose = function(event){ckeckCarInfo.closeBox(event.data.cId,event.data.pId)},
			ContentBox = $("#carProduct");
		
		closeBut.bind("click", {cId:ContentBox,pId:PP}, toClose);
		ckeckCarInfo.getAJAX(pU,dat,ContentBox,fn);
	},
	creatTR:function(PP,colspanNode){
		var tr = new String;
		tr+="<tr id=\"ajaxTR\">";
		tr+="<td colspan=\""+colspanNode+"\" style=\"background:#eff8ff;\">";
		tr+="<div class=\"productsInfo\" style=\"display:none\" id=\"carProduct\">";
		tr+="<span close=\"close\" class=\"arrowClose\">"+ O_o.Close +"</span>";
		tr+="<p class=\"proInfoArrow\" id=\"carArr\"></p>";
		tr+="<div id=\"contentBox\"></div>";
		tr+="</div>";
		tr+="</td>";
		tr+="</tr>";
		$(tr).insertAfter(PP);
	},
	getAJAX:function(url,dat,ContentBox,fn){
		var nR =Math.ceil($(ckeckCarInfo.o.ev).offset().left - ckeckCarInfo.o.pW -15)
		$.ajax({
			type:"GET",
			url:url,
			data:dat,
			cache:false,
			async:true,
			error:function(){
				ContentBox.animate({
					opacity:"show"
				},900)
				ContentBox.html(O_o.FailMsgC);
			},
			success:function(html){
				$("#contentBox").html(html);
				$("#carArr").css({
					left:nR + "px"
				})
				ContentBox.animate({
					opacity:"show"
				},900,function(){
					eval(fn);
				})
			}
		})
	},
	closeBox:function(ContentBox,PP){
		var atr = $("#ajaxTR");
		ContentBox.animate({
			height:"toggle",
			opacity:"hide"
		},900,function(){
			PP.removeClass("carOn");
			try{
				PP = null;
				ContentBox = null;
			}finally{
				atr.remove();
				art = null;
			}
		})
	}
}),
outterClose = Class(ckeckCarInfo,{
	creat:function(again){
		var __C = $("#carProduct"),
			atr = $("#ajaxTR"),
			_PP = atr.prev();
		__C.animate({
			opacity:"hide"
		},900,function(){
			_PP.removeClass("carOn");
			try{
				__C = null;
				_PP = null;
				atr.find("*").unbind();
			}finally{
				atr.remove();
				atr = null;
			}
		})
	}
}),
searcCity = Class($_$, {
    creat: function(tO) {//基本参数
        //id,et,tagId
        this.tO = tO;
        searcCity.cityOp = tO;
        searcCity.cityOp.b = $("#" + searcCity.cityOp.id);
        searcCity.cityOp.bH = $(searcCity.cityOp.et).height();
        searcCity.cityOp.bW = $(searcCity.cityOp.et).width()
        searcCity.cityOp.bT = $(searcCity.cityOp.et).offset().top;
        searcCity.cityOp.bL = $(searcCity.cityOp.et).offset().left;
        searcCity.cityOp.cB = $("#" + searcCity.cityOp.id + " span[title]");
        searcCity.cityOp.theTag = $("#" + searcCity.cityOp.tagId);
        searcCity.cityOp.theEle = $("#" + searcCity.cityOp.id + " a");
        searcCity.cityOp.cB.click(function() {
            searcCity.hideBox(searcCity.cityOp.id, searcCity.cityOp.bT, searcCity.cityOp.bH)
        });
    },
    showCityBox: function() {
        var theLeft, fix;
        if ($("body div[citybox]").length > 0) {
            $("body div[citybox]").css("display", "none");
            $("#shadow").remove();
        }
        if (searcCity.cityOp.b.css("display") == "block") {
            searcCity.hideBox(searcCity.cityOp.id, searcCity.cityOp.bT, searcCity.cityOp.bH);
            return;
        }

        if (searcCity.cityOp.width != undefined && searcCity.cityOp.width != null) {//宽度设定
            searcCity.cityOp.b.css("width", searcCity.cityOp.width + "px")
        }

        if (searcCity.cityOp.type == "left" || searcCity.cityOp.type == undefined) {//左边打开
            theLeft = searcCity.cityOp.bL - 72;
            fix = 5;
        }
        if (searcCity.cityOp.type == "right") {//右边打开
            theLeft = searcCity.cityOp.bL - searcCity.cityOp.b.outerWidth() + searcCity.cityOp.bW;
            fix = -5;
        }

        searcCity.cityOp.b.css({//弹出层基本设置
            display: "none",
            border: "1px solid #9c9c9c",
            top: searcCity.cityOp.bT + searcCity.cityOp.bH - 5 + "px",
            left: theLeft + "px"
        })

        if ($("div:first").attr("id") != searcCity.cityOp.b.attr("id")) {
            $("body").append(searcCity.cityOp.b);
        }


        searcCity.cityOp.b.animate({//弹出层显示
            top: searcCity.cityOp.bT + searcCity.cityOp.bH - 1 + "px",
            opacity: "show"
        }, 250)

        //阴影创建于显示
        searcCity.shadow(searcCity.cityOp.id, searcCity.cityOp.bT, searcCity.cityOp.bH, theLeft, fix);

        searcCity.cityOp.theEle.click(function() {//弹出层内部元素点击事件绑定
            theV = $(this).html();
            searcCity.cityOp.theTag.val(theV);
            searcCity.hideBox(searcCity.cityOp.id, searcCity.cityOp.bT, searcCity.cityOp.bH);
        })

        searcCity.cityOp.b.attr("cityBox", "on");

        document.documentElement.onclick = function(e) {//点击页面两边空白处关闭弹出层
            //if($("#" + id).css("display") == "none"){return false;}
            var ev = e || window.event;
            var eleSrc = ev.srcElement || ev.target;
            if (eleSrc.tagName.toLowerCase() == "body" || eleSrc.tagName.toLowerCase() == "html" || eleSrc.tagName.toLowerCase() == "form") {
                searcCity.hideBox(searcCity.cityOp.id, searcCity.cityOp.bT, searcCity.cityOp.bH);
            }
        }
    },
    shadow: function(id, bT, bH, bL, fix) {//阴影创建
        var sd = document.createElement("div");
        sd.id = "shadow";
        $("body").append(sd);
        $("#shadow").css({
            display: "none",
            height: $("#" + id).outerHeight(true) + "px",
            width: $("#" + id).outerWidth(true) + "px",
            "background-color": "#000",
            opacity: "0.5",
            position: "absolute",
            "z-index": "1",
            top: bT + bH + "px"
            //left:bL - 5 + "px"
        })
        if (fix) {
            var fNum = parseInt(fix);
            $("#shadow").css("left", bL - fNum + "px")
        }
        $("#shadow").animate({
            top: bT + bH + 5 + "px",
            opacity: "show"
        })
    },
    hideBox: function(id, bT, bH) {//关闭方法
        searcCity.cityOp.b.removeAttr("cityBox");
        searcCity.cityOp.b.animate({
            top: bT + bH - 5 + "px",
            opacity: "hide"
        }, 300)
        $("#shadow").animate({
            top: bT + bH + "px",
            opacity: "hide"
        }, 300)
        $("#shadow").remove();
    },
    cityOp: {}
}),
newPop = Class($_$, {//新弹出层
    creat: function(pp, cbs) {
        this.pp = pp;
        newPop.Z = this.pp;
        newPop.x = {};
        if (cbs) {
            newPop.x.callBack = cbs;
            newPop.x.cbCtrl = 1;
        }
        newPop.dealOp();
    },
    dealOp: function() {//弹出层参数设定
        if (newPop.Z.oid != null) {
            newPop.x.tag = $("#" + newPop.Z.oid);
            newPop.x.id = newPop.Z.oid;
        }
        if (newPop.Z.bPath != "" || newPop.Z.bPath != undefined) {
            newPop.x.path = newPop.Z.bPath;
        }
        if (newPop.Z.evn != "" || newPop.Z.evn != undefined) {
            newPop.x.e = newPop.Z.evn;
        }
        newPop.x.showType = newPop.Z.set.showType;
        newPop.x.setBox = newPop.Z.set.type;
        if (newPop.Z.set.popCtrl) {
            newPop.x.popCtrl = newPop.Z.set.popCtrl;
        }
        newPop.x.bCls = newPop.Z.set.cls[0];
        newPop.x.aCls = newPop.Z.set.cls[1];
        if (newPop.Z.set.cls[2] == undefined || newPop.Z.set.cls[2] == "") {
            newPop.x.cCls = O_o.closeClass;
        } else {
            newPop.x.cCls = newPop.Z.set.cls[2];
        }
        if (newPop.Z.set.bStyle != "" || newPop.Z.bStyle != undefined) {
            newPop.x.bStyle = newPop.Z.set.bStyle;
        }
        if (!newPop.x.bStyle || newPop.x.bStyle.indexOf("width") == -1) {
            newPop.x.w = 350;
        }
        newPop.x.type = newPop.x.setBox.split("|")[0];
        newPop.x.tSet = newPop.x.setBox.split("|")[1];
        if (newPop.x.e) {
            newPop.x.bT = Math.ceil($(newPop.x.e).offset().top);
            newPop.x.bL = Math.ceil($(newPop.x.e).offset().left);
            newPop.x.eH = Math.ceil($(newPop.x.e).outerHeight());
            newPop.x.eW = Math.ceil($(newPop.x.e).outerWidth());
        }
        newPop.defOpSet();

    },
    defOpSet: function() {//公用参数设定。派生方法调用时可直接用。
        newPop.x.dW = $("body").width();
        newPop.x.dH = $(document).height();
        newPop.x.ajaxLoading = "<div id=\"newPopAjaxLoading\" style=\"position:absolute;display:none;width:31px;height:31px;\"><img src=\"/images/blueLoad.gif\" alt=\"\" /></div>";
        if (isIE) {
            newPop.x.body = "<div id=\"citsPop\"><i close=\"close\"></i><iframe name=\"a\" id=\"fixIE6\" style=\"height:0;\"></iframe></div>";
        } else {
            newPop.x.body = "<div id=\"citsPop\"><i close=\"close\"></i></div>";
        }
    },
    popReset: function() {//重置
        if (newPop.x.axBox != undefined && newPop.x.axBox.css("display") == "block") {
            newPop.x.axBox.hide();
            newPop.x.axBox.unbind();
        }
        if (_$("citsPop")) {
            $("#citsPop").remove();
        }
        if (_$("calender")) { $("#calender").remove(); }
        if ($("div[pop='pop']") && $("div").attr("id") != "citsPop") {
            $("div[pop='pop']").hide();
        }
        if (newAlert.A != undefined) {
            clearTimeout(newAlert.A.timer);
        }
    },
    inntPop: function() {//初始化

        newPop.popReset();

        document.documentElement.onclick = function(e) {
            var ev = e || window.event;
            var eleSrc = ev.srcElement || ev.target;
            if (eleSrc.tagName.toLowerCase() == "body" || eleSrc.tagName.toLowerCase() == "html" || eleSrc.tagName.toLowerCase() == "form") {
                if (newPop.Z.oid != null || newPop.x.tag != null) {
                    newPop.ppHide();
                }
            }
        }

        if (!newPop.x.tag) {//自动构建流程开始
            $("body").append(newPop.x.body);
            newPop.x.tag = $("#citsPop");
            newPop.x.tag.addClass(newPop.x.bCls);
            newPop.x.id = "citsPop";
        }

        closeBut = newPop.x.tag.find("i[close='close']");
        closeBut.addClass(newPop.x.cCls);
        closeBut.css("z-index", "1");
        closeBut.click(function() {
            newPop.ppHide();
        })

        if (newPop.x.bStyle) {
            if (newPop.x.bStyle.indexOf("height:") != -1) {
                newPop.x.tag.attr("style", newPop.x.bStyle.replace(/height:/g, "sheight:") + "display:none;"); //屏蔽外层高度设定
            } else {
                newPop.x.tag.attr("style", newPop.x.bStyle + "display:none;");
            }
        } else {
            newPop.x.tag.css("width", newPop.x.w + "px");
        }

        switch (newPop.x.showType) {
            case "arrow": //带箭头
                newPop.x.tag.attr("class", newPop.x.bCls);
                if (newPop.x.tag.find("b[arr]").length == 0) {
                    newPop.x.tag.append("<b arr=\"1\"></b");
                }
                newPop.x.arr = newPop.x.tag.find("b[arr]");
                newPop.x.arr.attr("class", newPop.x.aCls);
                newPop.setArrowBox(newPop.x.tag, newPop.x.eH, newPop.x.bT, newPop.x.bL, newPop.x.dW, newPop.x.eW);
                newPop.ppShow();
                if (!newPop.x.popCtrl) {
                    newPop.x.tag.attr("pop", "pop");
                }

                break;

            case "whiteMark": //白色遮罩
                newPop.ppShow();
                newPop.creatMark("#fff", newPop.x.dW, newPop.x.dH, 0.35);
                if (!newPop.x.popCtrl) {
                    newPop.x.tag.attr("pop", "pop");
                }
                if (newPop.x.cbCtrl == 1) {
                    newPop.x.callBack();
                }
                break;

            case "blackMark": //黑色遮罩
                newPop.ppShow();
                if (newPop.x.type != "ajax") {
                    newPop.setNalBox();
                }
                newPop.creatMark("#000", newPop.x.dW, newPop.x.dH, 0.60);
                if (!newPop.x.popCtrl) {
                    newPop.x.tag.attr("pop", "pop");
                }
                if (newPop.x.cbCtrl == 1) {
                    newPop.x.callBack();
                }
                break;

            case "noMark": //无遮罩
                newPop.ppShow();
                if (!newPop.x.popCtrl) {
                    newPop.x.tag.attr("pop", "pop");
                }
                if (newPop.x.cbCtrl == 1) {
                    newPop.x.callBack();
                }
                break;

            default:
                return false;
        }

    },
    fixIeSelectBug: function() {
        var ff = $("#fixIE6").length > 0 ? $("#fixIE6") : newPop.x.tag.find("iframe:last");
        ff.css({
            width: newPop.x.tag.outerWidth() + "px",
            height: newPop.x.tag.outerHeight() + "px",
            position: "absolute",
            top: "0",
            left: "0",
            "z-index": "-1",
            opacity: "0"
        })
    },
    ppShow: function() {//内容加载方式

        switch (newPop.x.type) {
            case "ajax": //ajax加载
                if (!newPop.x.axBox) {
                    if (!_$("newPopAjaxLoading")) {
                        $("body").append(newPop.x.ajaxLoading);
                    }
                    newPop.x.axBox = $("#newPopAjaxLoading");
                }
                newPop.showAjax();
                break;

            case "iframe": //iframe加载
                newPop.x.tag.append("<iframe src=\"" + newPop.x.path + "\" width=\"100%\" height=\"" + newPop.x.tSet + "\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");
                if (newPop.x.showType == "arrow") {
                    //newPop.shadow(newPop.x.id,parseInt(newPop.x.tag.css("top")),newPop.x.bL,0.45,5);
                } else {
                    newPop.setNalBox();
                }
                if (isIE) {
                    newPop.fixIeSelectBug();
                }
                newPop.x.tag.animate({
                    opacity: "show"
                })
                break;

            case "nal": //直接弹出

                if (newPop.x.showType == "arrow") {
                    //newPop.shadow(newPop.x.id,parseInt(newPop.x.tag.css("top")),newPop.x.bL,0.45,5);
                } else {
                    if (newPop.x.tSet == "popUp") {
                        newPop.setPopBox();
                    } else {
                        newPop.setNalBox();
                    }
                }

                if (isIE) {
					
					if(newPop.x.tag.closest("form").length == 1){
						newPop.x.tag.closest("form").append(newPop.x.tag);
					}else{
						$("body").append(newPop.x.tag);
					}
                    
                    newPop.fixIeSelectBug();
                }

                if (newPop.x.tSet == "popUp") {
                    newPop.x.tag.animate({
                        top: newPop.x.lastTop + "px",
                        opacity: "show"
                    })
                } else {
                    newPop.x.tag.animate({
                        opacity: "show"
                    })
                }


                break;

            case "txt": //文本输入
                newPop.x.tag.append("<div>" + newPop.x.tSet + "</div>");
                if (newPop.x.showType == "arrow") {
                    //newPop.shadow(newPop.x.id,parseInt(newPop.x.tag.css("top")),newPop.x.bL,0.45,5);
                } else {
                    newPop.setNalBox();
                }
                if (isIE) {
                    newPop.fixIeSelectBug();
                }
                newPop.x.tag.animate({
                    opacity: "show"
                })
                break;

            default: //默认为ajax
                newPop.showAjax();
        }
    },
    setPopBox: function() {
        newPop.x.lastTop = document.documentElement.scrollTop + 240;
        var thisT = document.documentElement.scrollTop + document.documentElement.clientHeight / 2 - newPop.x.tag.outerHeight();
        newPop.x.tag.css({
            display: "none",
            position: "absolute",
            left: "50%",
            top: thisT + "px",
            "z-index": "100",
            margin: "-" + newPop.x.tag.outerHeight() / 2 + "px 0 0 -" + newPop.x.tag.outerWidth() / 2 + "px"
        });
    },
    showAjax: function() {//ajax读取方式
        var aArr = newPop.x.path.split("?");

        newPop.x.axBox.bind("ajaxStart", function() {
            $(this).css({
                top: Math.ceil(newPop.x.bT - newPop.x.eH / 2) + "px",
                left: Math.ceil(newPop.x.bL + newPop.x.eW + 10) + "px"
            })
            $(this).show();
        }).bind("ajaxSuccess", function() {
            $(this).hide();
            newPop.x.axBox.unbind();
        })

        $.ajax({
            type: newPop.x.tSet,
            url: aArr[0],
            data: aArr[1],
            cache: false,
            error: function() {
                if (newPop.x.axBox.css("display") == "block") {
                    newPop.x.axBox.hide();
                    newPop.x.axBox.unbind();
                }
                newPop.x.tag.html(O_o.FailMsgC);
                var ot;
                ot = setTimeout(function() { newPop.ppHide() }, 2000);
            },
            success: function(html) {
                newPop.x.tag.append(html);
                if (newPop.x.showType != "arrow") {
                    newPop.setNalBox();
                }
                if (isIE) {
					
                    newPop.fixIeSelectBug();
                }

                if (newPop.x.cbCtrl == 1) {
                    newPop.x.callBack();
                }

                newPop.x.tag.animate({
                    opacity: "show"
                })
                /*if (newPop.x.showType == "arrow") {
                newPop.shadow(newPop.x.id, parseInt(newPop.x.tag.css("top")), newPop.x.tag.offset().left, 0.45, 5);
                }*/
            }
        });
    },
    ppHide: function() {//关闭方法
        newPop.x.tag.animate({
            opacity: "hide"
        }, "fast", function() {
            if (newPop.x.closeCallBack != undefined) {
                newPop.x.closeCallBack();
            }
            if (newPop.Z == undefined || newPop.Z.oid == null) {
                try {
                    newPop.x.tag.find("*").unbind();
                    newPop.x.tag.remove();
                    newPop.x.tag = null;
                } catch (e) {
                    return true;
                } finally {
                    return true;
                }

            }
            if (newPop.x.tag != null && newPop.Z == undefined) {
                newPop.x.tag.find("*").unbind();
            }

        })

        $("#shadow").animate({
            opacity: "hide"
        }, "fast", function() {
            $("#shadow").remove();
        })
        if (_$("tMark")) {
            $("#tMark").remove();
        }
    },
    creatMark: function(mColor, dW, dH, op) {//遮罩创建方法
        var mark = document.createElement("div");
        mark.id = "tMark";
        mark.innerHTML = "<iframe></iframe>";
        mark.style.display = "none";
        mark.style.backgroundColor = mColor;
        $("body").append(mark);
        $("#tMark iframe").css({
            width: dW + "px",
            height: dH + "px",
            opacity: "0"
        })
        $("#tMark").css({
            height: dH + "px",
            width: dW + "px",
            position: "absolute",
            top: "0",
            left: "0",
            "z-index": "99",
            overflow: "hidden",
            opacity: op
        });
        $("#tMark").css("display", "block");
    },
    shadow: function(id, aT, aL, op, exc) {//阴影创建方法

        var sd = document.createElement("div");
        sd.id = "shadow";
        $("body").append(sd);
        $("#shadow").css({
            display: "none",
            height: $("#" + id).outerHeight() + "px",
            width: $("#" + id).outerWidth() + "px",
            "background-color": "#000",
            opacity: op,
            position: "absolute",
            "z-index": "1",
            top: aT + "px",
            left: aL + exc + "px"
        })

        $("#shadow").animate({
            top: aT + exc + "px",
            opacity: "show"
        })
    },
    setNalBox: function() {//常规弹出层设定
        newPop.x.tag.css({
            position: "absolute",
            left: "50%",
            top: document.documentElement.scrollTop + document.documentElement.clientHeight / 2 + "px",
            "z-index": "100",
            margin: "-" + newPop.x.tag.outerHeight() / 2 + "px 0 0 -" + newPop.x.tag.outerWidth() / 2 + "px"
        });
        if (isIE) {
            newPop.fixIeSelectBug();
        }
    },
    setArrowBox: function(tag, bH, bT, bL, dW, bW) {//带箭头弹出层设定
        var bh = tag.outerHeight(),
			boxW = tag.outerWidth(),
			whiteSp = Math.ceil((dW - 960) / 2),
			sT, aT, aR, aB, aL, arrL;

        /*if(isIE && $.browser.version == 6.0){
        if(dW%2 !=0){
        $("body").width(Math.ceil(dW)-1)
        }
        }*/

        //不是位于页面底部时
        if (bL > dW / 2 && bT < $(document).height() * 0.9) {
            aT = Math.floor(bT + bH + 17);
            //aR = Math.floor(dW - bL - bW);
            aR = Math.floor(bL - boxW);
            aB = "";
            if (newPop.x.tSet == "center") {
                aL = Math.floor(bL - boxW / 2);
                if (aL + boxW >= whiteSp + 960) {
                    aL = Math.floor(bL - boxW + bW + 34);
                    arrL = Math.ceil(bL - aL + bW / 2 - 17);
                } else {
                    arrL = Math.ceil(bL - aL + bW / 2 - 17 * 2);
                }
            } else {
                aL = Math.floor(bL - boxW / 2 - bW);
                if (aL + boxW >= whiteSp + 960) {
                    aL = Math.floor(bL - boxW / 2 - (whiteSp / 2));
                }
                arrL = Math.ceil(bL - aL + bW / 2 - 17);
            }

            tag.css({
                position: "absolute",
                top: aT + "px",
                //right:aR + "px",
                "z-index": "2",
                bottom: "",
                left: aL + "px"
            });

            newPop.x.arr.css("left", arrL + "px");
        }

        if (bL < dW / 2 && bT < $(document).height() * 0.9) {
            aT = Math.floor(bT + bH + 17);
            aR = "";
            aB = "";
            if (newPop.x.tSet == "center") {
                aL = Math.floor(bL - boxW / 2);
                arrL = Math.ceil(bL - aL + bW / 2 - 17 * 2);
            } else {

                aL = Math.floor(bL - bW);
                if (aL < whiteSp) {
                    aL = whiteSp + 6;
                }

                arrL = Math.ceil(bL - aL + bW / 2 - 17);
            }


            tag.css({
                position: "absolute",
                top: aT + "px",
                right: "",
                "z-index": "2",
                bottom: "",
                left: aL + "px"
            });

            newPop.x.arr.css("left", arrL + "px");
        }

        //位置超过页面长度的80%时
        if (bL > dW / 2 && bT > $(document).height() * 0.9) {
            aT = Math.floor(bT - tag.height() - bH * 2) + 17;
            aR = Math.floor(dW - bL - bW);
            aB = "";
            aL = Math.floor(dW - boxW - aR);
            tag.css({
                position: "absolute",
                top: aT + "px",
                right: aR + "px",
                bottom: "",
                "z-index": "2",
                left: ""
            });
        }

        if (bL < dW / 2 && bT > $(document).height() * 0.9) {
            aT = Math.floor(bT - tag.height() - bH * 2);
            aR = "";
            aB = "";
            aL = Math.floor(bL);
            tag.css({
                position: "absolute",
                top: aT + "px",
                right: aR,
                bottom: aB,
                "z-index": "2",
                left: aL + "px"
            });
        }
        if (isIE && _$("fixIEs")) {

            $("#fixIEs").css({
                height: bh + "px",
                width: boxW + "px",
                display: "block",
                opacity: "0"
            })
        }


    }
}),
hider = Class(newPop,{
	creat:function(tt,cbs){
		if(tt != undefined){
			this.tt = tt;
			hider.h = this.tt;
			if(cbs){
				hider.h.callBack = cbs;
				hider.h.c = 1;
			}
		}
		
	},
	hidePop:function(){
		newPop.ppHide();
		if(hider.h != undefined && hider.h.c != undefined){
			hider.h.callBack();
		}
	}
}),
newAlert = Class(newPop,{
	creat:function(o,cb){
		this.o = o;
		newAlert.A = this.o;
		if(cb){
			newAlert.A.callBack = cb;
		}
	},
	setAL:function(){//基本参数设定
		newPop.x = {};
		newPop.Z = {};
		newPop.x.showType = "noMark";
		newPop.x.type = "nal";
		if(newAlert.A.set == undefined){
			newAlert.A.set = {type:"popUp",cls:"newPopBox",css:"width:200px;"};
		}
		if(newAlert.A.ot == undefined){
			newAlert.A.ot = 3000;
		}
		newPop.x.bCls = newAlert.A.set.cls == undefined?"newPopBox":newAlert.A.set.cls;
		newPop.x.tSet = newAlert.A.set.type == undefined?"popUp":newAlert.A.set.type;
		newPop.x.bStyle = newAlert.A.set.css == undefined?"width:200px;":newAlert.A.set.css;
		
	},
	inntAlert:function(){
		newAlert.setAL();
		newPop.defOpSet();
		newPop.inntPop();
		newPop.x.tag.append(newAlert.A.msg);
		if(newAlert.A.callBack != undefined){
			newAlert.A.callBack();
		}
		newAlert.oTime();
	},
	oTime:function(){//延迟
		newAlert.A.timer = setTimeout(function(){
			if(newPop.x.tag != null){
				newPop.ppHide();
			}
			clearTimeout(newAlert.A.timer);
		},newAlert.A.ot)
	}
}),
popDiv = Class($_$,{
	creat:function(id,w,aType,aClass,evn,url,title,frameH){
		this.id			= id;
		this.w			= w;
		this.aType		= aType;
		this.aClass		= aClass;
		this.evn		= evn;
		this.closeBut	= $("#" + id + " span[title='close']");
		this.dW			= document.body.scrollWidth;
		this.dH			= $(document).height();
		this.url		= url;
		this.title		= title;
		this.frameH		= frameH;
		//关闭弹出层的中间函数，用来传参的。
		var toClose = function(event){
			//alert(event.data.bId)
			popDiv.hideBox(event.data.bId)
		}
		this.closeBut.bind("click", {bId:this.id}, toClose);
	},
	boxCtrl:function(){
		if($("#tmpFloatBox")){$("#tmpFloatBox").remove();$("#shadow").remove();}
		if($("div[lang='popUp']")){$("div[lang='popUp']").hide()}
		var id		= this.id,
			w		= this.w,
			aType	= this.aType,
			dW		= this.dW,
			dH		= this.dH,
			evn		= this.evn;
			aClass	= this.aClass,
			url		= this.url,
			title	= this.title,
			frameH	= this.frameH;
			var aTc;
			if(url && aType != "arrow"){
				aType	= url.substring(0,url.indexOf(":"));
				aTc	= url.substring(url.indexOf(":")+1,url.length);
			}
		if(aType != "nal"){$("div[lang='popUp']").remove();}
		
		if(document.getElementById(id) == null && aType == "arrow"){
			//根据传入的type判断显示类型，如是带箭头类型则调用另外的函数处理
			var beArrow = CITS(popTypeArrow,[id,w,aClass,evn,url,frameH]);
			beArrow.doArrow();
			return;
		}
		
		if(aType != "ajax" && aType != "iframe" ){
			if(document.getElementById(id) == null){
				alert("找不到目标，请检查目标是否存在或传入id是否正确");
				return;
			}
		}
		var box = $("#" + id),
			rw = w == "auto"?350:w,
			h = box.height();
		box.css({
			//display:"none",
			width:rw + "px"
		})
		if(aType != "arrow"){
			switch(aType){
				case "white"://白色半透明遮罩
					popDiv.whiteMark(dW,dH);
				break;
				
				case "gray"://灰色半透明遮罩
					popDiv.grayMark(dW,dH);
				break;
					
				case "black"://黑色半透明遮罩
					popDiv.blackMark(dW,dH);
				break;
				
				case "noMark":
					//popDiv.noMark()
				break
				
				case "ajax":
				
					var aArr=aTc.split("?"),id="tmpFloatBox";
					popTypeArrow.creatBox(aClass);
					var closeBut = $("#tmpFloatBox span[title='close']");
					var ContentBox = $("#arrContent"),
						toClose = function(event){popDiv.hideBox(event.data.bId)}
					$("#tmpFloatBox").css("width",rw + "px")
					closeBut.bind("click", {bId:id}, toClose);
					if(title){
						$("#floatTitle").html(title);
						$("#floatTitle").css({
							display:"block",
							height:"20px",
							margin:"15px 0 -18px",
							padding:"0 0 0 10px",
							"border-bottom":"1px dotted #8C8A8A",
							font:"bolder 14px Arial,SimSun,sans-serif"
						});
					}
					$.ajax({
						type:aArr[0],
						url:aArr[1],
						data:aArr[2],
						cache:false,
						error:function(){
							ContentBox.html(O_o.FailMsgC);
							var ot;
							ot = setTimeout(function(){popDiv.hideBox(id)},2000);
						},
						success:function(html){
							ContentBox.html(html);
							popDiv.showBox(id,h,rw);
						}
					});
					popDiv.blackMark(dW,dH);
					return;
				break;
				
				default:
					popDiv.grayMark(dW,dH);
			}
			popDiv.showBox(id,h,rw);
		}
	},
	showBox:function(id,h,rw,aClass){
		
		var theBoxs		= $("#" + id),
			eH			= document.documentElement.clientHeight,
			boxH		= theBoxs.outerHeight()/2,
			boxW		= rw/2,
			boxT		= document.documentElement.scrollTop + eH/2,
			bClass		= theBoxs.attr("class");
			
		theBoxs.css({
			position:"absolute",
			left:"50%",
			top:boxT + "px",
			"z-index":"100",
			margin:"-" + boxH + "px 0 0 -" + boxW + "px"
		})
		theBoxs.attr("lang","popUp");
		if(aClass){
			theBoxs.attr("class",bClass + " " + aClass);
		}
		
		//theBoxs.insertBefore($("body div:first"));
		theBoxs.animate({
			opacity:"show"
		})
	},
	hideBox:function(id){
		$("#" + id).removeAttr("lang");
		$("#" + id).animate({
			opacity:"hide"
		},300)
		if($("#tMark")){
			$("#tMark").remove()
			/*$("#tMark").animate({
				opacity:"hide"
			},300,function(){
				$("#tMark").remove();
			})*/
		}
		
		if($("#shadow")){
			$("#shadow").animate({
				opacity:"hide"
			},300,function(){
				$("#shadow").remove();
			})
		}
		
		if(id == "tmpFloatBox"){$("#" + id).remove()}
		
	},
	theShadow:function(id,aT,aL,exc){
		var sd = document.createElement("div");
		sd.id = "shadow";
		$("body").append(sd);
		$("#shadow").css({
			display:"none",
			height:$("#" + id).outerHeight() + "px",
			width:$("#" + id).outerWidth() + "px",
			"background-color":"#000",
			opacity:"0.35",
			position:"absolute",
			"z-index":"1",
			top:aT + "px",
			left:aL + exc + "px"
		})
		
		$("#shadow").animate({
			top:aT + exc + "px",
			opacity:"show"
		})
	},
	creatMark:function(mColor,dW,dH,op){
		var mark = document.createElement("div");
		mark.id = "tMark";
		mark.innerHTML = "<iframe></iframe>";
		mark.style.display = "none";
		mark.style.backgroundColor = mColor;
		$("body").append(mark);
		$("#tMark iframe").css({
			width:dW + "px",
			height:dH + "px",
			opacity:"0"
		})
		$("#tMark").css({
			height:dH + "px",
			width:dW + "px",
			position:"absolute",
			top:"0",
			left:"0",
			"z-index":"99",
			overflow:"hidden",
			opacity:op
		});
		$("#tMark").css("display","block");
	},
	whiteMark:function(dW,dH){
		popDiv.creatMark("#fff",dW,dH,0.8);
	},
	grayMark:function(dW,dH){
		popDiv.creatMark("#000",dW,dH,0.5);
	},
	blackMark:function(dW,dH){
		popDiv.creatMark("#000",dW,dH,0.8);
	},
	noMark:function(){
		//预留
	}
}),
popTypeArrow = Class(popDiv,{
	creat:function(id,w,aClass,evn,url,title,frameH){
		
		//if($("div").attr("lang") == "popUp"){alert($(this).attr("lang"));$(this).remove()}
		popDiv.creat.call(this,id,w,aClass,evn,url);
		this.url	= url;
		this.aClass	= aClass;
		this.evn	= evn;
		this.frameH	= frameH;
		this.title	= title;
	},
	doArrow:function(){
		if($("#tmpFloatBox")){$("#tmpFloatBox").remove();$("#shadow").remove();}
		if($("div[lang='popUp']")){$("div[lang='popUp']").hide()}
		var id		= this.id == null?"tmpFloatBox":this.id,
			rw		= this.w == "auto"?350:this.w,
			aClass	= this.aClass,
			evn		= this.evn,
			dw		= this.dW,
			bH		= $(evn).height(),
			bW		= $(evn).width()
			bT		= $(evn).offset().top,
			bL		= $(evn).offset().left,
			url		= this.url,
			t		= $("#" + id),
			fH		= this.frameH =="auto"?300:this.frameH,
			cType	= url.substring(0,url.indexOf(":")),
			content	= url.substring(url.indexOf(":")+1,url.length),
			title	= this.title;
		if(cType != "nal"){$("div[lang='popUp']").remove();}
		
		
		document.documentElement.onclick = function(e){
			//if($("#" + id).css("display") == "none"){return false;}
			var ev = e || window.event;
			var eleSrc = ev.srcElement || ev.target;
			if(eleSrc.tagName.toLowerCase() == "body" || eleSrc.tagName.toLowerCase() == "html" || eleSrc.tagName.toLowerCase() == "form"){
				popDiv.hideBox(id);
			}
		}
		
		
		if(cType == "nal"){
			popTypeArrow.setContent(id,t,url,cType,content,comtentBox,rw,bH,bT,bL,dw,bW,fH);
		}else{
			popTypeArrow.creatBox(aClass);
		
			var tmpFloat = $("#tmpFloatBox"),
				comtentBox = $("#arrContent"),
				fTitle = $("#floatTitle");
			if(title){
				fTitle.html(title);
				fTitle.css("display","block");
				
			}
			tmpFloat.css({
				display:"none",
				
				width: rw + "px"
			})
			
			this.closeBut = $("#" + id + " span[close='close']");
			var toClose = function(event){popDiv.hideBox(event.data.bId)}
			this.closeBut.bind("click", {bId:id}, toClose);
			popTypeArrow.setContent(id,tmpFloat,url,cType,content,comtentBox,rw,bH,bT,bL,dw,bW,fH);
		}
		
	},
	creatBox:function(aClass){
		var temp_float=new String;
		temp_float+="<div id=\"tmpFloatBox\">";
		temp_float+="<p class=\"\" id=\"floatTitle\" style=\"display:none;\"></p>";
		temp_float+="<span class=\"arrowClose\"  close=\"close\">"+ O_o.Close +"</span>";
		temp_float+="<div class=\"arrowIn\" id=\"arrContent\"></div>";
		temp_float+="<div id=\"arrowType\"></div>";
		temp_float+="<iframe id=\"fixIEs\" style=\"border:0;display:none;position:absolute;top:0;left:0;z-index:-1;\"></iframe>";
		temp_float+="</div>";
		$("body").append(temp_float);
		if(aClass != null){$("#tmpFloatBox").attr("class","popArrowBox " + aClass);}else{$("#tmpFloatBox").attr("class","popArrowBox")}
		//alert($("#tmpFloatBox").html())
	},
	setContent:function(id,tag,url,cType,content,comtentBox,rw,bH,bT,bL,dw,bW,fH){
		tag.attr("lang","popUp");
		tag.css("position","absolute");
		switch(cType){
			case "ajax":
				var aArr=content.split("?");
				$.ajax({
					type:aArr[0],
					url:aArr[1],
					data:aArr[2],
					cache:false,
					error:function(){
						popTypeArrow.showArrowBox(tag,rw,bH,bT,bL,dw,bW);
						comtentBox.html(O_o.FailMsgC);
						var ot;
						ot = setTimeout(function(){popDiv.hideBox(id)},2000);
					},
					success:function(html){
						comtentBox.html(html);
						popTypeArrow.showArrowBox(tag,rw,bH,bT,bL,dw,bW);
					}
				});
				
			break;
			
			case "iframe":
				comtentBox.html("<iframe src=\""+content+"\" width=\"100%\" height=\""+ fH +"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");
				popTypeArrow.showArrowBox(tag,rw,bH,bT,bL,dw,bW);
			break;
			
			case "nal":
			//alert($("#" + id).outerWidth())
				var aT = Math.ceil(bT + bH*2),
					aL = Math.ceil(bL - tag.outerWidth(true)/4);
				
				if($("body div:first").attr("id")!=id){tag.insertBefore($("body div:first"));}
				
				tag.css({
					top:aT + "px",
					left:aL + "px",
					width:rw + "px",
					"z-index":"2"
				});
				popDiv.theShadow(id,aT,aL,5);
				tag.animate({
					opacity:"show"
				})
			break;
			
			case "txt":
				
			break;
		}
	},
	showArrowBox:function(tag,rw,bH,bT,bL,dW,bW){
		//alert(tag.attr("id"));
		var bh = tag.outerHeight(),boxW = tag.outerWidth(),arrowType = $("#arrowType"),sT,aT,aR,aB,aL;
		
		
		//不是位于页面底部时
		if(bL > dW/2 && bT < $(document).height()*0.9){
			aT = bT + bH*2;
			aR = dW - bL - bW;
			aB = "";
			aL = dW - boxW - aR;
			tag.css({
				position:"absolute",
				top:aT + "px",
				right:aR + "px",
				"z-index":"2",
				bottom:"",
				left:""
			});
			arrowType.css("right",bW/2 + "px");
			popDiv.theShadow(tag.attr("id"),aT,aL,5);
			sT = "rt";
		}
		
		if(bL < dW/2 && bT < $(document).height()*0.9){
			aT = bT + bH*1.5;
			aR = "";
			aB = "";
			aL = bL;
			tag.css({
				position:"absolute",
				top:aT+ "px",
				right:"",
				"z-index":"2",
				bottom:"",
				left:aL + "px"
			});
			arrowType.css("left",bW/2 + "px");
			popDiv.theShadow(tag.attr("id"),aT,aL,5);
			sT = "lt";
		}
		
		//位置超过页面长度的80%时
		if(bL > dW/2 && bT > $(document).height()*0.9){
			aT = bT - tag.height() - bH*2;
			aR = dW - bL - bW;
			aB = "";
			aL = dW - boxW - aR;
			tag.css({
				position:"absolute",
				top:aT + "px",
				right:aR + "px",
				bottom:"",
				"z-index":"2",
				left:""
			});
			arrowType.css("right",bW/2 + "px");
			//popDiv.theShadow("tmpFloatBox",aT,aL,5);
			sT = "rb";
		}
		
		if(bL < dW/2 && bT > $(document).height()*0.9){
			aT = bT - tag.height()  - bH*2;
			aR = "";
			aB = "";
			aL = bL;
			tag.css({
				position:"absolute",
				top:aT + "px",
				right:aR,
				bottom:aB,
				"z-index":"2",
				left:aL + "px"
			});
			arrowType.css("left",bW/2 + "px");
			//popDiv.theShadow("tmpFloatBox",aT,aL,5);
			sT = "lb";
		}
		
		$("#fixIEs").css({
			height:bh + "px",
			width:boxW + "px",
			display:"block",
			opacity:"0"
		})
		arrowType.addClass(sT);
		tag.attr("lang","popUp");
		tag.animate({
			opacity:"show"
		})
	}
}),
picLibShow= Class(popDiv,{

	creat:function(imgClass,url,cc){
	
	
	if($("#picLib").html()==null){
		$("body").append('<div class="picLib" id="picLib"><h4><span id="picTitle"></span><span class="picClose" id="picClose"></span></h4><div class="bigPic" id="bigPic"></div><div class="leftArrBox"><div class="leftArr" id="leftArr"></div></div><div class="smallImgList"><div class="picBox" id="picBox"></div></div> <div class="rightArrBox"><div class="rightArr" id="rightArr"></div></div></div>');
	}
	
	if(url==""){return false;}
	if(_$('picLib').style.display=="block"){return false;}
	
	if(imgClass==""){
		imgClass="null";
	}
	
	
	var picList=$("#"+imgClass+" img"),//页面图片列表ID
	   picId=[],//图片标识
	    picLink=[],//小图链接
   	    smallPic=[],//小图组
	    picTitle=[],//图片标题
	    bigPicUrl=[],//大图链接
	    picHtml="",
	    picBox=$("#picBox"),//小图组层ID
	    move=true,//判定动画效果可否执行
	    max,idNow,//max:图片组数；idNow:移动后所选的默认图片;
	    id="picLib",//图片效果层id
	    w=parseInt($("#picLib").css("width")),//图片效果层宽度
		picNode=true;
		
	if(imgClass !="null" && picList.length ==0 && cc == 0){
		return false;
	}

	$.ajax({
	   type: "GET",
	   url: url,
	   dataType: "json",
	   data: '',
	   error: function(){
		return false;
	   },
	   success: function(json){
		   
	   if (json.pic.length==0){return false;}
	   if (json.pic.length==1){_$('picBox').style.display="none";_$('picLib').style.height="495px";}
	   else{_$('picBox').style.display="inline";_$('picLib').style.height="575px";}
	   for (var i=0;i<json.pic.length;i++ ){
		 picId[i]=json.pic[i].id;
		 picLink[i]=json.pic[i].url;
		 picTitle[i]=json.pic[i].title;
		 bigPicUrl[i]=json.pic[i].bigUrl;
		 picHtml=picHtml+'<img src="../images/loading.gif">';
			
		 }
		 $("#picBox").html(picHtml);
		 smallPic=$("#picBox img");
		
		 if (picList[0]==undefined)
		{	
			picList[0]=picId[0];
		}
		
		 if (picId.length%6==0){
				max=parseInt(picId.length/6-1);
			}
			else{
				max=parseInt(picId.length/6);
			}
		$("#leftArr").unbind();
		$("#rightArr").unbind();
		picLibShow.picLibSet(picList,id,picId,picLink,smallPic,picTitle,bigPicUrl,picBox,move,max,idNow,w,picNode,imgClass,url);
	   }
	});
	},
	//绑定事件
	picLibSet:function(picList,id,picId,picLink,smallPic,picTitle,bigPicUrl,picBox,move,max,idNow,w,picNode,imgClass,url){
		//关闭按钮
		
				
		$("#picClose").click(function(){popDiv.hideBox(id);_$('bigPic').innerHTML="";});
		//左按钮
		$("#leftArr").click(function(){
			if(move)
			{
				if(picBox.css("left")!="0px"){
				   idNow=(-parseInt(picBox.css("left"))/564-1)*6
				   var left =parseInt(picBox.css("left"))+564;
				   picLibShow.changePic(idNow,max,smallPic,bigPicUrl,picTitle,picNode);
				   picLibShow.picLoad(picId[idNow],picId,max,smallPic,bigPicUrl,picTitle,picLink,picNode);
				   move=false;
				   picBox.animate({left:left+'px'}, 1000,function(){move=true;});
				}
			}
		  });
		//右按钮
		$("#rightArr").click(function(){
			if(move)
			{
				 if(picBox.css("left")!="-"+(max*564)+"px"){
					 idNow=(-parseInt(picBox.css("left"))/564+1)*6;
					 var right =parseInt(picBox.css("left"))-564;
					 picLibShow.changePic(idNow,max,smallPic,bigPicUrl,picTitle,picNode);
					 picLibShow.picLoad(picId[idNow],picId,max,smallPic,bigPicUrl,picTitle,picLink,picNode);
					 move=false;
					 picBox.animate({left: right+'px'}, 1000,function(){move=true;});
				 }
			 }
		  });
		//给图片绑定事件

		if (picList.length==0)
		{
			var dW = document.body.scrollWidth,
				dH = $(document).height();
				picLibShow.changePic(picLibShow.picSearch(picList[0],picId)[0],max,smallPic,bigPicUrl,picTitle,picNode);
				picBox.css("left","0px");
				picLibShow.picLoad(picList[0],picId,max,smallPic,bigPicUrl,picTitle,picLink,picNode);
				popDiv.blackMark(dW,dH);
				popDiv.showBox(id,'',w);

		}
		else{
			picList.each(function(i){
				
			   if (picList[i].className!="group")
					{
						picList[i].parentNode.onclick=function(){
							var dW = document.body.scrollWidth,
								dH = $(document).height(),
								leftNow=564*picLibShow.picSearch(picList[i].id,picId)[1];//计算图片所在组的LEFT位置
							
							picLibShow.changePic(picLibShow.picSearch(picList[i].id,picId)[0],max,smallPic,bigPicUrl,picTitle,picNode);
							picBox.css("left","-"+leftNow+"px");
							picLibShow.picLoad(picList[i].id,picId,max,smallPic,bigPicUrl,picTitle,picLink,picNode);
							popDiv.blackMark(dW,dH);
							popDiv.showBox(id,'',w);
						}
					 }
		    
				});
			}
		},
		picLoad:function(id,picId,max,smallPic,bigPicUrl,picTitle,picLink,picNode){
			var idNode=picLibShow.picSearch(id,picId)[1]*6;
			for (var z=0;z<6;z++)
			 {	
				if(idNode+z<picId.length){
					smallPic[idNode+z].src='../images/loading.gif';
					smallPic[idNode+z].src=picLink[idNode+z];
					smallPic[idNode+z].id=picId[idNode+z];
					smallPic[idNode+z].onclick=function(){
						picLibShow.changePic(picLibShow.picSearch(this.id,picId)[0],max,smallPic,bigPicUrl,picTitle,picNode);
					};
				}
			}
		},	

			//查找图片ID位置
		picSearch:function (id,picId){
			
			var actInf=new Array()   
			var actPic;
			for (var i=0;i<picId.length;i++)
			{  	if(id==picId[i]){
					actPic=i;
					break;
					};
			}
			actInf[1]=parseInt(actPic/6); 
			actInf[0]=actPic;
			return actInf;
				
		},

		phototype:function(src){
			var type = /^(.+)\.mp3|wmv|wma/i.test(src)? 'wmv' : 
					   /^\s?mms:\/\/(.+)/i.test(src)? 'mms' : 
					   /^(.+)\.flv/i.test(src)? 'flv' :
					   /^(.+)\.swf/i.test(src)? 'flash' :
					   /^(.+)\.jpg|jpeg|bmp|gif|png/i.test(src)? 'img' : 'img';
			return type;
			},
    
	//大图切换
		changePic:function (act,max,smallPic,bigPicUrl,picTitle,picNode){
			
		
			if(picNode==true){
				
					if (parseInt(act/6)==0)
					{
						$("#leftArr").css("display","none");
					}
					else{
						$("#leftArr").css("display","block");
					}
					if (parseInt(act/6)==max)
					{
						$("#rightArr").css("display","none");
					}
					else{
						$("#rightArr").css("display","block");
					}
					smallPic.removeClass("act");
					smallPic[act].className="act";	
					picNode=false;
					$("#bigPic").animate({
						opacity:"hide"
						},150,function(){
							switch(picLibShow.phototype(bigPicUrl[act])){
								case 'img':
									_$('bigPic').innerHTML='<img src="/images/loading.gif" />';
									_$('bigPic').innerHTML='<img src="'+bigPicUrl[act]+'" />';
								break;
								case 'flv': _$('bigPic').innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="450"><param name="movie" value="http://www.citsmeeting.com/video/vcastr.swf" /><param name="quality" value="high" /><param name="allowFullScreen" value="true" /><param name="FlashVars" value="vcastr_file='+bigPicUrl[act]+'" /> <embed src=" http://www.citsmeeting.com/video/vcastr.swf" allowfullscreen="true" flashvars="vcastr_file='+bigPicUrl[act]+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="450"></embed></object>';  break;
								case 'wmv': alert('wmv');  break;
								case 'flash': _$('bigPic').innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,2,0" '
																	 + 'width="600" height="450">'
																	 + '<param name="quality" value="high"/>'
																	 + '<param name="movie" value="'+bigPicUrl[act]+'"/>'
																	 + '<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" '
																	 + 'quality="high" src="'+bigPicUrl[act]+'" width="600" height="450"></embed></object>';break;
								case 'mms': alert('mms');  break;
								default: return false;
							}
													
							
								_$("picTitle").innerHTML=picTitle[act];
								$("#bigPic").animate({
								opacity:"show"
							},150,function(){picNode=true})
					});
				}
			}
}),
srcollMan = Class($_$,{
	creat:function(_id, mEle, inEle, num, showNum, _class ,rT,at){		
		srcollMan.Aman = {};
		srcollMan.Aman.id = _id;
		srcollMan.Aman.mEle =mEle;
		srcollMan.Aman.inEle = inEle;
		srcollMan.Aman.num = num;
		srcollMan.Aman.showNum = showNum;
		srcollMan.Aman.cls = _class;
		srcollMan.Aman.tmp = "";
		srcollMan.Aman.type = rT;
		srcollMan.Aman.auto = at;
	},
	setOp:function(){//参数设定
		srcollMan.Aman.defNum = 0;
		srcollMan.Aman.mE = $("#" + srcollMan.Aman.id +" "+ srcollMan.Aman.mEle).eq(0),
		srcollMan.Aman.iEE = $("#" + srcollMan.Aman.id +" "+ srcollMan.Aman.inEle);
		srcollMan.Aman._lBut = $("#" + srcollMan.Aman.id +" *[title='left']");
		srcollMan.Aman._rBut = $("#" + srcollMan.Aman.id +" *[title='right']");
		srcollMan.Aman.mWidth = srcollMan.Aman.mE.find(srcollMan.Aman.inEle).eq(0).outerWidth(true);
		if(srcollMan.Aman.mWidth == null){
			return false;
		}
		srcollMan.Aman.clsArr = [srcollMan.Aman.cls + "Left",srcollMan.Aman.cls + "LeftNone",srcollMan.Aman.cls + "Right",srcollMan.Aman.cls + "RightNone"];
		if(srcollMan.Aman.auto != undefined){
			srcollMan.Aman.ott = 8000;//自动滚动时间
		}
		if(srcollMan.Aman.type != undefined){
			srcollMan.Aman.isMax = Math.ceil(srcollMan.Aman.iEE.length/srcollMan.Aman.showNum);
		}else{
			srcollMan.Aman.isMax = srcollMan.Aman.iEE.length - srcollMan.Aman.showNum + 1;
		}
		
	},
	inntScroll:function(){//初始化
		var nowNum,getLeft,getRight;
			
		srcollMan.setOp()
		
		if(srcollMan.Aman.iEE.length == srcollMan.Aman.showNum){return false;}
			
		if(nowNum == undefined){
			if(srcollMan.Aman.tmp != false){srcollMan.Aman.tmp = false};
			nowNum = srcollMan.Aman.num + srcollMan.Aman.defNum;
			srcollMan.Aman._lBut.attr("sN",nowNum);
			srcollMan.Aman._rBut.attr("sN",nowNum);
		}		

		try{
			if(srcollMan.Aman.mE.attr("style")=="" || srcollMan.Aman.mE.attr("style") == undefined){
				srcollMan.Aman.mE.css({
					width:srcollMan.Aman.mWidth * srcollMan.Aman.iEE.length + "px",
					position:"absolute",
					left:"0"
				});
			}
			
			srcollMan.bindEvent()
			
		}catch(e){
		}
	},
	bindEvent:function(){//事件绑定
		srcollMan.Aman._lBut.bind("click",srcollMan.getLeft);
		srcollMan.Aman._rBut.bind("click",srcollMan.getRight);

		if(srcollMan.Aman.auto!= undefined){
			if(srcollMan.Aman.ss == undefined){
				srcollMan.Aman._lBut.bind("mouseover",srcollMan.clearOt);
				srcollMan.Aman._lBut.bind("mouseout",srcollMan.reSetOt);
				srcollMan.Aman._rBut.bind("mouseover",srcollMan.clearOt);
				srcollMan.Aman._rBut.bind("mouseout",srcollMan.reSetOt);
			}
			srcollMan.Aman.ot = setInterval(function(){
				srcollMan.autoScroll();
			},srcollMan.Aman.ott);
		}
		$(document).unload(function(){
			if(srcollMan.Aman.ot){
				clearInterval(srcollMan.Aman.ot);
			}
			srcollMan.Aman.tmp = null;
			srcollMan.Aman.ss = null;
		})
	},
	getRight:function(){
		if(srcollMan.Aman.tmp == true){return false;}
		var lSn = parseInt(srcollMan.Aman._lBut.attr("sN")),rSn = parseInt(srcollMan.Aman._rBut.attr("sN"));
		if(lSn-1 == 0){return false;}
		srcollMan.Aman.tmp = true;
		lSn--;
		rSn++;
		srcollMan.Aman._rBut.attr("sN",rSn);
		srcollMan.Aman._lBut.attr("sN",lSn);
		srcollMan.sRight();
		srcollMan.arrwS();
	},
	getLeft:function(){
		if(srcollMan.Aman.tmp == true){return false;}
		var lSn = parseInt(srcollMan.Aman._lBut.attr("sN")),rSn = parseInt(srcollMan.Aman. _rBut.attr("sN"));
		if(lSn == srcollMan.Aman.isMax){return false;}
		srcollMan.Aman.tmp = true;				
		lSn++;
		rSn--;			
		srcollMan.Aman._lBut.attr("sN",lSn);
		srcollMan.Aman._rBut.attr("sN",rSn);
		srcollMan.sLeft();
		srcollMan.arrwS();
		srcollMan.Aman.ss = true;											
	},
	clearOt:function(){
		clearInterval(srcollMan.Aman.ot);
		srcollMan.Aman.ot = null;
	},
	reSetOt:function(){
		srcollMan.Aman.ot = setInterval(function(){
			srcollMan.autoScroll();
		},srcollMan.Aman.ott);
	},
	autoScroll:function(){//自动滚动
		srcollMan.Aman._lBut.unbind("click");
		srcollMan.Aman._rBut.unbind("click");
		var lSn = parseInt(srcollMan.Aman._lBut.attr("sN")),rSn = parseInt(srcollMan.Aman. _rBut.attr("sN"));

		if(srcollMan.Aman.ss == undefined || srcollMan.Aman.ss == null){
			srcollMan.getLeft();
		}else{
			if(lSn == srcollMan.Aman.isMax){
				srcollMan.getRight();
			}else if(lSn-1 == 0){
				srcollMan.getLeft();
			}else{
				srcollMan.getLeft();
			}
		}	
	},
	sLeft:function(){//左滚
		var tM = parseInt(srcollMan.Aman.mE.css("left"));
		if(srcollMan.Aman.type != undefined){
			srcollMan.Aman.mE.animate({
				left:tM - (srcollMan.Aman.mWidth*srcollMan.Aman.showNum) + "px"
			},500,function(){
				srcollMan.Aman.tmp = false;
				srcollMan.Aman._lBut.bind("click",srcollMan.getLeft);
				srcollMan.Aman._rBut.bind("click",srcollMan.getRight);
			})
		}else{
			srcollMan.Aman.mE.animate({
				left:tM - srcollMan.Aman.mWidth + "px"
			},500,function(){
				srcollMan.Aman.tmp = false;
				srcollMan.Aman._lBut.bind("click",srcollMan.getLeft);
				srcollMan.Aman._rBut.bind("click",srcollMan.getRight);
			})
		}
	},
	sRight:function(){//右滚
		var tM = parseInt(srcollMan.Aman.mE.css("left"));
		if(srcollMan.Aman.type != undefined){
			srcollMan.Aman.mE.animate({
				left:tM + (srcollMan.Aman.mWidth*srcollMan.Aman.showNum) + "px"
			},500,function(){
				srcollMan.Aman.tmp = false;
				srcollMan.Aman._lBut.bind("click",srcollMan.getLeft);
				srcollMan.Aman._rBut.bind("click",srcollMan.getRight);
			})
		}else{
			srcollMan.Aman.mE.animate({
				left:tM + srcollMan.Aman.mWidth + "px"
			},500,function(){
				srcollMan.Aman.tmp = false;
				srcollMan.Aman._lBut.bind("click",srcollMan.getLeft);
				srcollMan.Aman._rBut.bind("click",srcollMan.getRight);
			})
		}

	},
	arrwS:function(){
		var arrLS,arrRS,tl = parseInt(srcollMan.Aman.mE.css("left"));
		arrLS = srcollMan.Aman._lBut.attr("sN");
		arrRS = srcollMan.Aman._rBut.attr("sN");
		if(arrLS-1 >=0){srcollMan.Aman._rBut.attr("class",srcollMan.Aman.clsArr[2]);}
		if(arrLS == srcollMan.Aman.isMax){
			srcollMan.Aman._lBut.attr("class",srcollMan.Aman.clsArr[1]);
			srcollMan.Aman._rBut.attr("class",srcollMan.Aman.clsArr[2]);
		}
		if(arrLS == arrRS){
			srcollMan.Aman._lBut.attr("class",srcollMan.Aman.clsArr[0]);
			srcollMan.Aman._rBut.attr("class",srcollMan.Aman.clsArr[3]);
		}
		if(tl <=0 && arrLS == srcollMan.Aman.showNum ){
			srcollMan.Aman._lBut.attr("class",srcollMan.Aman.clsArr[0]);
		}
		if(arrLS < srcollMan.Aman.isMax){srcollMan.Aman._lBut.attr("class",srcollMan.Aman.clsArr[0]);}
	}
}),
srcollChid = Class($_$,{
	creat:function(o){
		this.o = o;
		srcollChid.bag = this.o;
	},
	sO:function(){
		srcollChid.bag.tag = $("#" + srcollChid.bag.bid);
		srcollChid.bag.mE = $("#" + srcollChid.bag.bid + " "+srcollChid.bag.eles[0]).eq(0);
		srcollChid.bag.iE = $("#" + srcollChid.bag.bid + " "+srcollChid.bag.eles[1]);
		
		srcollChid.bag.upOnCls = srcollChid.bag.cls[0][0];
		srcollChid.bag.upOffCls = srcollChid.bag.cls[0][1];
		srcollChid.bag.downOnCls = srcollChid.bag.cls[1][0];
		srcollChid.bag.downOffCls = srcollChid.bag.cls[1][1];
		srcollChid.bag.eH = srcollChid.bag.iE.eq(0).outerHeight(true);
		
		srcollChid.bag.mE.css({
			top:"0",
			height:srcollChid.bag.eH * srcollChid.bag.iE.length +"px"
		});
		
		srcollChid.bag.uBut = srcollChid.bag.tag.find("*[bt='up']");
		srcollChid.bag.dBut = srcollChid.bag.tag.find("*[bt='down']");
		srcollChid.bag.uBut.attr("sn","1");
		srcollChid.bag.dBut.attr("sn","1");
		srcollChid.bag.uBut.attr("ns","t");
		srcollChid.bag.tmp = "";
		if(srcollChid.bag.aRoll != undefined){
			srcollChid.bag.ott = 4000;
		}
		if(srcollChid.bag){
			srcollChid.bag.rMax = Math.ceil(srcollChid.bag.iE.length/srcollChid.bag.rollNum);
		}else{
			srcollChid.bag.rMax = srcollChid.bag.iE.length - srcollChid.bag.rollNum + 1;
		}
	},
	bindE:function(){
		srcollChid.bag.uBut.bind("click",srcollChid.getTop);
		srcollChid.bag.dBut.bind("click",srcollChid.getDown);
		if(srcollChid.bag.aRoll != undefined){
			if(srcollChid.bag.ss == undefined){
				srcollChid.bag.uBut.bind("mouseover",srcollChid.clearOt);
				srcollChid.bag.uBut.bind("mouseout",srcollChid.reSetOt);
				srcollChid.bag.dBut.bind("mouseover",srcollChid.clearOt);
				srcollChid.bag.dBut.bind("mouseout",srcollChid.reSetOt);
			}
			srcollChid.bag.ot = setInterval(function(){
				srcollChid.autoR();
			},srcollChid.bag.ott);
		}
	},
	getDown:function(){
		if(srcollChid.bag.tmp == true){return false;}
		var uSn = parseInt(srcollChid.bag.uBut.attr("sN")),dSn = parseInt(srcollChid.bag.dBut.attr("sN"));
		if(uSn-1 == 0){return false;}
		srcollChid.bag.tmp = true;
		uSn--;
		dSn++;
		srcollChid.bag.uBut.attr("sN",uSn);
		srcollChid.bag.dBut.attr("sN",dSn);
		srcollChid.downRoll();
		srcollChid.arrwS();
	},
	getTop:function(){
		if(srcollChid.bag.tmp == true){return false;}
		var uSn = parseInt(srcollChid.bag.uBut.attr("sN")),dSn = parseInt(srcollChid.bag.dBut.attr("sN"));
		if(uSn == srcollChid.bag.rMax){return false;}
		srcollChid.bag.tmp = true;				
		uSn++;
		dSn--;			
		srcollChid.bag.uBut.attr("sN",uSn);
		srcollChid.bag.dBut.attr("sN",dSn);
		srcollChid.topRoll();
		srcollChid.arrwS();
		srcollChid.bag.ss = true;											
	},
	topRoll:function(){
		var tM = parseInt(srcollChid.bag.mE.css("top"));
		if(srcollChid.bag.tRoll != undefined){
			srcollChid.bag.mE.animate({
				top:tM - (srcollChid.bag.eH * srcollChid.bag.rollNum) + "px"
			},500,function(){
				srcollChid.bag.tmp = false;
				srcollChid.bag.uBut.bind("click",srcollChid.getTop);
				srcollChid.bag.dBut.bind("click",srcollChid.getDown);
			})
		}else{
			srcollChid.bag.mE.animate({
				top:tM - srcollChid.bag.eH + "px"
			},500,function(){
				srcollChid.bag.tmp = false;
				srcollChid.bag.uBut.bind("click",srcollChid.getTop);
				srcollChid.bag.dBut.bind("click",srcollChid.getDown);
			})
		}
	},
	downRoll:function(){
		var tM = parseInt(srcollChid.bag.mE.css("top"));
		if(srcollChid.bag.tRoll != undefined){
			srcollChid.bag.mE.animate({
				top:tM + (srcollChid.bag.eH * srcollChid.bag.rollNum) + "px"
			},500,function(){
				srcollChid.bag.tmp = false;
				srcollChid.bag.uBut.bind("click",srcollChid.getTop);
				srcollChid.bag.dBut.bind("click",srcollChid.getDown);
			})
		}else{
			srcollChid.bag.mE.animate({
				top:tM + ssrcollChid.bag.eH + "px"
			},500,function(){
				srcollChid.bag.tmp = false;
				srcollChid.bag.uBut.bind("click",srcollChid.getTop);
				srcollChid.bag.dBut.bind("click",srcollChid.getDown);
			})
		}
	},
	arrwS:function(){
		var ns=srcollChid.bag.uBut.attr("ns"),uSn= parseInt(srcollChid.bag.uBut.attr("sN"));
		
		if(uSn-1 == 0){
			srcollChid.bag.dBut.attr("class",srcollChid.bag.downOffCls);
		}
		if(uSn == srcollChid.bag.rMax){
			srcollChid.bag.uBut.attr("class",srcollChid.bag.upOffCls);
		}
		if(uSn > 1 && uSn != srcollChid.bag.rMax){
			srcollChid.bag.uBut.attr("class",srcollChid.bag.upOnCls);
			srcollChid.bag.dBut.attr("class",srcollChid.bag.downOnCls);
		}
		
	},
	autoR:function(){//自动滚动
		srcollChid.bag.uBut.unbind("click");
		srcollChid.bag.dBut.unbind("click");
		var uSn = parseInt(srcollChid.bag.uBut.attr("sN")),dSn = parseInt(srcollChid.bag.dBut.attr("sN"));
		if(srcollChid.bag.ss == undefined || srcollChid.bag.ss == null){
			srcollChid.getTop();
		}else{
			var ns=srcollChid.bag.uBut.attr("ns");
			if(uSn == srcollChid.bag.rMax){
				srcollChid.getDown();
				srcollChid.bag.uBut.attr("ns","d");
			}else if(uSn-1 == 0){
				srcollChid.getTop();
				srcollChid.bag.uBut.attr("ns","t");
			}else{
				if(ns == "t"){
					srcollChid.getTop();
				}else{
					srcollChid.getDown();
				}
			}
		}	
	},
	clearOt:function(){
		clearInterval(srcollChid.bag.ot);
		srcollChid.bag.ot = null;
	},
	reSetOt:function(){
		srcollChid.bag.ot = setInterval(function(){
			srcollChid.autoR();
		},srcollChid.bag.ott);
	},
	intt:function(){
		srcollChid.sO();
		srcollChid.bindE();
	}
}),
ajaxGetData = Class($_$, {
    creat: function(sOOP) {
        this.sOOP = sOOP;
        ajaxGetData._O = this.sOOP;
    },
    ajaxInnt: function() {
        ajaxGetData._O.aBox = $("#" + ajaxGetData._O.bId)
		var dayDate;
        //初始化参数
        dayDate = "Date=" + ajaxGetData.whatDay(0) + "&dateType=" + ajaxGetData._O.type + "&pid=" + ajaxGetData._O._ID + "&OffCityID=" + ajaxGetData._O.oId + "&DayNumber=" + ajaxGetData._O.nNum;

        if (ajaxGetData._O.aBox.val() == "") {
            ajaxGetData.getData(dayDate);
        }
    },
    whatDay: function(tps, someDay) {
        var nowDate = new Date(),
			dM = nowDate.getMonth(),
			nowM = dM + 1,
			nowY = nowDate.getFullYear(),
			nowD = nowDate.getDate(),
			nowS = nowDate.getSeconds(),
			dFmt = O_o.dateFormat,
			sTypr, nextM, nextY, nextM2, nextY2, backY, backM, backY2, backM2, thisY, thisM, thisD, fuY, fuM, fuD, realM, ds,
			daysList = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
			dDays,
			ADate;
			//闰年判断
			var c4=(0==thisY%4),
				c100=(0==thisY%100),
				c400=(0==thisY%400),
				rn = 0;//标示0非闰年，1闰年
			if((c4 && !c100)||c400){rr = 1;daysList[1] = 29;};
			dDays = daysList[dM];
					
        if (dFmt.indexOf("-") != -1) {
            sTypr = "-";
        } else if (dFmt.indexOf("/") != -1) {
            sTypr = "/";
        } else {
            sTypr = ".";
        }

        //当月
        if (tps == 0) {
            if (nowM + 1 > 12) {
                nextM = 1;
                nextY = nowY + 1;
            } else {
                nextM = nowM + 1;
                nextY = nowY;
            }
            ADate = [nowY, nowM, nextY, nextM];
        }
        //下月
        if (tps == 1) {
            if (ajaxGetData.tDate[3] + 1 > 12) {
				if(ajaxGetData.tDate != 0 && ajaxGetData.tDate[0] > nowY){
					nextY = ajaxGetData.tDate[0] + 1;
					nextY2 = nextY;
				}else{
					nextY = nowY + 1;
					nextY2 = nextY;
				}
                nextM = 1;
                nextM2 = 2;
            } else {
                if(ajaxGetData.tDate.length != 0 && ajaxGetData.tDate[0] > nowY){
					nextY = ajaxGetData.tDate[0];
					nextY2 = nextY;
				}else{
					if(ajaxGetData.tDate[0] < ajaxGetData.tDate[2]){
						nextY = nowY + 1;
						nextY2 = nextY;
					}else{
						nextY = nowY;
						nextY2 = nowY;
					}
				}
				nextM = ajaxGetData.tDate[3] + 1;
                nextM2 = ajaxGetData.tDate[3] + 2;
            }
            ADate = [nextY, nextM, nextY2, nextM2];
        }
        //前月
        if (tps == 2) {
            if (ajaxGetData.tDate[1] - 1 < 1) {
                backM = 11;
                backY = ajaxGetData.tDate[0] - 1;
                backM2 = 12;
                backY2 = backY;
            } else {
                backM = ajaxGetData.tDate[1] - 2;
				if(backM==0){
					backM = 12;
				}
                backY = nowY;
                backM2 = ajaxGetData.tDate[1] - 1;
                backY2 = nowY;
            }
            ADate = [backY, backM, backY2, backM2];
        }

        //日期计算
        if (tps == 3 && someDay) {
            var fuDay, allDays;
            if (typeof (someDay) == "string") {
                if (someDay.indexOf(sTypr) != 1 && someDay.length == 10) {
                    dateS = someDay.split(sTypr);
                    thisY = parseInt(dateS[0]);
                    thisM = parseInt(dateS[1], 10);
                    thisD = parseInt(dateS[2], 10);
					dDays = daysList[thisM-1];
                    allDays = thisD + ajaxGetData._O.nNum-1;
				
                    if (allDays > dDays) {
                        if (thisM + 1 > 12) {
                            fuY = thisY + 1;
                            fuM = 1
                            fuD = allDays - dDays;
                        } else {
                            fuY = thisY;
                            fuM = thisM + 1;
                            fuD = allDays - dDays;
                        }
                    } else {
                        fuY = thisY;
                        fuM = thisM;
						fuD = allDays;
                    }

                    if (fuM.toString().length == 1) {
                        realM = 0 + fuM.toString()
                    } else {
                        realM = fuM;
                    }

                    ds = dFmt.split(sTypr);
                    ds[$.inArray("mm", ds)] = realM;
                    ds[$.inArray("dd", ds)] = fuD;
                    ds[$.inArray("yyyy", ds)] = fuY;

                    fuDay = ds.join(sTypr);
                }
            }
            return fuDay;
        }

        ajaxGetData.tDate = ADate; //暂存
        return ADate;
    },
    getData: function(dat) {//日历获取
        $.ajax({
            type: "GET",
            url: O_o.F,
            data: dat,
            cache: false,
            error: function() {
                ajaxGetData._O.aBox.html(O_o.FailMsgB);
            },
            success: function(html) {
				if (ajaxGetData._O.dType != undefined) {
					if(ajaxGetData._O.aBox.find("div").length > 0){
						ajaxGetData._O.aBox.find("div").remove();
					}
					ajaxGetData._O.aBox.append(html);
				}else{
					ajaxGetData._O.aBox.html(html);
				}
                ajaxGetData._O.nextBut = $("#" + ajaxGetData._O.bId + " em[title='Next']");
                ajaxGetData._O.backBut = $("#" + ajaxGetData._O.bId + " em[title='Back']");
                ajaxGetData.dataInnt();
            }
        })
    },
    dataInnt: function() {//日历功能初始化
    
        var divs = $("#" + ajaxGetData._O.bId + " div"),
			tdS = $("#" + ajaxGetData._O.bId + " td"), I,
			nextDATE, backDATE,
			getNewDate = function(event) {
			    var ed = event.data
			    if (ed.dT == "next") {
					if(ajaxGetData._O.dType != undefined && ajaxGetData._O.dType == "diveData"){
						nextDATE = "Date=" + ajaxGetData.whatDay(1) + "&dateType=" + ajaxGetData._O.type + "&pid=" + ajaxGetData._O._ID;
					}else{
						nextDATE = "Date=" + ajaxGetData.whatDay(1) + "&dateType=" + ajaxGetData._O.type + "&pid=" + ajaxGetData._O._ID + "&OffCityID=" + ajaxGetData._O.oId + "&DayNumber=" + ajaxGetData._O.nNum;
					}
			        
			        ajaxGetData.getData(nextDATE);
			    }

			    if (ed.dT == "back") {
					
					if(ajaxGetData._O.dType != undefined && ajaxGetData._O.dType == "diveData"){
						backDATE = "Date=" + ajaxGetData.whatDay(2) + "&dateType=" + ajaxGetData._O.type + "&pid=" + ajaxGetData._O._ID;
					}else{
						backDATE = "Date=" + ajaxGetData.whatDay(2) + "&dateType=" + ajaxGetData._O.type + "&pid=" + ajaxGetData._O._ID + "&OffCityID=" + ajaxGetData._O.oId + "&DayNumber=" + ajaxGetData._O.nNum;
					}
					
			        ajaxGetData.getData(backDATE);
			    }

			};
        //下两月
        if (ajaxGetData._O.nextBut.attr("class").indexOf("Off") == -1) {
            ajaxGetData._O.nextBut.bind("click", {dT: "next" }, getNewDate);
        }
        //上两月
        if (ajaxGetData._O.backBut.attr("class").indexOf("Off") == -1) {
            ajaxGetData._O.backBut.bind("click", {dT: "back" }, getNewDate);
        }
        //样式操作
        if (typeof (ajaxGetData._O._class) == "object") {
            var _arrD = $("#" + ajaxGetData._O.pId + " div[title='arrow']"),
				__t = $("#" + ajaxGetData._O.pId)
            _mClass = ajaxGetData._O._class[0],
				_pClass = ajaxGetData._O._class[1],
				_arrClass = ajaxGetData._O._class[2];

            __t.addClass(_pClass);
            divs.addClass(_mClass);
            _arrD.addClass(_arrClass);
        } else {
            divs.addClass(ajaxGetData._O._class);
        }
        //日期td事件绑定
        for (I = 0; I < tdS.length; I++) {
            if (tdS[I].getElementsByTagName("strong").length > 0) {
                tdS[I].onmouseover = function() {
                    ajaxGetData.tdOver(this, ajaxGetData._O._class);
                }
                if (tdS[I].getElementsByTagName("b").length > 0) {
                    tdS[I].onclick = function() {
                        ajaxGetData.tdClick(this)
                    }
                }
            }
        }

    },
    tdOver: function(t) {//td鼠标经过
        $(t).attr("class", "tdOver");
        if (t.getElementsByTagName("b").length > 0) { $(t).css("cursor", "help"); }
        $(t).mouseout(function() {
            $(this).removeAttr("class");
            $(this).removeAttr("style");
        })
    },
    tdClick: function(t) {//td鼠标点击
        var dW = document.body.scrollWidth,
			bH = $(t).height(),
			bW = $(t).width(),
			bT = Math.ceil($(t).offset().top),
			bL = Math.ceil($(t).offset().left), tH, noL, noH, arW;
			
        if(ajaxGetData._O.dType != undefined){
			if(ajaxGetData._O.callBack != undefined){
				ajaxGetData._O.callBack(t);
			}
		}else{
			
			//隐藏域赋值
			var tag = $("#" + ajaxGetData._O.pId),
				rw = ajaxGetData._O.tabW == null ? 350 : ajaxGetData._O.tabW,
				showDM = t.title.split(","),
				_today = showDM[0],
				_fuDay, fuDat,
				_money = showDM[1],
				hp = $("#" + ajaxGetData._O.hiI),
				datP = $("#" + ajaxGetData._O.dIp),
				arrDiv = tag.find("*[title='arrow']").eq(0),
				closeBut = tag.find("*[close='close']").eq(0);
	        if (ajaxGetData._O.eIp && ajaxGetData._O.eIp != "") {
	            _fuDay = ajaxGetData.whatDay(3, showDM[0]);
	            $("#" + ajaxGetData._O.eIp).val(_fuDay);
	        }
			
			if(ajaxGetData._O.nVal != undefined){
			    var priceType,
				    pVal = $(t).find("b").html().match(/\d+/);
				priceType = pVal == null?1:0;
				$("#" + ajaxGetData._O.nVal).val(priceType);
			}
			
	        datP.val(_today);
	        hp.val(_money);
	        //关闭按钮
	        closeBut.click(function() {
	            ajaxGetData.hidePopD();
	        });
	        //页面空白处点击事件
	        document.documentElement.onclick = function(e) {
	            //if($("#" + ajaxGetData._O.pId).css("display") == "none"){return false;}
	            var ev = e || window.event;
	            var eleSrc = ev.srcElement || ev.target;
	            if (eleSrc.tagName.toLowerCase() == "body" || eleSrc.tagName.toLowerCase() == "html") {
	                ajaxGetData.hidePopD();
	            }
	        }
	        //显示
	        tag.css("width", rw + "px");
	        tH = tag.outerHeight();
	        if (tag.css("display") == "block") { tag.css("display", "none") }
	        noH = bT - tH + 2;
	        if (bL < rw) {
	            arW = 24 * 3;
	            noL = bL - bW;
	        }
	        if (bL > rw && dW - bL >= rw) {
	            arW = 24 * 3;
	            noL = bL - bW;
	        }
	        if (bL >= rw && dW - bL <= rw) {
	            arW = rw - 24 * 2;
	            noL = bL - rw + bW;
	        }
	        arrDiv.css("left", arW + "px");
	        tag.css({
	            width: rw + "px",
	            top: noH + "px",
	            left: noL + "px",
	            "z-index": "3"
	        })
	        tag.animate({
	            opacity: "show"
	        })
	        ajaxGetData.dateShadow(rw, noH, noL);
		}
    },
    dateShadow: function(w, noH, noL) {//阴影创建
        popDiv.theShadow(ajaxGetData._O.pId, noH, noL, 4);
    },
    hidePopD: function() {//关闭事件
        var _t = $("#" + ajaxGetData._O.pId), _Shadow = $("#shadow");
        _t.animate({
            opacity: "hide"
        }, "fast");
        if (_Shadow) {
            _Shadow.animate({
                opacity: "hide"
            }, "fast", function() { _Shadow.remove(); });
        }
    },
    tDate: [],
    _O: { bId: "", _class: "", pId: "", tabW: "", dIp: "", hiI: "", type: "", _ID: "", oId: "", nNum: "", eIp: ""}
}),
diveData = Class(ajaxGetData,{
	creat:function(o){
		this.o = o;
		diveData.x = this.o;
		ajaxGetData._O.dType = diveData.x.dType;
	},
	inntDData:function(){
		var ot,tt;
		if(isIE){
			diveData.x.b = "<div id=\"ajaxGetDate\" style=\"display:none;\"><i close=\"close\"></i><iframe style=\"height:380px;width:100%;position:absolute;top:0;left:0;filter:alpha(opacity=0);opacity:0;\"></iframe></div>";
		}else{
			diveData.x.b = "<div id=\"ajaxGetDate\" style=\"display:none;\"><i close=\"close\"></i></div>";
		}
		
		if(!_$("ajaxGetDate")){
			$("body").append(diveData.x.b);
			diveData.x.bId = "ajaxGetDate";
		}
		diveData.x.eles = $("#" + diveData.x.dId + " input[dp]");
		diveData.x.priceBox = $("#" + diveData.x.dId +" td").eq(1);
		ajaxGetData._O.callBack = function(t){
			diveData.setInput(t);
		};
		diveData.x.eles.click(function(){
			diveData.getAjaxData(this);
			diveData.x.evTag = $(this);
			tt = this;
			ot = setInterval(function(){
				if($("#"+diveData.x.bId + " div").length>0){
					clearInterval(ot);
					ot = null;
					shower({
						oid:diveData.x.bId,
						evn:tt,
						set:{
							type:'nal|center',
							showType:'whiteMark',
							cls:['newPopBox','newArrow','newClosePop'],
							bStyle:'width:910px;padding:25px 10px 10px;border:3px solid #0B7ECD;background:#fff;'
						}
					});
				}
			},100)
			
		})
	},
	getAjaxData:function(t){
		ajaxGetData._O.aBox = $("#" + diveData.x.bId);
		ajaxGetData._O.bId = diveData.x.bId;
		
		var dayDate,
			dps = $(t).attr("dp").split("|");
		ajaxGetData._O.type = dps[1];
		ajaxGetData._O._ID = dps[0];
        dayDate = "Date=" + ajaxGetData.whatDay(0) + "&dateType=" + dps[1] + "&pid=" + dps[0];	
        if (ajaxGetData._O.aBox.val() == "") {
            ajaxGetData.getData(dayDate);
        }
	},
	setInput:function(t){
		diveData.x.evTag.val($(t).attr("title"));
		if($(t).find("b:first").attr("aprice") != undefined && $(t).find("b:first").attr("cprice") != undefined && diveData.x.pType != 0){
		    var tmp,ap,cp;
			if($(t).find("b:first").attr("cprice") == "0" || $(t).find("b:first").attr("cprice") == "-1"){
			    tmp = "<span style=\"color: Red; font-weight: bold;\">¥" + $(t).find("b:first").attr("aprice") + "</span>/成人";
				if(oneNight.o.pBox != undefined){
					oneNight.o.pBox.val($(t).find("b:first").attr("aprice")+",0");
				}
			} else {
			    tmp = "<span style=\"color: Red; font-weight: bold;\">¥" + $(t).find("b:first").attr("aprice") + "</span>/成人,<span style=\"color: Red; font-weight: bold;\">¥" + $(t).find("b:first").attr("cprice") + "</span>/儿童";
				if(oneNight.o.pBox != undefined){
					oneNight.o.pBox.val($(t).find("b:first").attr("aprice")+","+$(t).find("b:first").attr("cprice"));
				}
			}
			if(diveData.x.aUrl && (typeof(diveData.x.aUrl) == "object") &&(diveData.x.aUrl.length != undefined)){
				if(!diveData.x.aUrl[1]){
					return false;
				}
				diveData.x.addPart = $(diveData.x.aUrl[1]);
				var dat = "ProID="+$.trim(ajaxGetData._O._ID)+"&StateDate="+$(t).attr("title");
				$.ajax({
					type:"GET",
					url:diveData.x.aUrl[0],
					data:dat,
					success:function(html){
						diveData.x.addPart.find("select").unbind();
						diveData.x.addPart.html(html);
						diveData.x.priceBox.html(tmp);
						vactionAdd({aid:oneNight.o.addId,tid:oneNight.o.totalId});
					}
				})
			}else{
				diveData.x.priceBox.html(tmp);
			}
		}
		if (oneNight.o !=undefined && (oneNight.o.addId == null ||oneNight.o.addId != undefined)) {
			newPop.x.closeCallBack = oneNight.getPrice;
		}
		newPop.ppHide();
		
	}
}),
//高尔夫预订 tid:"gConfirm",bt:"bookTotal",sb:"goflNext",jp:"jsonPort",cs:".golfBookTab"
setGolf = Class($_$,{
	creat:function(o,cb){
		this.o = o;
		setGolf.g = this.o;
		if(cb){
			setGolf.g.cc = 1;
			setGolf.g.callBack = cb;
		}
	},
	setOp:function(){
		setGolf.g.box = $("#" + setGolf.g.tid);
		
		if(setGolf.g.bt != undefined){
			setGolf.g.total = $("#" + setGolf.g.bt);
		}
		if(setGolf.g.f){
			if(typeof(setGolf.g.f)== "string"){
				setGolf.g.form = $("#" + setGolf.g.f);
			}else if(typeof(setGolf.g.f)== "number"){
				setGolf.g.form = $("form").eq(setGolf.g.f);
			}else{
				alert("请以数字或表单id指定需要提交的表单。");
			}
		}else{
			setGolf.g.form = $("form:first");
		}
		setGolf.g.sb = $("#" + setGolf.g.sb);
		setGolf.g.jsonPort = $("#" + setGolf.g.jp);
		setGolf.g.ts = setGolf.g.box.find("div").filter(setGolf.g.cs);
		setGolf.g.sler = setGolf.g.ts.find("select");
		setGolf.g.green = [];
		setGolf.g.time = [];
		setGolf.g.pPrice = [];
		
		var tds = setGolf.g.box.find("tr").eq(2).find("td"),p = 0;
		$.each(tds,function(i,n){
			if (i > 0) {
				if($(this).find("b").length >0){
					p = $(this).find("b:first").html().match(/\d+/);
				}else{
					p = $(this).html().match(/\d+/);
				}
				setGolf.g.pPrice.push(p);
			}
		})
		tds = null;
		
		setGolf.g.tr = function(i){
			var s = i+Math.ceil(Math.random()*1000),
				trString = "<tr><td>选用</td><td><input type=\"radio\" value=\""+setGolf.g.pPrice[0]+"\" name=\"BallCartFee_1_"+s+"\" json=\"GFN_BallCartPerFee\"/></td><td><input type=\"radio\" value=\""+setGolf.g.pPrice[1]+"\" name=\"BallCartFee_1_"+s+"\" json=\"GFN_BallCartDoubleFee\"/></td><td><input type=\"radio\" value=\""+setGolf.g.pPrice[2]+"\" name=\"CaddieFee_1_"+s+"\" json=\"GFN_CaddiePerFee\"/></td><td><input type=\"radio\" value=\""+setGolf.g.pPrice[3]+"\" name=\"CaddieFee_1_"+s+"\" json=\"GFN_CaddieDoubleFee\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[4]+"\" name=\"GFN_GarderobeFee\" json=\"GFN_GarderobeFee\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[5]+"\" name=\"GFN_HirePoleFee\" json=\"GFN_HirePoleFee\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[6]+"\" name=\"GFN_HireShoesPrice\" json=\"GFN_HireShoesPrice\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[7]+"\" name=\"GFN_WorlkFee\" json=\"GFN_WorlkFee\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[8]+"\" name=\"GFN_ServiceFee\" json=\"GFN_ServiceFee\"/></td><td><input type=\"checkbox\" value=\""+setGolf.g.pPrice[9]+"\" name=\"GFN_Assurance\" json=\"GFN_Assurance\"/></td></tr>";
			
			return trString;
		}
		
		$.each(setGolf.g.ts,function(){
			var _t = $(this).find("p:first").find("input");
			setGolf.g.green.push(_t.eq(1).val());//果岭价格
			setGolf.g.time.push(_t.eq(0).val());//每场事件
		})
	},
	findTag:function(n){//获取目标
		return $(setGolf.g.ts[n]).find("table").eq(0);
	},
	getTr:function(t,i){//获取目标tr或tr集合
		if(i){
			return t.find("tr").eq(2+i);
		}else{
			return t.find("tr").eq(2).nextAll("tr");
		}
	},
	addTr:function(i,n){//添加tr
		var tag = setGolf.findTag(i),
			tr = setGolf.getTr(tag),
			fn,ftr,_tmp;
		if(tr.length == n){
			return false;
		}else if(tr.length > n){
			fn = tr.length-(tr.length - n);
			ftr = setGolf.getTr(tag,fn);
			setGolf.destroy(tag);
			ftr.nextAll().remove();
			setGolf.bindInput(tag);
		}else{
			fn = n - tr.length;
			ftr = setGolf.getTr(tag,fn);
			_tmp="";
			for(var i =0;i<fn;i++){
				_tmp+=setGolf.g.tr(i);
			}
			tag.append(_tmp);
			setGolf.bindInput(tag);
		}
		
		if(setGolf.g.total){
			setGolf.liquidate();
		}
	},
	bindInput:function(t){//页面input元素绑定
		var gI;
		if(t){
			gI = t.find("input");
			gI.unbind();
			gI.bind("click",function(){
				if($(this).attr("chk") == "1"){
					$(this).removeAttr("chk");
					$(this).attr("checked",false);
				}else{
					gI.removeAttr("chk");
					$(this).attr("chk","1");
					$(this).attr("checked",true);
				}
				setGolf.liquidate();
			})
			
			gI.bind("change",function(){
				setGolf.liquidate();
			})
		}else{
			gI = setGolf.g.box.find("input");
			gI.bind("click",function(){
				if($(this).attr("chk") == "1"){
					$(this).removeAttr("chk");
					$(this).attr("checked",false);
				}else{
					gI.removeAttr("chk");
					$(this).attr("chk","1");
				}
				setGolf.liquidate();
			})
			gI.bind("change",function(){
				setGolf.liquidate();
			})
		}
	},
	bindEles:function(){//事件绑定
		$.each(setGolf.g.sler,function(i,n){
			$(this).bind("change",function(){
				setGolf.addTr(i,$(this).val());
			})
		})
		if(setGolf.g.total){
			setGolf.bindInput();
		}
		setGolf.g.sb.bind("click",function(){
			if (setGolf.g.total) {
				setGolf.g.form.submit(function(){
					return setGolf.setJson();
				})
			}else{
				setGolf.g.form.submit(function(){
					return false;
				})
				setGolf.setJson();
				setGolf.g.form.ajaxForm(function() {
					setGolf.destroy();
		            if(setGolf.g.cc){
						setGolf.g.callBack();
					}
		        });
			}
		})
	},
	setJson:function(){//json生成
		var _k,trs,mans = [],gTmp ="";
		setGolf.g.tArr=[];
		setGolf.g.ground=[];
		$.each(setGolf.g.ts,function(i,n){//每场的选择
			var tt = setGolf.findTag(i),sn = i,key = i+1;
			mans = setGolf.getTr(tt);
			setGolf.g.tGr=[];
			
			$.each(mans,function(i,n){//美人
				setGolf.g.round = [];
				var s =$(this).find("input:checked"),tmp = "";
				
				if(s.length > 0){
					$.each(s, function(ii, nn){//每场美人的数据
						tmp = "\"" + $(this).attr("json") + "\":\"" + $(this).val() + "\"";
						setGolf.g.tArr.push(tmp);
						if (ii == s.length - 1) {
							setGolf.g.round.push("{\"OpenBallTime\":\"" + setGolf.g.time[sn] + "\",\"GFN_CourtFee\":\"" + setGolf.g.green[sn] + "\"," + setGolf.g.tArr.toString() + "}");
							setGolf.g.tGr.push(setGolf.g.round.toString());
							setGolf.g.tArr = [];
						}
					})
				}else{
					setGolf.g.round.push("{\"OpenBallTime\":\"" + setGolf.g.time[sn] + "\",\"GFN_CourtFee\":\"" + setGolf.g.green[sn] + "\"}");
					setGolf.g.tGr.push(setGolf.g.round.toString());
					setGolf.g.tArr = [];
				}
			})
			
			gTmp ="{\"Key\":"+ key+",\"Value\":["+setGolf.g.tGr.toString()+"]}";//每场数据生成
			setGolf.g.ground.push(gTmp);
		})
		setGolf.g.jsonPort.val("["+setGolf.g.ground.toString()+"]");
		if (setGolf.g.total) {
			setGolf.destroy();
			//return false;
			return true;
			if(setGolf.g.cc){
				setGolf.g.callBack();
			}
		}
	},
	liquidate:function(){//清算
		var allPrice = 0,
			nowChk = setGolf.g.box.find("input:checked");
		$.each(setGolf.g.green,function(i,n){
			allPrice += parseFloat(n)*setGolf.g.sler.val();
		})
		$.each(nowChk,function(){
			allPrice += parseFloat($(this).val());
		})
		if(setGolf.g.total){
			setGolf.g.total.html("&yen;&nbsp;" + allPrice)
		}
	},
	inntGolf:function(){//初始化
		setGolf.setOp();
		setGolf.bindEles();
		if(setGolf.g.total){
			setGolf.liquidate();
		}
	},
	destroy:function(d){
		if(d){//单场input事件回收
			d.find("input").unbind();
		}else{//全场input事件回收
			setGolf.g.box.find("input").unbind();
			setGolf.g.box.find("select").unbind();
		}
	}
}),
sideScroll = Class($_$, {
    creat: function(balls, cb) {
        this.balls = balls;
        sideScroll.roll = this.balls;
        if (cb) {
            sideScroll.roll.callBack = cb;
            sideScroll.roll.cbCtrl = 1;
        }
    },
    rollBox: function() {
        sideScroll.roll.rollTag = $(sideScroll.roll.rId);
        sideScroll.roll.leftP = Math.ceil(($("body").innerWidth() - sideScroll.roll.mW) / 2);
        sideScroll.roll.whiteSp = ($("body").innerWidth() - sideScroll.roll.mW) / 2;
    },
    bottomS: function() {
        return Math.ceil(document.documentElement.scrollTop + document.documentElement.clientHeight * 0.85);
    },
    rightP: function() {
        var rP;
        if ($.support.opacity == true) {
            rP = Math.ceil(sideScroll.roll.mW + ($("body").innerWidth() - sideScroll.roll.mW) / 2);
        } else {
            rP = Math.ceil(sideScroll.roll.mW + ($("body").innerWidth() - sideScroll.roll.mW) / 2 + 8);
        }
        return rP;
    },
    scrollInnt: function() {
        sideScroll.rollBox();
        sideScroll.roll.rollTag.css("top", sideScroll.bottomS() + "px");
        if (sideScroll.roll.pisition == "left") {
            sideScroll.roll.rollTag.removeAttr("style");
            sideScroll.roll.rollTag.css({
                left: sideScroll.roll.leftP + "px"
            });
        }
        if (sideScroll.roll.pisition == "right") {
            sideScroll.roll.rollTag.removeAttr("style");
            sideScroll.roll.rollTag.css({
                left: sideScroll.rightP() + "px"
            });
        }
        sideScroll.roll.rollTag.show();

        if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
            $(window).scroll(function() {
                sideScroll.rollItem();
            })
        }
        sideScroll.roll.rollTag.click(function() {
            window.scroll(0, 0);
        })
        if (sideScroll.roll.cbCtrl) {
            sideScroll.roll.callBack();
        }
    },
    rollItem: function() {
        sideScroll.roll.rollTag.animate({ opacity: "hide" });
        sideScroll.roll.nowBottom = sideScroll.bottomS();
        sideScroll.roll.intRoll = setInterval(function() {
            var tm = sideScroll.bottomS();
            if (tm != sideScroll.roll.nowBottom) {
                sideScroll.roll.nowBottom = tm;
            } else {
                clearInterval(sideScroll.roll.intRoll);
                var ot = setTimeout(function() {
                    clearTimeout(ot);
                    sideScroll.roll.rollTag.css("top", sideScroll.bottomS() + "px");
                    sideScroll.roll.rollTag.animate({ opacity: "show" });
                    sideScroll.roll.intRoll = null;
                    sideScroll.roll.nowBottom = null;
                    ot = null;
                }, 500)

            }
        }, 1500)
    }
}),
ajaxGetImg = Class($_$,{
	creat:function(imgdata){
		this.imgdata = imgdata;
		ajaxGetImg._img = this.imgdata;
	},
	inntImg:function(){
		var imgNode=$("#"+ajaxGetImg._img.titleNode);
		
		ajaxGetImg.titleChange(imgNode[0],imgNode,"0");
		
		for (var i=0;i<imgNode.length ;i++ )
		{			
			eval("imgNode[i].onclick=function(){clearInterval(ajaxGetImg._img.timer);ajaxGetImg.titleChange(this,imgNode,"+i+");}");
		}
	},
	titleChange:function(node,imgNode,i){
		imgNode.removeClass("act");
		ajaxGetImg.addClassName(node,"act")
		ajaxGetImg.contentChange(imgNode,i);
		
		if(ajaxGetImg._img.autoChange){
			ajaxGetImg._img.temp=Number(i)+1;
			if(ajaxGetImg._img.temp >= imgNode.length){ ajaxGetImg._img.temp=0};
			ajaxGetImg._img.timer =window.setTimeout(ajaxGetImg._titleChange(imgNode[ajaxGetImg._img.temp],imgNode,ajaxGetImg._img.temp),4000);
		}
	},
	_titleChange:function(node,imgNode,i){return function(){ajaxGetImg.titleChange(node,imgNode,i);}},
	contentChange:function(imgNode,i){
		
		if(!$("#"+ajaxGetImg._img.contentId+"_"+i).html()){
		  ajaxGetImg.getImgData(imgNode[i].id,i);
		}
		else{
		  ajaxGetImg.contentClassChange(i);
		}

	},
	contentClassChange:function(i){
		switch(ajaxGetImg._img.type){
					case 'img': 
					
						$("#"+ajaxGetImg._img.contentId).children("div[id]").addClass("none");
						$("#"+ajaxGetImg._img.contentId).animate({
						opacity:"hide"
						},1,function(){
								$("#"+ajaxGetImg._img.contentId+"_"+i).removeClass("none");
								$("#"+ajaxGetImg._img.contentId).animate({
								opacity:"show"
							},800,function(){})
						});
						break;
				
					case 'list':
						$("#"+ajaxGetImg._img.contentId).children("div[id]").addClass("none");
						$("#"+ajaxGetImg._img.contentId+"_"+i).removeClass("none");
						break;
					default: return false;
				}
		
			
	},
	getImgData:function(id,i){
		$.ajax({
			type:"GET",
			url:ajaxGetImg._img.ajaxUrl+id,
			dataType: "json",
	        data: '',
			cache:false,
			error:function(){
				return;
			},
			success:function(html){
				var imgHtml="";
				
				switch(ajaxGetImg._img.type){
					case 'img': imgHtml+='<a href="'+html.pic[0].link+'" target="_blank"><img src="/images/blank.gif" lang="'+html.pic[0].url+'" alt="'+html.pic[0].title+'"></a><p><a href="'+html.pic[0].link+'" target="_blank">'+html.pic[0].title+'</a></p>';break;
				
					case 'list':
						for (var z=0;z<html.pic.length;z++){
							imgHtml+='<div class="'+ajaxGetImg._img.contentClassName+'"><a href="'+html.pic[z].link+'" target="_blank"><img src="images/blank.gif" lang="'+html.pic[z].url+'" alt="'+html.pic[z].title+'"></a><p><a href="'+html.pic[z].link+'" target="_blank">'+html.pic[z].title+'</a></p></div>'
						}
						break;
					default: return false;
				}
				$("#"+ajaxGetImg._img.contentId).prepend('<div id="'+ajaxGetImg._img.contentId+'_'+i+'">'+imgHtml+'</div>'); 
				autoLoadImg();
				ajaxGetImg.contentClassChange(i);
			}
		})
	},
	addClassName:function(element, className){
		if (!element){ return;}
		var elementClassName = element.className;
		if (elementClassName.length == 0)
		{
			element.className = className;
			return;
		}
		else 
		{	
			element.className = elementClassName + " " + className;
			return;
		}
	},
	_img:{titleNode:"",contentId:"",type:"",autoChange:"",contentClassName:"",timer:"",temp:"",ajaxUrl:""}
}),
topImgChange = Class($_$,{
	creat:function(imgdata){
		this.imgdata = imgdata;
		topImgChange._img = this.imgdata;
	},
	inntImg:function(){
		var imgNode=$("#"+topImgChange._img.imgNode);
		var titleNode=$("#"+topImgChange._img.titleNode);
		topImgChange._img.temp=-1;
		_$('num').innerHTML=imgNode.length;
		_$(topImgChange._img.leftAr).onclick= function(){clearInterval(topImgChange._img.timer);topImgChange.imgContentChange(imgNode,titleNode,'-');};
		_$(topImgChange._img.rightAr).onclick= function(){clearInterval(topImgChange._img.timer);topImgChange.imgContentChange(imgNode,titleNode);};
		topImgChange.imgContentChange(imgNode,titleNode);
		
	},	
	imgContentChange:function(imgNode,titleNode,add){
		
		if(add=="-"){topImgChange._img.temp=topImgChange._img.temp-1;}
		else{topImgChange._img.temp=topImgChange._img.temp+1;}
		if(topImgChange._img.temp>= imgNode.length){ topImgChange._img.temp=0};
		if(topImgChange._img.temp<0){ topImgChange._img.temp=imgNode.length-1};
		titleNode.addClass('none');
		imgNode.addClass('none');
		_$('temp').innerHTML=topImgChange._img.temp+1;
		$("#"+topImgChange._img.imgNode).parent().animate({
			opacity:"hide"
		},1,function(){
			imgNode[topImgChange._img.temp].className="";
			titleNode[topImgChange._img.temp].className="";
			$("#"+topImgChange._img.imgNode).parent().animate({
				opacity:"show"
			},800,function(){})
		});
		
		topImgChange._img.timer =window.setTimeout(topImgChange._imgContentChange(imgNode,titleNode),5000);
		
	},
	_imgContentChange:function(imgNode,titleNode){return function(){topImgChange.imgContentChange(imgNode,titleNode);}},
	_img:{imgNode:"",titleNode:"",leftAr:"",rightAr:"",temp:"",timer:""}
}),
imgScroll = Class($_$,{
	creat:function(imgdata){
		this.imgdata = imgdata;
		imgScroll._img = this.imgdata;
	},			  
	inntImg:function(){
		var imgSrc=$(imgScroll._img.imgScrollId),
			scrollNode=$(imgScroll._img.scrollNode),
			upNode=$(imgScroll._img.up),
			downNode=$(imgScroll._img.down);
			
		imgScroll._img.nodeHeight=scrollNode.outerHeight(true);
		
		for(var i=0;i<scrollNode.length;i++){
			if(scrollNode[i].className==imgScroll._img.node){
				imgScroll._img.nodeNow=i;
				break;
			}
		}
		if(scrollNode.length<3){}
		else{
		switch(imgScroll._img.nodeNow){
								case 0: imgSrc.css("top","0px");
										downNode.removeClass('downOff');			
										downNode.addClass('down');	
										downNode.click( function () {location.href = scrollNode[imgScroll._img.nodeNow+1].firstChild.href;});
										break;
								
								case scrollNode.length-1: imgSrc.css("top","-"+imgScroll._img.nodeHeight*(imgScroll._img.nodeNow-2)+"px");
														  upNode.removeClass('upOff');			
														  upNode.addClass('up');	
													      upNode.click( function () {location.href = scrollNode[imgScroll._img.nodeNow-1].firstChild.href;});
									 					  break;
								
								default:imgSrc.css("top","-"+imgScroll._img.nodeHeight*(imgScroll._img.nodeNow-1)+"px"); 
										upNode.removeClass('upOff');			
										upNode.addClass('up');	
										upNode.click( function () {location.href = scrollNode[imgScroll._img.nodeNow-1].firstChild.href;});
										downNode.removeClass('downOff');			
										downNode.addClass('down');	
										downNode.click( function () {location.href = scrollNode[imgScroll._img.nodeNow+1].firstChild.href;});
										break;
							}
		}
	},	
	_img:{imgScrollId:"",scrollNode:"",node:"",nodeHeight:"",nodeNow:"",up:"",down:""}
}),
reply = Class($_$,{
	creat:function(data){
		this.data = data;
		reply._rep = this.data;
	},			  
	inntreply:function(){
		//alert(reply._rep.replyId);
		showPop('hDetail',600,'black','aa');
		_$(reply._rep.replyId).onclick=function (){

			if(_$(reply._rep.replyText).value==''){alert('请填写回复内容');return;}
			
			reply.replyAjax();
		}
	},	
	replyAjax:function(){
	
	   $.ajax({
		   type: "POST",
		   url: url,
		   data: _$(reply._rep.replyText).value,
		   error: function(){
			alet('ajaxerr');return false;
		   },
		   success: function(json){
			 if(json==0){return;}

			 var htm='<div class="replyBoxUp"><div class="replyBoxDown"><table><tbody><tr><td  class="w80"><a href="" title="">'+ _$(reply._rep.replyName).innerHTML+'</a></td><td>'+ _$(reply._rep.replyText).value+'</td></tr></tbody></table></div></div>'
			  $("#"+reply._rep.id).append(htm);
			  popDiv.hideBox('hDetail');
			  _$(reply._rep.replyText).value='';

		   }
	   });
	},
	_rep:{id:"",replyId:"",replyText:"",replyName:"",url:""}
}),
Login = Class($_$,{
	creat:function(L,callB){
		this.L = L;
		Login.logOp = this.L;
		Login.logOp.logType = -1;//登陆框类型标示，初始化为-1；
		if(callB){
			Login.logOp.callBack = callB;
			Login.logOp.cbCtrl = 1;
		}
	},
	getState:function(){
		if(Login.logOp.but != undefined && Login.logOp.but.className == "bookItFail"){
			return false;
		}
		
		if($(Login.logOp.but).parent().attr("id") == Login.logOp.tid){
			Login.logOp.logType = 0;//2009.11.05 改为只有弹出层方式登陆。
			//Login.logOp.logType = 1;//页头的登录框
		}else{
			Login.logOp.logType = 0;//弹出式登陆框
		}
		
		$(function(){
			if(Login.logOp.popCon){
				if(Login.logOp.popCon == 0){
					Login.getCon(Login.logSet.logUrl);//获取登录框
				}
				if(Login.logOp.popCon == 1){
					Login.getCon(Login.logSet.regUrl);//获取注册框
				}
			}else{
				Login.getCon(Login.logSet.logUrl);//获取内容，默认为登录框
			}
		})
	},
	getCon:function(_url){//获取内容方法
		$.ajax({
			type:"GET",
			url:_url,
			//data:dat,
			cache:false,
			error:function(){
				Login.logOp.con.html(O_o.FailMsgB);
			},
			success:function(html){
				
				//确保同时只有一个弹出层
				if(_$("popLogBox")){
					$("#popLogBox").remove();
				}
				if(!_$("popLogBox")){
					Login.logSet.logBox();
				}
				
				Login.logSet.setBox();//弹出层基本属性设定
				//Login.logOp.con.html(html);//插
				Login.logOp.con.append(html);
				
				if(_$("regBut")){
					Login.logOp.con.removeAttr("class");
					Login.logOp.con.addClass("newRegBox");
				}
				Login.logOp.loadBox = $("#isLoadding");
				var logInsite;
				if(Login.logOp.logType == 0){
					
					if(!_$("tMark")){
						popDiv.creatMark("#000",Login.logOp.dW,Login.logOp.dH,0.6);//遮罩创建
					}
					
					if($("#logInB").html() != null){
						$("#logInB").remove();
						Login.logOp.box.css({//登陆框显示设定
							margin:"-" + Login.logOp.box.outerHeight()/2 + "px 0 0 -"+ Login.logOp.box.outerWidth()/2 +"px",
							top:document.documentElement.scrollTop + document.documentElement.clientHeight/2 + "px",
							display:"block"
						});
						Login.logOp.remember = Login.logOp.box.find("input:checkbox");
						$("#popUserName").focus();
						$("#popUserName").css("border","1px solid #f90");
						
					}else{
						Login.logOp.box.find("p:first").attr("class","regTitle")
						Login.logOp.box.css({//注册显示设定
							margin:"-" + Login.logOp.box.outerHeight()/2 + "px 0 0 -"+ Login.logOp.box.outerWidth()/2 +"px",
							top:document.documentElement.scrollTop + document.documentElement.clientHeight/2 + "px",
							display:"block"
						});
						$("#user").focus();
						$("#user").css("border","1px solid #f90");
					}
				}
				if(Login.logOp.logType == 1){
					
					//内容设置
					Login.logOp.con.append($("#logInB").html())
					$("#logInA").remove();
					$("#logInB").remove();

					//登陆框显示
					var ev = Login.logOp.but,
						bH = $(ev).height(),
						bT = $(ev).offset().top,
						bL = $(ev).offset().left;
					popTypeArrow.setContent("popLogBox",Login.logOp.box,null,"nal",null,null,250,bH,bT,bL);
				}
				
				if(_$("logBut")){
					Login.bindLogBut();//登录界面各元素事件绑定
					$("#logBut").unload(function(){
						$("#regBut").find("*").unbind();
					})
				}
				
				if(_$("regBut")){
					Login.bindRegBut();
					$("#regBut").unload(function(){
						$("#regBut").find("*").unbind();
					})
					
				}
			}
		})
	},
	chkLogin:function(){//登录验证
		var isRemember;
		
		 isRemember = Login.logOp.remember.attr("checked") == true?1:0;
		
		Login.logOp.dat = "username="+ $("#popUserName").val() +"&password="+Login.logSet.md5 + "&remember="+isRemember;
		$.ajax({
			type:"GET",
			url:Login.logSet.chkUrl,
			data:Login.logOp.dat,
			cache:false,
			dataType:"json",
			error:function(){
				//Login.logOp.con.html(O_o.FailMsgB);
			},
			success:function(Re){
				if(Re.name != 0 && Re.name != undefined){//成功
				    $("#" + Login.logOp.tid).html(Re.name);
				    if (Login.logOp.lid) {
				        $("#" + Login.logOp.lid).html(Re.name);
					}
					
					if(Login.logOp.cbCtrl == 1){
						Login.logOp.loadBox.show();
						var st = function(){
							try {
								var ott;
								Login.logOp.callBack();
								ott = setTimeout(function(){
									clearTimeout(ott);
									Login.hideLogBox();
									Login.logOp.box.remove();
									return true;
								},1000);
								return false;
							}catch(e){
								return true;
							}
						}
						Login.logOp.isOk =  st();
					}else{
						Login.hideLogBox();
						Login.logOp.box.remove();
						Login.logOp.isOk = true;
					}
				}
				if (Re.name == undefined || Re.name == 0) {//失败
				    
					if(Login.logOp.logType == 0){
						if(Login.logOp.con.find("li").eq(0).find("span").length < 1){
							Login.logOp.con.find("li").eq(0).append(Login.logSet.someWrong);
						}
					}
					
					if(Login.logOp.logType == 1){
					    if (Login.logOp.box.find("i").length > 0) {
							//Login.logOp.box.find("i").html(Login.logSet.someWrongB);
							return false;
						}else{
							//Login.logOp.box.find("p:first").append(Login.logSet.someWrongB);
							return false;
						}
					}
				}
			}
		})
	},
	chkReg:function(){//注册验证
		Login.logOp.dat = "username="+ $("#user").val() +"&password="+ Login.logSet.md5;
		var regDat = Login.logOp.dat + "&email=" +$("#eMail").val();
		$.ajax({
			type:"GET",
			url:Login.logSet.chkRegUrl,
			data:regDat,
			cache:false,
			dataType:"json",
			error:function(){
				//Login.logOp.con.html(O_o.FailMsgB);
			},
			success:function(Re){
				if(Re != 0){//成功
					$("#" + Login.logOp.tid).html(Re.name);
					if(Login.logOp.lid != undefined){$("#" + Login.logOp.lid).html(Re.name);}
					Login.hideLogBox();
					Login.logOp.box.remove();
					
					if(Login.logOp.cbCtrl == 1){
						Login.logOp.loadBox.show();
						var st = function(){
							try {
								var ott;
								Login.logOp.callBack();
								ott = setTimeout(function(){
									clearTimeout(ott);
									Login.hideLogBox();
									Login.logOp.box.remove();
									return true;
								},1000);
								return false;
							}catch(e){
								return true;
							}
						}
						Login.logOp.isOk =  st();
					}else{
						Login.hideLogBox();
						Login.logOp.box.remove();
						Login.logOp.isOk = true;
					}
				}
				if(Re == 0){//失败
					alert(O_o.postFail);
					Login.hideLogBox();
					Login.logOp.box.remove();
				}
			}
		})
	},
	hideLogBox:function(){//关闭事件
		Login.logOp.box.hide();
		try{
			Login.logOp.box.find("*").unbind();
		}finally{
			if(_$("tMark")){$("#tMark").remove();}
			if(_$("shadow")){$("#shadow").remove();}
		}
	},
	bindLogBut:function(){//登录元素事件
		$("#logBut").click(function(){
			Login.getMD("popPassWord","Login.chkLogin()");
		})
		
		$("#popPassWord").keyup(function(event){
			Login.autoSumit(event);
		})
		
		Login.logOp.box.find("li input").focus(function(){
			$(this).css("border","1px solid #f90");
		})
		
		Login.logOp.box.find("li input").blur(function(){
			$(this).removeAttr("style");
		})
		
		$("#regNow").click(function(){
			Login.getCon(Login.logSet.regUrl);
		})
	},
	autoSumit:function(e){
		var key = window.event ? e.keyCode : e.which;
        if (key == 13) {
			Login.getMD("popPassWord","Login.chkLogin()");
        }
	},
	getMD:function(id,fn){
		$.get(Login.logSet.mdUrl,"password="+$("#" + id).val(),function(data){
			Login.logSet.md5 = data;
			eval(fn);
		});
	},
	bindRegBut:function(){//注册元素事件
		var users = $("#user"),
			uCheck = $("#userCheck"),
			pws = $("#password"),
			pwsD = $("#passwordo"),
			pCheck = $("#passwordCheck"),
			eMail = $("#eMail"),
			eCheck = $("#eMailCheck"),
			regNut = $("#regBut")
		
		
		Login.logOp.box.find("li input").focus(function(){
			$(this).css("border","1px solid #f90");
		})
		
		Login.logOp.box.find("li input").blur(function(){
			$(this).removeAttr("style");
		})
		
		users.blur(function(){
			var userName = trim(users.val());
			
		    if (userName.length < 6 || userName.length > 20) {
				uCheck.html("<b class='cff2200'>"+O_o.nameLenFail+"</b>");
		        return false;
		    }
			
		    var myreg = /^([a-z0-9]+[_|\_|\.|\-]?)+[a-z0-9]$/;
		    if (!myreg.test(userName)) {
				uCheck.html("<b class=\"cff2200\">"+O_o.nameInvalid+"</b>");
		        return false;
		    }else {
				uCheck.html("");
		    }
			
		    $.ajax({
		        type: "GET",
		        url: "../ajax/RegisterCheckUserName.ashx?username=" + encodeURI(userName),
		        error: function(){
		            return false;
		        },
				async:false,
		        success: function(sn){
		            if (sn == 0) {
						uCheck.html("<b class=\"cff2200\">"+O_o.nameExists+"</b>");
						Login.logSet.unExists = 1;
						users.focus();
		                return false;
		            }else if (sn == 1) {
						Login.logSet.unExists = 0;
		               uCheck.html("");
		            }
		        }
		    })
		})
		
		pws.blur(function(){
			return false;//2009.12.15取消密码强度验证
			if(pws.val() == ""){
				pCheck.html("<b class=\"cff2200\">"+O_o.noUserPws+"</b>");
				return false;
			}
			if (trim(pws.val()).length < 6 || trim(pws.val()).length > 18) {
		        _$('passwordTest').innerHTML = "<b class='cff2200'>"+O_o.pwsLenFail+"</b>";
		        return false;
		    }
		    /*
			else if (!chkpwd('password')) {
		        return false;
		    }
			*/
		    $("#passwordTest").html("");
		    return true;
		})
		
		pwsD.blur(function(){
			if(trim(pwsD.val())!= trim(pws.val())){
				pCheck.html("<b class=\"cff2200\">"+O_o.pwsNoMath+"</b>");
				return false;
			}
			pCheck.html("");
			return true;
		})
		
		eMail.blur(function(){
		    var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		    if (!myreg.test($(this).val())) {
				eCheck.html("<b class='cff2200'>"+O_o.emailFail+"</b>");
		        return false;
		    }
		    eCheck.html("")
		})
		
		$("#regBut").click(function(){
			
			if(Login.logSet.unExists == 1){
				return false;
			}

			var userName = trim(users.val());
			
		    if (userName.length < 6 || userName.length > 20) {
				uCheck.html("<b class='cff2200'>"+O_o.nameLenFail+"</b>");
		        return false;
		    }
			
		    var myreg = /^([a-z0-9]+[_|\_|\.|\-]?)+[a-z0-9]$/;
		    if (!myreg.test(userName)) {
				uCheck.html("<b class=\"cff2200\">"+O_o.nameInvalid+"</b>");
		        return false;
		    }else {
				uCheck.html("");
		    }
			
			if(trim(users.val()) == ""){
				alert(O_o.noUserName);
				return false;
			}
			if(trim(pws.val()) == ""){
				alert(O_o.noUserPws);
				return false;
			}
			
			if(pws.val() == ""){
				pCheck.html("<b class=\"cff2200\">"+O_o.noUserPws+"</b>");
				return false;
			}
			if (trim(pws.val()).length < 6 || trim(pws.val()).length > 18) {
		        _$('passwordTest').innerHTML = "<b class='cff2200'>"+O_o.pwsLenFail+"</b>";
		        return false;
		    }
		    /*
			else if (!chkpwd('password')) {
		        return false;
		    }
			*/
			
			if(trim(pwsD.val()) == ""){
				//alert(O_o.noPwsMath);
				return false;
			}
			
			if(trim(pwsD.val())!= trim(pws.val())){
				pCheck.html("<b class=\"cff2200\">"+O_o.pwsNoMath+"</b>");
				return false;
			}
			
			if(trim(eMail.val()) == ""){
				//alert(O_o.noEmail);
				return false;
			}
			
			var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		    if (!myreg.test(eMail.val())) {
				eCheck.html("<b class='cff2200'>"+O_o.emailFail+"</b>");
		        return false;
		    }
			if($("#checkbox").attr("checked") ==false){
				alert(O_o.chkCitsInfo);
				return false;
			}
			Login.getMD("password","Login.chkReg()");
		})
		
		$("#loginNow").click(function(){
			Login.getCon(Login.logSet.logUrl);
		})
	},
	logSet:{
		chkLog:function(){//登录验证，未登录为true，已登录为false；
			if($("#" + Login.logOp.tid).html().indexOf("loger") != -1){
				return true;
			}
			return false;
		},
		logBox:function(){//弹出层结构
			var box;
			
			if(Login.logOp.logType == 0){
				box = "<div id=\"popLogBox\" class=\"newLoginBox\"><span class=\"newCloseLoging\" id=\"closeLogBox\" title=\"close\"></span></div>";
			}
			if(Login.logOp.logType == 1){
				box = "<div class=\"logBox\" id=\"popLogBox\"><p>"+ O_o.loginTitle +"</p><span id=\"closeLogBox\" title=\"close\"></span><div id=\"LogTagBox\"></div><b></b></div>"
			}
			$("body").append(box);
		},
		setBox:function(){//基本属性设置
			Login.logOp.box = $("#popLogBox");
			//Login.logOp.con = $("#LogTagBox");
			Login.logOp.con = $("#popLogBox");
			Login.logOp.dW = document.body.scrollWidth;
			Login.logOp.dH = $(document).height();
			$("#closeLogBox").click(function(){
				Login.hideLogBox();
			});
		},
		logUrl:"/demo/login/logInsite.html",
		regUrl:"/demo/login/regInsite.html",
		chkUrl:"/Ajax/Login.aspx",
		chkRegUrl: "/Ajax/register.aspx",
		mdUrl:"/Ajax/secret.aspx",
		someWrong:"<span class=\"cff2200\">"+ O_o.FailMsgD +"</span>",
		someWrongB:"<i class=\"ml10 cff2200\">"+ O_o.FailMsgD +"</i>"
	},
	logOp:{tid:"",but:"",lid:"",con:"",box:""}
}),
sendBoom = Class(Login, {//Login派生类，用以传递ooxx;
    creat: function(_u, c) {
        this._u = _u;
        sendBoom.bob = this._u;
        if (c) {
            sendBoom.bob.cc = 1;
            sendBoom.bob.cb = c;
        }
    },
    sendIt: function() {
        var c = 0;
        $(document).ajaxComplete(function() {
            c += 1;
        })
        $.each(sendBoom.bob.url, function(i, n) {

            //$.get(n,Login.logOp.dat);
            $.getJSON(n + "?" + Login.logOp.dat + "&jsoncallback=?", function(r) {
                try {
                    return true
                } catch (e) {
                    return true
                }
            })
            if (i == sendBoom.bob.url.length - 1) {

                var ott;
                ott = setTimeout(function() {
                    clearTimeout(ott);
                    ott = null;
                    if (Login.logOp.but && $(Login.logOp.but).attr("href") != undefined) {
                        if ($(Login.logOp.but).attr("href").indexOf("javascript") == -1) {
                            window.location.href = $(Login.logOp.but).attr("href");
                            return true;
                        }
                    }
                    if (sendBoom.bob.cc) {
                        sendBoom.bob.cb();
                    }

                }, 1000);

            }
        });
        //alert(Login.logOp.but.href)
    },
    bob: { url: [] }
}),
//vid:'roomID',evn:this,vals:239,sDay: '2009-11-07' ,eDay:'2009-11-14' ,aUrl:'../Ajax/Hotel/hotelCalendar.aspx',bUrl:'asd'
calenders = Class($_$,{
	creat:function(ca){
		this.ca = ca;
		calenders.calOp = this.ca;
		calenders.calOp.boxBody = "<div class=\""+ O_o.calenderSet.mainClas +"\"><p class=\""+ O_o.calenderSet.barClass +"\">"+O_o.checkIn+"<input type=\"text\" onclick=\""+ O_o.calenderSet.checkInFn +"\" class=\""+ O_o.calenderSet.dateInput +"\" id=\"checkInCal\"/>"+ O_o.checkOut +"<input type=\"text\" onfocus=\""+ O_o.calenderSet.checkOutFn +"\" class=\""+ O_o.calenderSet.dateInput +"\" id=\"checkOutCal\"/><span><input type=\"button\" value=\""+ O_o.regSearch + "\" class=\""+ O_o.calenderSet.sumitBut +"\" onclick=\"showCalenderAg()\" /></span><input onclick=\"bookHotel()\" class=\"smallBook\" type=\"button\" value=\"\" /></p><div id=\"dateTable\" class=\""+ O_o.calenderSet.calBox +"\"></div></div>";
	},
	inntCal:function(){
		if($("div[pop='pop']") && $("div").attr("id") != "citsPop"){
			$("div[pop='pop']").hide();
		}
		
		//calenders.calOp.d = $(document).width();
		//calenders.calOp.p = Math.ceil((calenders.calOp.d-960)/2);
		
		if(calenders.calOp.vid != "" || calenders.calOp.vid != undefined){
			shower({
				oid:null,
				evn:calenders.calOp.evn,
				set:{type:'ajax|GET',showType:'arrow',cls:['newPopBox','newArrow','newClosePop'],bStyle:'width:550px;'},
				bPath:calenders.calOp.aUrl + "?HGRP_GuestRoomID=" + calenders.calOp.vals + "&s_date=" + calenders.calOp.sDay + "&e_date=" + calenders.calOp.eDay
			},function(){
				calenders.calOp.tBox = $("#citsPop");
				calenders.calOp.tBox.append(calenders.calOp.boxBody);
				$("#checkInCal").val(calenders.calOp.sDay);
				$("#checkOutCal").val(calenders.calOp.eDay);
				calenders.opSet.vT();
				$("#dateTable").append(calenders.calOp.tBox.find("table").eq(0));
				calenders.tdEven();
			})
		}
	},
	opSet:{
		vT:function(){
			$("#" + calenders.calOp.vid).val(calenders.calOp.vals);
		},
		_T:function(){
			return $("#calender");
		},
		_TC:function(){
			return $("#dateTable");
		}
	},
	tdEven:function(ele){
		
		var eles;
		if(ele){
			eles = ele;
		}else{
			
			eles = $("#dateTable td");
			
		}
		
		eles.hover(
			function(){
				var bs = $(this).find("b"),mt = _$("citsPop") == null?"dateTable":"citsPop",tt,tl;
				if(bs.length > 0){
					
					if($("#"+mt).css("position") == "static"){
						tt = 0;
						tl = 0;
					}else{
						tt = parseInt($("#"+mt).css("top"));
						tl = parseInt($("#"+mt).css("left"));
					}
					
					var bw = $("#"+mt).outerWidth(),
						bsw = bs.outerWidth(),
						l = $(this).offset().top - tt + $(this).height()-5,
						t = $(this).offset().left - tl + $(this).width()/2;
					
					if(bsw+t > bw){
						t = $(this).offset().left - tl + $(this).width() - bsw;
					}
					
					bs.css({
						top:l + "px",
						left:t + "px",
						display:"block"
					})
				}
			},
			function(){
				var bs = $(this).find("b");
				if(bs.length > 0){
					bs.css("display","none");
				}
			}
		)
	}
}),
outterBfEven = Class(calenders,{
	creat:function(){},
	inntEven:function(){
		if("dateTable"){
			calenders.tdEven();
		}
	}
}),
calBookHotel = Class(calenders,{
	creat:function(){},
	getBook:function(){
		var urlStr ="../order/hotel-order-step1.aspx?HGRP_GuestRoomID=" + calenders.calOp.vals + "&s_date=" + $("#checkInCal").val() + "&e_date=" + $("#checkOutCal").val();
		
		if ($("#topLog").html().indexOf("loger") != -1) {

			loger({
				tid:"topLog",but:calenders.calOp.evn
				},function(){
					sendUrl({url:O_o.logUrl});
					window.location.href=urlStr;
				}
			) 
	
	    }else{
			window.location.href=urlStr;
		}
	}
}),
chkAgainDate = Class(calenders,{
	creat:function(ag){
		this.ag = ag;
		chkAgainDate.agOp = this.ag;
	},
	doAgain:function(){
		$.ajax({
			type: "GET",
			url: calenders.calOp.aUrl + "?HGRP_GuestRoomID=" + calenders.calOp.vals + "&s_date=" + $("#checkInCal").val() + "&e_date=" + $("#checkOutCal").val(),
			error: function(){
				alert(O_o.FailMsgE);
			},
			success: function(msg){
			    calenders.opSet._TC().html(msg);
				calenders.tdEven();
			}
		})
	},
	agOp:{}
}),
realTxt = Class($_$,{
	creat:function(t){
		this.t = t;
		realTxt.tOp = this.t;
	},
	setIt:function(){
		var boxs = realTxt.tOp.box,eles = realTxt.tOp.ele;
		realTxt.Eye = {};
		realTxt.Eye.eleArr = [];
		if(typeof(boxs) == "object"){
			realTxt.Eye.idArr = [];
			for(var _a = 0;_a < boxs.length;_a++){
				realTxt.Eye.idArr.push(boxs[_a]+ "ID");
				realTxt.Eye.eleArr.push($("#" + boxs[_a]).find(eles));
			}
		}
		realTxt.eleInnt();
		realTxt.elebind();
	},
	eleInnt:function(){
		$.each(realTxt.tOp.box,function(i,n){
			var tI = $("#" + n + "ID").val();
			$("#" + n + tI).addClass(realTxt.tOp.Cls);
		})
	},
	elebind:function(){
		$.each(realTxt.Eye.eleArr,function(i){
			var _i = i;
			$.each(this,function(){
				$(this).click(function(){
					var tmpId = $(this).attr("id");
					$("#" + realTxt.Eye.idArr[_i]).val($(this).attr("id").match(/\d+/));
					$("#" + realTxt.tOp.page).val(1);
					if(tmpId.indexOf("city") != -1){
						$("#liveID").val(0);
					}
					if($("#hotelName").val()!=""){
						$("#hotelName").val("");
					}
					if(realTxt.tOp.f != undefined){
						$("form").eq(realTxt.tOp.f).submit();
					}else{
						$("form").eq(0).submit();
					}
				});
			})
		})
	}
}),
//sid:"thisSs",pt:"span",sm:"b",cls:"act"
setKeyWord = Class($_$,{//2009.12.03作废
	creat:function(o){
		this.o = o;
		setKeyWord.x = this.o;
	},
	setInt:function(){
		setKeyWord.bindEle()
	},
	bindEle:function(){
		var eles = $("#" + setKeyWord.x.sid + " " +setKeyWord.x.pt),
			sb = $("#" + setKeyWord.x.sid + " " +setKeyWord.x.sm);
		eles.click(function(){
			var keys = $(this).attr("key");
			if (keys == "hotelName"){
				$("#" + keys).val("");
			}else{
				var _tt = $("#" + keys.toLowerCase()).parent();
				$("#" + keys.toLowerCase()).removeAttr("class");
				
				if(realTxt.tOp.ele){
					_tt.find(realTxt.tOp.ele).eq(0).addClass(setKeyWord.x.cls);
				}else{
					_tt.find("a").eq(0).addClass(setKeyWord.x.cls);
				}								
				if(_tt.attr("id") == "city"){
					$("#live").remove();
				}
				$("#" + _tt.attr("id").toLowerCase()+"ID").val(0);
			}
			$(this).remove();
		})
		
		sb.click(function(){
			if(realTxt.tOp.f){
				$("form").eq(realTxt.tOp.f).submit();
			}else{
				$("form").eq(0).submit();
			}
		})
	}
}),
orderBy = Class(realTxt,{
	creat:function(o){
		this.o = o;
		orderBy.oop = this.o;
	},
	inntOrder:function(o){
		if(o && orderBy.oop == undefined){
			this._o = o;
			orderBy.oop = this._o;
		}
		//orderBy.oop.orderTmp = $("#" + orderBy.oop.oid).val().split(",");
		//$("#" + orderBy.oop.orderTmp[0]).attr("class",orderBy.oop.orderTmp[1]);
		orderBy.bindOrderBut();
	},
	bindOrderBut:function(){
		$.each(orderBy.oop.oList.did,function(ii,nn){
			$("#"+nn).click(function(){
				var tCls = $(this).attr("class");
				if(tCls.indexOf("TureDown")!= -1){
					if(tCls.indexOf("TureUp") == -1){
						$(this).attr("class",nn + orderBy.oop.oList.clsT[0]);
						
						$("#" + orderBy.oop.oid).val($(this).attr("id")+","+nn + orderBy.oop.oList.clsT[0]);
						
					}else{
						$(this).attr("class",nn + orderBy.oop.oList.clsT[1]);
						$("#" + orderBy.oop.oid).val($(this).attr("id")+","+nn + orderBy.oop.oList.clsT[1]);
					}
				}else{
					var did = orderBy.oop.oList.did;
					$.each(did,function(iii,nnn){
						$("#" + nnn).attr("class",nnn + orderBy.oop.oList.clsT[2])
					})
					$(this).attr("class",nn + orderBy.oop.oList.clsT[1]);
					$("#" + orderBy.oop.oid).val($(this).attr("id")+","+nn + orderBy.oop.oList.clsT[1]);
				}
				$("#aspxPost").submit();
			})
		})
	}
}),
Autobots = Class($_$, {
    creat: function(ro) {
        this.ro = ro;
        Autobots.carport = this.ro;
        Autobots.part = {};
        Autobots.part.where = "hide";
        Autobots.part.type = "hotel";
        Autobots.part.pp = -1;
        Autobots.part.num = 0;
        Autobots.part.pakage = null;
        Autobots.part.body = "<div style=\"display: none;\" id=\"Autobots\"><ul></ul></div>";
        if (typeof (Autobots.carport.tid) == "object") {
			Autobots.part.Eyes = [];
			Autobots.part.tBox = [];
			$.each(Autobots.carport.tid,function(i,n){
				$("#" + n[0]).attr("robot",i);
				$("#" + n[1]).attr("robot",i);
				Autobots.part.Eyes.push($("#" + n[0]));
				Autobots.part.tBox.push($("#" + n[1]));
			});
        } else {
            Autobots.part.Eyes = $("#" + Autobots.carport.tid);
        }
    },
    GoGo: function() {
		
        if (!_$("Autobots")) {
            $(document).ready(function(){
				$("body").append(Autobots.part.body);
            Autobots.part.Name = $("#Autobots");
            Autobots.part.Name.attr("class", Autobots.carport.Coating[0]);
			})
        };
		
		$.each(Autobots.part.Eyes,function(){
			
			$(this).keyup(function(event) {
				
	            if ($(this).val().length == 0) {
	                Autobots.hideRobot();
	                return false;
	            }
	            Autobots.getWord(encodeURI($(this).val()), event,$(this).attr("robot"));
	            Autobots.keyHandler(event,$(this).attr("robot"));
	        })
			
			$(this).blur(function(){
				Autobots.part.where = "hide";
				Autobots.part.Name.animate({
					opacity: "hide"
				}, "fast")
				$("#shadow").animate({
						opacity: "hide"
					}, "fast", function() {
						$("#shadow").remove();
				})
			})
		})
		
    },
    getWord: function(w, e,n) {
        var _kk = window.event ? e.keyCode : e.which;
        if (_kk == 9 || _kk == 13 || _kk == 38 || _kk == 40) {
            return false;
        }
        $.ajax({
            type: "GET",
            url: Autobots.carport.xPath,
            data: "s=" + w,
            cache: false,
            async: false,
            dataType: "json",
            error: function() {
            },
            success: function(re) {
                Autobots.part.fSn = [];
                if (re.hotel != undefined) {
                    Autobots.part.type = "hotel";
                    Autobots.part.pakage = re.hotel;
                }

                if (re.flight != undefined) {
                    Autobots.part.type = "flight";
                    Autobots.part.pakage = re.flight;
                }

                if (Autobots.part.pakage.length == 0) {
                    Autobots.hideRobot();
                }

                Autobots.part.num = Autobots.part.pakage.length;
                Autobots.part.Name.find("ul:first").find("li").remove();

                var inTag = Autobots.part.Name.find("ul:first"), inBody;

                inTag.html("");
                $.each(Autobots.part.pakage, function(i, n) {
                    if (Autobots.part.type = "flight") {
                        inBody = "<li sn=\"" + i + "\">" + n[1] + "<p>" + n[0] + "</p></li>";
                        Autobots.part.fSn.push(n[2]);
                    } else {
                        inBody = "<li>" + n[1] + "<p>" + n[0] + "</p></li>";
                    }
                    inTag.append(inBody);
                })

                if (Autobots.part.Name.css("display") == "none") {
                    Autobots.part.where = "show";
                    Autobots.part.Name.animate({
                        opacity: "show"
                    }, "fast")

                    var aT,aL;
					
					if(typeof (Autobots.carport.tid) == "object"){
						aT = Math.ceil(Autobots.part.Eyes[n].offset().top + Autobots.part.Eyes[n].outerHeight()),
						aL = Math.ceil(Autobots.part.Eyes[n].offset().left);
					}else{
						aT = Math.ceil(Autobots.part.Eyes.offset().top + Autobots.part.Eyes.outerHeight()),
						aL = Math.ceil(Autobots.part.Eyes.offset().left);
					}
					
                    Autobots.part.Name.css({
                        top: aT + "px",
                        left: aL + "px",
                        "z-index": "99"
                    });
                    popDiv.theShadow("Autobots", aT, aL, 5);
                };
                $("#shadow").height(Autobots.part.Name.outerHeight());
                Autobots.bootRobot(n);
            }
        })
    },
    bootRobot: function(n) {
        var allInner = Autobots.part.Name.find("li");

        allInner.hover(
			function() {
			    $(this).addClass(Autobots.carport.Coating[1]);
			},
			function() {
			    $(this).removeClass(Autobots.carport.Coating[1]);
			}
		)

        allInner.click(function() {
			if (typeof(Autobots.carport.tid) == "object") {
				Autobots.part.Eyes[n].val($(this).find("p").html());
	            if (Autobots.part.type == "flight") {
	                Autobots.part.tBox[n].val(Autobots.part.fSn[$(this).attr("sn")]);
	            }
			}else{
				Autobots.part.Eyes.val($(this).find("p").html());
	            if (Autobots.part.type == "flight") {
	                Autobots.part.tBox.val(Autobots.part.fSn[$(this).attr("sn")]);
	            }
			}
            
            Autobots.hideRobot();
        })

        document.documentElement.onclick = function(e) {
            var ev = e || window.event;
            var eleSrc = ev.srcElement || ev.target;
            if (eleSrc.tagName.toLowerCase() == "body" || eleSrc.tagName.toLowerCase() == "html") {
                Autobots.hideRobot();
            }
        }
    },
    hideRobot: function() {
        Autobots.part.Name.animate({
            opacity: "hide"
        }, "fast")
        $("#shadow").animate({
            opacity: "hide"
        }, "fast", function() {
            $("#shadow").remove();
        })
        Autobots.part.where = "hide";
        Autobots.part.pp = 0;
        Autobots.part.fSn = [];
    },
    keyHandler: function(e,n) {
        var key = window.event ? e.keyCode : e.which;
        if (key != 13 && key != 38 && key != 40) {
            return false;
        }
        if (Autobots.part.where == "show") {
            var lis = Autobots.part.Name.find("li");
            if (key == 13) {//如果是Enter键，则选择当前的项
	            if (typeof(Autobots.carport.tid) == "object") {
					Autobots.part.Eyes[n].val($(lis[Autobots.part.pp]).find("p").html());
	                if (Autobots.part.type == "flight") {
	                    Autobots.part.tBox[n].val(Autobots.part.fSn[$(lis[Autobots.part.pp]).attr("sn")]);
	                }
				}else{
					Autobots.part.Eyes.val($(lis[Autobots.part.pp]).find("p").html());
	                if (Autobots.part.type == "flight") {
	                    Autobots.part.tBox.val(Autobots.part.fSn[$(lis[Autobots.part.pp]).attr("sn")]);
	                }
				}
                
                Autobots.hideRobot();
                return false;

            } else {//如果是向上键和向下键
                if (key == 38) {//向上键
                    --Autobots.part.pp;
                    if (Autobots.part.pp < 0) {
                        Autobots.part.pp = 0;
                    }
                    lis.removeClass(Autobots.carport.Coating[1]);
                    $(lis[Autobots.part.pp]).addClass(Autobots.carport.Coating[1]);

                } else if (key == 40) {//向下键
                    ++Autobots.part.pp;
                    if (Autobots.part.pp > Autobots.part.num - 1) {
                        Autobots.part.pp = Autobots.part.num - 1;
                    }
                    lis.removeClass(Autobots.carport.Coating[1]);
                    $(lis[Autobots.part.pp]).addClass(Autobots.carport.Coating[1]);
                }
            }
        }
    }
}),
seeker = Class($_$,{
	creat:function(ar){
		this.ar = ar;
		seeker.tool = this.ar;
		seeker.packUpBox();
	},
	packUpBox:function(){
		seeker.toolBox = {};
		//seeker.toolBox.num = seeker.tool.aDat[1];
		seeker.toolBox.siteid = ""
		seeker.toolBox.lifeCircle = $("#" + seeker.tool.aLive);
		seeker.toolBox.part = [];
		var sA_ = seeker.tool.aList;
		for(var ii = 0;ii < sA_.length;ii++){
			seeker.toolBox.part.push($("#" + sA_[ii]));
		}
	},
	look:function(){
		var sP = seeker.toolBox.part;
		if(sP[0].find(seeker.tool.aDat[0]).length <= 1){
			seeker.getArea(0,0)
		}
	},
	getArea:function(sn,n){
		var dat = "htmltype="+ seeker.tool.aDat[0] +"&level="+ seeker.tool.aDat[1] +"siteid=" + seeker.toolBox.siteid;
		$.ajax({
			type:"GET",
			url:seeker.tool.aPath,
			data:dat,
			cache:false,
			async:false,
			error: function(){},
			success: function(App){
				
				if(n ==0){
					seeker.toolBox.part[sn].append(App);
					seeker.binkEle(sn);
				}
				
				if(n ==1){
					seeker.toolBox.lifeCircle.append(App);
				}
				
			}
		})
	},
	binkEle:function(sn){
		if(seeker.tool.aDat[0] == "option"){
			seeker.toolBox.part[sn].find("select").change(function(){
				seeker.toolBox.siteid = $(this).val();
				seeker.getArea(seeker.toolBox.siteid,1);
			})
		}
	}
}),
flightCal = Class(ajaxGetData,{
	creat:function(ops,cbs){
		this.ops = ops;
		flightCal.c = this.ops;
		flightCal.c.Var = [];
		flightCal.c.arg = [];
		if(cbs){
			flightCal.c.callBack = cbs;
			flightCal.c.x = 1;
		}
	},
	setArg:function(){
		try {
			if (flightCal.c.dop != undefined) {
				$.each(flightCal.c.dop,function(i,n){
					var tmp = n.split(":");
					flightCal.c.Var.push(tmp[0]);
					flightCal.c.arg.push(tmp[1]);
				})
			}
		}catch(e){}
	},
	fInnt:function(){
		flightCal.setArg();
		flightCal.getDate(0);
	},
	getDate:function(t,rVar,rArg){
		var dat = "",realDat,nowDate;
		
		$.each(flightCal.c.Var,function(i,n){
			dat += n +"="+flightCal.c.arg[i] + "&";
		})
		
		nowDate = "date=" + ajaxGetData.whatDay(t)
		realDat = dat + nowDate;
		
		$.ajax({
			type:"GET",
			url:flightCal.c.url,
			data:realDat,
			cache:false,
			error: function(){},
			success: function(App){
				flightCal.c.box = $("#"+flightCal.c.bid);
				flightCal.c.box.html(App);
				flightCal.bindEle();
			}
		})
	},
	bindEle:function(){
		flightCal.c.next = flightCal.c.box.find("em[title='Next']");
		flightCal.c.back = flightCal.c.box.find("em[title='Back']");
		flightCal.c.next.click(function(){
			flightCal.getDate(1);
		})
		flightCal.c.back.click(function(){
			flightCal.getDate(2);
		})
		
		if(flightCal.c.x){
			flightCal.c.callBack();
		}
	},
	finshAll:function(){
		flightCal.c.box.bind("unload",function(){
			flightCal.c.box.find("*").unbind();
		})
	}
}),
flightCalBack = Class(flightCal,{
	creat:function(ops,cbs){
		this.ops = ops;
		flightCalBack.c = this.ops;
		flightCalBack.c.Var = [];
		flightCalBack.c.arg = [];
		if(cbs){
			flightCalBack.c.callBack = cbs;
			flightCalBack.c.x = 1;
		}
		try {
			if (flightCalBack.c.sop != undefined) {
				$.each(flightCalBack.c.sop,function(i,n){
					var tmp = n.split(":");
					flightCalBack.c.Var.push(tmp[0]);
					flightCalBack.c.arg.push(tmp[1]);
				})
			}
		}catch(e){}
	},
	fbInnt:function(){
		flightCalBack.getDate(0);
	},
	getDate:function(t,rVar,rArg){
		var dat = "",realDat,nowDate;
		
		$.each(flightCalBack.c.Var,function(i,n){
			dat += n +"="+flightCalBack.c.arg[i] + "&";
		})
		
		nowDate = "date=" + ajaxGetData.whatDay(t)
		realDat = dat + nowDate;
		
		$.ajax({
			type:"GET",
			url:flightCalBack.c.url,
			data:realDat,
			cache:false,
			error: function(){},
			success: function(App){
				flightCalBack.c.box = $("#"+flightCalBack.c.bid);
				flightCalBack.c.box.html(App);
				flightCalBack.bindEle();
			}
		})
	},
	bindEle:function(){
		flightCalBack.c.next = flightCalBack.c.box.find("em[title='Next']");
		flightCalBack.c.back = flightCalBack.c.box.find("em[title='Back']");
		flightCalBack.c.next.click(function(){
			flightCalBack.getDate(1);
		})
		flightCalBack.c.back.click(function(){
			flightCalBack.getDate(2);
		})
		
		if(flightCalBack.c.x){
			flightCalBack.c.callBack();
		}
	},
	finshAll:function(){
		flightCalBack.c.box.bind("unload",function(){
			flightCalBack.c.box.find("*").unbind();
		})
	}
	
}),
inAjaxSearch = Class($_$,{
	creat:function(t,c){
		this.t = t;
		inAjaxSearch.cache = {};
		inAjaxSearch.cache = this.t;
		if(c){
			inAjaxSearch.cache.callBack = cbs;
			inAjaxSearch.cache.x = 1;
		}
	},
	inntAjax:function(){
		inAjaxSearch.setOp();
		inAjaxSearch.bindMenu();
		if(inAjaxSearch.cache.con.find("li").length == 0){
			inAjaxSearch.loadCon(0)
		}
	},
	setOp:function(){
		inAjaxSearch.cache.eType = inAjaxSearch.cache.even== undefined?"click":inAjaxSearch.cache.even;
		inAjaxSearch.cache.menu = $("#" + inAjaxSearch.cache.aid);
		inAjaxSearch.cache.con = $("#" + inAjaxSearch.cache.tid);
		inAjaxSearch.cache.uNum = inAjaxSearch.cache.url.length;
		inAjaxSearch.cache.mmNum = inAjaxSearch.cache.url.length -1;
		//inntAjax.cache.uList
	},
	bindMenu:function(){
		var mop = inAjaxSearch.cache.menu.find(inAjaxSearch.cache.mt);
		$.each(mop,function(i,n){
			$(this).bind(inAjaxSearch.cache.eType,function(){
				if($(this).attr("class") == inAjaxSearch.cache.cls){
					return false
				}else{
					mop.removeAttr("class");
					$(this).attr("class",inAjaxSearch.cache.cls);
					inAjaxSearch.loadCon(i);
				}
			})
		})
	},
	loadCon:function(n){
		if(n > inAjaxSearch.cache.mmNum){
			return false;
		}
		$.ajax({
			type:"GET",
			url:inAjaxSearch.cache.url[n],
			//data:realDat,
			cache:false,
			error: function(){},
			success: function(App){
				inAjaxSearch.cache.con.html(App);
				if(inAjaxSearch.cache.x){
					inAjaxSearch.cache.callBack();
				}
			}
		})
	}
}),
VSS = Class($_$,{
	creat: function(o){
		this.o = o;
		VSS.s = this.o;
	},
	setOp:function(){
		VSS.s.box = $("#" + VSS.s.tid);
		VSS.s.finger = $("#" + VSS.s.selecter);
		if(VSS.s.now == undefined) {
			VSS.s.now = VSS.s.def;
		}
		VSS.s.area = $("#" + VSS.s.bid);
	},
	displaySearch:function(i){
		var realNum = i-1;
		//VSS.s.tag.css("display","none");
		//$(VSS.s.tag[realNum]).removeAttr("style");
		//VSS.s.box.attr("action",VSS.s.vUrl[realNum]);
		VSS.s.finger.unbind();
		VSS.s.now = realNum;
		VSS.getSearch();
	},
	getSearch:function(o){
		$.ajax({
			type:"GET",
			url:VSS.s.sUrl[VSS.s.now],
			//cache:true,
			success: function(Re){
				VSS.s.area.html(Re);
				//VSS.s.tag = $("#" + VSS.s.tid + " " + VSS.s.ele);
				//VSS.s.area.append($(VSS.s.tag[VSS.s.now]));
				//VSS.s.area.find(VSS.s.ele + ":last").prevAll().remove();
				VSS.s.area.find(VSS.s.ele).removeAttr("style");
				_$(VSS.s.selecter).selectedIndex = VSS.s.now;
				VSS.s.box.attr("action",VSS.s.vUrl[VSS.s.now]);
				
				VSS.s.finger.change(function(){
					VSS.displaySearch($(this).val());
				})
			}
		})
	},
	innt:function(){
		VSS.setOp();
		if(VSS.s.area.html() == ""){
			VSS.getSearch();
		}
	}
}),
flyOrder = Class($_$, {
    creat: function(o, cb) {
        this.o = o;
        flyOrder.o = this.o;
    },
    setO: function() {
        flyOrder.o.t = $("#" + flyOrder.o.fid[0]);
        flyOrder.o.table = flyOrder.o.t.find("table");
        flyOrder.o.tr = "<tr>" + flyOrder.o.table.find("tr:first").html() + "</tr>";
        flyOrder.o.addBut = $("#" + flyOrder.o.fid[2]);
        flyOrder.o.price = $("#" + flyOrder.o.fid[1]);
        flyOrder.o.oas = $("#" + flyOrder.o.fid[3]).find("input");
        flyOrder.o.sBox = $("#" + flyOrder.o.fid[4]);
        flyOrder.o.rad = $("#" + flyOrder.o.fid[4] + " input:radio");
        flyOrder.o.str = "";
        flyOrder.o.mStr = ["乘机人", "①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩"];
        flyOrder.o.opList = ["CusName", "CusCardNo", "CusType", "CusCardType", "CustSafe"];
        flyOrder.o.hidden = []; //隐藏域对象缓存数组
        $.each(flyOrder.o.oas, function(i, n) {
            flyOrder.o.str += $(this).attr("name") + ":\"" + parseFloat($(this).val()) + "\",";
            flyOrder.o.hidden.push($(this));
            if (i == flyOrder.o.oas.length - 1) {
                var realStr, tmp, to;
                eval("flyOrder.o.flyPPrice = {" + flyOrder.o.str.substr(0, flyOrder.o.str.length - 1) + "}");
				flyOrder.o.str = null;
				flyOrder.o.oas = null;
            }
        })
		flyOrder.o.flyPPrice.sAduPrice = parseFloat(flyOrder.o.flyPPrice.hidAdu)+parseFloat(flyOrder.o.flyPPrice.hidBuildFee) + parseFloat(flyOrder.o.flyPPrice.hidOilFee);
		flyOrder.o.flyPPrice.sChiPrice = parseFloat(flyOrder.o.flyPPrice.hidChi)+parseFloat(flyOrder.o.flyPPrice.hildChildOilFee);
		//flyOrder.o.flyPPrice.sInfPrice
		
        flyOrder.getSafes();
        //flyOrder.o.flyPPrice.sNum = 0;
        //FO.o
    },
    bindDB: function() {
        flyOrder.o.db = flyOrder.o.table.find("th input");
        if (flyOrder.o.db.eq(0).attr("man") != undefined) {
            var mtp = 1;
        }
        $.each(flyOrder.o.db, function(i, n) {

            if (mtp) {
                if ($(this).attr("man") == undefined) {
                    var nM = parseInt(flyOrder.o.table.find("tr:last").prev().find("th input").eq(0).attr("man")) + 1;
                    $(this).attr("man", nM);
                }
            } else {
                $(this).attr("man", i + 1);
            }

            $(this).bind("click", function() {
                var dNum = flyOrder.o.table.find("th input").length;
                if (dNum == 1) {
                    alerter({ msg: "至少要有一个乘机人。", set: { css: "padding:10px;width:250px;text-align:center;"} });
                    return false;
                }
                if (flyOrder.o.db.length == 1) { return false }
                flyOrder.removeMans(i);
            })
        })
    },
    TDEle: function(t) {
        var tn = $(t).find("option").length,
			vals = parseInt($(t).val()),
			type;
        type = tn == 3 ? "man" : "safe";

        switch (type) {
            case "man":
                var a = [], b = [], c = [],
					fs = flyOrder.o.table.find("td select").filter(function(i) {
					    return $("option", this).length <= 3;
					});
                $.each(fs, function(i, n) {
                    if (i == fs.length) { return false; }
                    if ($(this).val() == "1") {
                        a.push("Adu");
                    }
                    if ($(this).val() == "2") {
                        b.push("Chi");
                    }
                    if ($(this).val() == "3") {
                        c.push("Inf");
                    }

                })
                flyOrder.o.flyPPrice.AduNum = a.length;
                flyOrder.o.flyPPrice.ChiNum = b.length;
                flyOrder.o.flyPPrice.InfNum = c.length;
                $(flyOrder.o.hidden[7]).val(flyOrder.o.flyPPrice.AduNum);
                $(flyOrder.o.hidden[8]).val(flyOrder.o.flyPPrice.ChiNum);
                $(flyOrder.o.hidden[9]).val(flyOrder.o.flyPPrice.InfNum);
                break;

            case "safe":
                flyOrder.getSafes();
                break;
        }
        flyOrder.getPrices();
    },
    getSafes: function() {
        var safes = flyOrder.o.table.find("td select").filter(function(i) {
            return $("option", this).length == 11;
        });
        flyOrder.o.flyPPrice.sNum = 0;
        $.each(safes, function() {
            flyOrder.o.flyPPrice.sNum += parseInt($(this).val());
        })
    },
    setArr: function() {
        var aMan = flyOrder.o.table.find("th input");
        flyOrder.o.manList = [];
        $.each(aMan, function() {
            flyOrder.o.manList.push($(this).attr("man"))
        })
        $(flyOrder.o.hidden[10]).val(flyOrder.o.manList);
    },
    addMans: function() {
        flyOrder.o.table.append(flyOrder.o.tr);
        flyOrder.bindDB();

        var ltr = flyOrder.o.table.find("tr:last"),
			tt = ltr.find("input:first").attr("man"),
			theInput = ltr.find("td input"),
			theSele = ltr.find("td select"),
			num = parseInt(ltr.find("input:first").attr("man"));

        ltr.find("th p:first").html(flyOrder.o.mStr[0] + flyOrder.o.mStr[num]);
        theInput.eq(0).attr("name", flyOrder.o.opList[0] + num);
        theInput.eq(1).attr("name", flyOrder.o.opList[1] + num);
        theSele.eq(0).attr("name", flyOrder.o.opList[2] + num);
        theSele.eq(1).attr("name", flyOrder.o.opList[3] + num);
        theSele.eq(2).attr("name", flyOrder.o.opList[4] + num);
        flyOrder.o.flyPPrice.AduNum = parseInt(flyOrder.o.flyPPrice.AduNum) + 1;
        $(flyOrder.o.hidden[7]).val(flyOrder.o.flyPPrice.AduNum);
        theSele.eq(0).bind("change", function() {
			flyOrder.setPriceShow(this);
            flyOrder.TDEle(this);
        })
        theSele.eq(2).bind("change", function() {
            flyOrder.TDEle(this);
        })
        flyOrder.setArr();
        flyOrder.getPrices();
    },
    bindRad: function() {
        $.each(flyOrder.o.rad, function() {
            $(this).bind("click", function() {
                flyOrder.o.sBox.find("div").removeAttr("style");
                if ($(this).parent().find("div").length > 0) {
                    $(this).parent().find("div").css("display", "block");
                }
                flyOrder.getPrices();
            })
        })
    },
    removeMans: function(i) {
        var ltr = flyOrder.o.table.find("tr").eq(i),
			dM = ltr.find("select").eq(0), Ds = ltr.find("select").eq(2),
			rI;
        if (ltr.length == 0) {
            rI = $.inArray(i.toString(), flyOrder.o.manList);
            ltr = flyOrder.o.table.find("tr").eq(rI);
            dM = ltr.find("select").eq(0);
            Ds = ltr.find("select").eq(2);
        }
        ltr.find("input,select").unbind();
        if (dM.val() == "1") {
            flyOrder.o.flyPPrice.AduNum = parseInt(flyOrder.o.flyPPrice.AduNum) - 1;
            $(flyOrder.o.hidden[7]).val(flyOrder.o.flyPPrice.AduNum);
        }
        if (dM.val() == "2") {
            flyOrder.o.flyPPrice.ChiNum = parseInt(flyOrder.o.flyPPrice.ChiNum) - 1;
            $(flyOrder.o.hidden[8]).val(flyOrder.o.flyPPrice.ChiNum);
        }
        if (dM.val() == "3") {
            flyOrder.o.flyPPrice.InfNum = parseInt(flyOrder.o.flyPPrice.InfNum) - 1;
            $(flyOrder.o.hidden[9]).val(flyOrder.o.flyPPrice.InfNum);
        }
        flyOrder.o.flyPPrice.sNum = parseInt(flyOrder.o.flyPPrice.sNum) - parseInt(Ds.val());
        ltr.remove();
        flyOrder.setArr();
        flyOrder.getPrices();
    },
    noThreeNoFour:function(str){
		var t1 = parseInt(str.substring(str.length-1,str.length)),
		t2 = parseInt(str.substring(str.length-2,str.length-1)),
		to = str.substr(0,str.length-2),f;
		if(t1>=5){
			t2 += 1;
		}
		f=to+t2.toString()+"0";
		return f;
	},
    getPrices: function() {
        var ap = 0, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
		var s=parseFloat(flyOrder.o.flyPPrice.hidOilFee)/2;
        a = parseFloat(flyOrder.o.flyPPrice.hidAdu) * parseInt(flyOrder.o.flyPPrice.AduNum); //成人总价
        b = parseFloat(flyOrder.o.flyPPrice.hidChi) * parseInt(flyOrder.o.flyPPrice.ChiNum); //儿童总价
        c = parseFloat(flyOrder.o.flyPPrice.hidInf) * parseInt(flyOrder.o.flyPPrice.InfNum)//婴儿总价
        d = (parseFloat(flyOrder.o.flyPPrice.hidBuildFee) + parseFloat(flyOrder.o.flyPPrice.hidOilFee)) * parseInt(flyOrder.o.flyPPrice.AduNum) +  parseFloat(flyOrder.o.flyPPrice.hildChildOilFee)* parseInt(flyOrder.o.flyPPrice.ChiNum); //燃油&机建费
        e = parseFloat(flyOrder.o.flyPPrice.hidSafetyFee) * parseInt(flyOrder.o.flyPPrice.sNum); //保险
        if (flyOrder.o.rad.filter(":last").attr("checked") == true) {
            f = 10; //快递
        }
        ap = a + b + c + d + e + f;
        flyOrder.o.flyPPrice.hidTotal = ap;
        $(flyOrder.o.hidden[6]).val(ap);
        flyOrder.o.price.html("&yen;" + ap);
    },
    reSetMan: function() {//防止标准浏览器缓存人数
        $(flyOrder.o.hidden[7]).val(flyOrder.o.flyPPrice.AduNum);
        $(flyOrder.o.hidden[8]).val(flyOrder.o.flyPPrice.ChiNum);
        $(flyOrder.o.hidden[9]).val(flyOrder.o.flyPPrice.InfNum);
    },
	setPriceShow:function(t){
		var theTB = $(t).next(),v =$(t).val();
		switch(v){
			case "1":
				theTB.html("<b class=\"cf20\">&yen;"+flyOrder.o.flyPPrice.sAduPrice+"</b>/成人（含税费）");
			break;
			
			case "2":
				theTB.html("<b class=\"cf20\">&yen;"+flyOrder.o.flyPPrice.sChiPrice+"</b>/儿童（含税费）");
			break;
			
			case "3":
				theTB.html("<b class=\"cf20\">&yen;"+flyOrder.o.flyPPrice.hidInf+"</b>/婴儿（含税费）");
			break;
		}
	},
    inntFly: function() {
        flyOrder.setO();
        flyOrder.bindDB();
        var fSelect = flyOrder.o.table.find("td select").not(flyOrder.o.table.find("td select").eq(1));
        $.each(fSelect, function() {
            $(this).bind("change", function() {
				if($(this).attr("name").indexOf("CusType") != -1){
					flyOrder.setPriceShow(this);
				}
                flyOrder.TDEle(this);
            })
        })
        flyOrder.o.addBut.bind("click", function() {
            flyOrder.addMans();
        })
        flyOrder.bindRad();
        flyOrder.reSetMan();
        flyOrder.setArr();
        flyOrder.getPrices();
    },
    destroy: function() { }
}),
flyOrderChk = Class(flyOrder, {
    creat: function(o) {
        if (o) {
            flyOrder.o.chkCC = 1;
            flyOrder.o.chkCar = o;
        }
    },
    chkMoth: function() {
        if (flyOrder.o.aInput == undefined) {
            flyOrder.o.aInput = flyOrder.o.table.find("td input");
        }
        var aN = 0,
			bN = 0,
			csr = flyOrder.o.rad.filter("[checked=true]").parent().find("div:first input"),
			cssSet = "padding:10px;width:250px;text-align:center;";
        $.each(csr, function() {
            if ($(this).val() != "") {
                bN += 1;
            }
        })

        $.each(flyOrder.o.aInput, function() {
            if ($(this).val() != "") {
                aN += 1;
            }
        })

        if (aN != flyOrder.o.aInput.length) {
            alerter({ msg: "请填写完整的乘机人信息。", set: { css: cssSet} });
            return false;
        }

        if (bN != csr.length) {
            alerter({ msg: "请填写完整的行程单（发票）配送方式。", set: { css: cssSet} });
            return false;
        }

        return true;
    },
    chkChk: function() {
        if (flyOrder.o.chkCC) {
            var ntt = flyOrderChk.chkMoth();
            if (ntt == true) {

                try {
                    return false;
                } finally {
                    flyOrder.o.chkCar();
                }

            } else {
                $("form:first").bind("submit", function() {
                    return false;
                })
            }
        } else {
			var f = _$("aspnetForm")?$("#aspnetForm"):$("form:first");
			
            f.bind("submit", function() {
                return flyOrderChk.chkMoth();
            })
        }
    }
}),
newBH = Class($_$,{
	creat:function(o,c){
		this.o = o;
		newBH.o = this.o;
		if(c){
			newBH.o.cbCtrl = 1;
			newBH.o.callBack = c;
		}
	},
	setGlobal:function(){
		newBH.o.dateBox = $("#" + newBH.o.oid[0])
		newBH.o.tableBox = $("#" + newBH.o.oid[2])
		newBH.o.Gop = $("#" + newBH.o.opBox).val();
		newBH.o.nextB = $("#" + newBH.o.nid);
		newBH.o.reChk = $("#" + newBH.o.oid[1]);
		newBH.o.apBox = $("#"+newBH.o.aP);
		newBH.o.manInfo = $("#"+newBH.o.info);
		newBH.o.advBook = $("#"+newBH.o.advBut);
		newBH.o.rooms = $("#"+newBH.o.roomListId +" a");
		newBH.o.priceList = [];
		newBH.o.bedList = [];
		if(newBH.o.Gop != ""){
			eval("newBH.o.o="+newBH.o.Gop);
			newBH.getJO();
		}
	},
	getJO:function(){
		var tmpStr = "";
		for(key in newBH.o.o){
			tmpStr += key +"="+newBH.o.o[key]+"&";
		}
		newBH.o.pStr = tmpStr.substr(0,tmpStr.length-1);
		newBH.o.fDate = "HGRP_GuestRoomID=" + newBH.o.o.HGRP_GuestRoomID +"&s_date=" + newBH.o.o.s_date + "&e_date=" + newBH.o.o.e_date;
	},
	getDate:function(d,fn){
		newBH.destroy(0);
		var datas = newBH.o.fDate;
		
		if(d&&d!=null){
			datas = d;
		}
		if(fn != undefined){
			var cF = fn;
		}
		$.ajax({
	        type:"GET",
	        url:newBH.o.oUrl.date,
			data:datas,
	        error:function(){
	            alert(O_o.FailMsgE);
	        },
	        success:function(Re){
				newBH.o.dateBox.html(Re);
				showBF();
				if(fn != undefined){
					cF();
					cF = null;
				}
	        }
	    });
	},
	getTable:function(){
		$.ajax({
	        url:newBH.o.oUrl.book,
	        data:newBH.o.pStr,
			cache: false,
	        error: function(){
	            alert(O_o.FailMsgE);
	        },
	        success: function(Re){
				newBH.o.tableBox.html(Re);
				newBH.setAllEven();
	        }
	    });
	},
	setAllEven:function(){
		newBH.o.advBox = newBH.o.tableBox.find("tbody:last");
		newBH.o.sBox = newBH.o.tableBox.find("tbody:first");
		if(newBH.o.advBook.attr("checked")==true){
			newBH.o.tableBox.find("tbody:last").removeAttr("style");
			newBH.setRoomVar();
			newBH.getTDEs();
			newBH.bindEven();
			newBH.bindTDEven();
			newBH.getPrice();
		}else{
			newBH.setRoomVar();
			newBH.setSimpleRoom();
			newBH.bindEven();
			newBH.getPrice();
		}
	},
	setRoomVar:function(){
		var rL = $("#" + newBH.o.oid[3]).val(),
			bL = $("#" + newBH.o.oid[4]).val();
		newBH.o.priceList = rL.split(",");
		newBH.o.bedList = bL.split(",");
		
	},
	getTDEs:function(){
		newBH.o.tbs = newBH.o.tableBox.find("td");
		newBH.o.allSelect = newBH.o.tableBox.find("select");
		newBH.o.pre = newBH.o.tableBox.find("th span");
		newBH.o.addBf = newBH.o.tableBox.find("td b");
		newBH.o.delBfb = newBH.o.tableBox.find("td del");
	},
	addBf:function(t){
		var tt = "<p>"+$(t).prev().html()+"<del>删除该早餐</del></p>",
			tp= $(t).parent().parent();
		tp.append(tt);
		newBH.o.allSelect = newBH.o.tableBox.find("select");
		newBH.o.allSelect.bind("change",function(){
			newBH.getPrice();
		})
		$.each(tp.find("del"),function(){
			$(this).bind("click",function(i,n){
				newBH.delBf(this);
			})
		})
		newBH.getPrice();
	},
	delBf:function(t){
		$(t).unbind();
		$(t).prev().find("select").unbind();
		$(t).parent().remove();
		newBH.o.allSelect = newBH.o.tableBox.find("select");
		newBH.getPrice();
	},
	asPre:function(o,t){
		var tda = newBH.o.tableBox.find("tbody:last").find("td").eq(o),
			tdS = tda.find("select").slice(0,2),
			bfS = tda.find("div").eq(0).html(),
			tdd = newBH.o.tableBox.find("tbody:last").find("td").eq(o+1),
			tdr = tdd.find("select").slice(0,2),
			tS,seNum,dS = "<p>"+tdd.find("div p").eq(0).html()+"</p>",
			tSv = [];

		$.each(tda.find("div select"),function(){
			tSv.push(this.selectedIndex);
		})
		
		seNum = tSv.length/3;
		delBFButNum = seNum-1;
		var addArea = tdd.find("div div").eq(0);
		addArea.find("select,b,del").unbind();
		addArea.empty();
		for(var i=0;i<seNum;i++){
			addArea.append(dS);
		}
		tS = tdd.find("div select");
		$.each(tS,function(i,n){
			this.selectedIndex = tSv[i];
		})
		$.each(tdS,function(i,n){
			tdr[i].selectedIndex = this.selectedIndex;
		})
		
		if(delBFButNum > 0){
			var delBFBut = tdd.find("b").not(":first");
			$.each(delBFBut,function(){
				$(this).replaceWith("<del>删除该早餐</del>");
			})
		}
		newBH.o.allSelect = newBH.o.tableBox.find("select");
		newBH.o.allSelect.bind("change",function(){
			newBH.getPrice();
		})
		$.each(tdd.find("del"),function(){
			$(this).bind("click",function(i,n){
				newBH.delBf(this);
			})
		})
		tdd.find("b").bind("click",function(){
			newBH.addBf(this);
		})
		newBH.getPrice();
	},
	getPrice:function(){
		newBH.o.allPrice = 0;
		newBH.o.days = parseInt(newBH.o.tableBox.find("tr").length);
		var allRoom =[],
			allBed =[],
			mT =[],
			bfT = [],
			bfN = [],
			aaL = [],
			acL=[],
			bfts = [],
			aNum =0,
			rommPrice = 0,
			bfPrice = 0,
			bedPrive = 0,
			varGeter = function(o,t){
				var n = t.selectedIndex,rVal = $(t).find("option").eq(n).text();
				switch(o){
					case "RoomNum":
						allRoom.push(rVal);
					break;
					
					case "BedsNumber":
						allBed.push(rVal);
					break;
					
					/*case "ManType":
						mT.push($(t).val())
					break;*/
					
					case "BreakfastType":
						var bfp,
							mTs = $(t).prevAll("select[name='ManType']").eq(0).val().substr(0,1),
							bT = $(t).find("option").eq(n).attr("title").split(",");
						
						if(mTs == "0"){
							bfp = bT[0];
						}
						if(mTs == "1"){
							bfp = bT[1];
						}
						bfts.push(mTs);
						aaL.push(bT[0]);
						acL.push(bT[1]);
						bfT.push(bfp);
					break;
					
					case "BreakfastNumber":
						bfN.push(rVal)
					break;
				}
			};
		
		$.each(newBH.o.allSelect,function(){
			varGeter($(this).attr("name"),this);
		})
		$.each(newBH.o.priceList,function(i,n){
			var nprice,bPrice;
			
			if(allBed.length != 0){
				bPrice = parseInt(newBH.o.bedList[i])*parseInt(allBed[i])
			}else{
				bPrice = 0;
			}
			
			if(newBH.o.advBox.css("display")=="none"){
				nprice = parseInt(n)*parseInt(allRoom[0]);
				if (allBed.length != 0) {
					bPrice = parseInt(newBH.o.bedList[i])*parseInt(allBed[0]);
				}else{
					bPrice = 0;
				}
			}else{
				nprice = parseInt(n)*parseInt(allRoom[i]);
				if (allBed.length != 0) {
					bPrice = parseInt(newBH.o.bedList[i])*parseInt(allBed[i]);
				}else{
					bPrice = 0;
				}
			}
			
			rommPrice +=nprice;
			bedPrive +=bPrice;
		})
		if(bfT.length !=0){
			$.each(bfN,function(i,n){
				var nBfPrice = 0;
				if (newBH.o.advBox.css("display") == "none") {
					if (n != "0") {
						if(bfts[i] == "0"){
							$.each(aaL,function(ii,nn){
								if(ii == newBH.o.days-1){return false;}
								nBfPrice += parseInt(nn)*parseInt(n);
							})	
						}
						if(bfts[i] == "1"){
							$.each(acL,function(ii,nn){
								if(ii == newBH.o.days-1){return false;}
								nBfPrice += parseInt(nn)*parseInt(n);
							})	
						}
					}
				}else{
					nBfPrice = parseInt(bfT[i])*parseInt(n);
				}
				bfPrice += nBfPrice;
			})
		}
		//newBH.o.days
		/*
		if(newBH.o.advBox.css("display")=="none"){
			//rommPrice = rommPrice*newBH.o.advBox.find("tr").length;
			bedPrive = bedPrive*newBH.o.advBox.find("tr").length;
			bfPrice = bfPrice*newBH.o.advBox.find("tr").length;
		}
		*/
		newBH.o.allPrice = rommPrice + bedPrive + bfPrice;
		newBH.o.apBox.html("&yen;" + newBH.o.allPrice);
		allRoom =null;
		allBed =null;
		mT = null;
		bfT = null;
		bfN = null;
		aaL = null;
		acL= null;
		bfts =null;
	},
	setSimpleRoom:function(){
		var dayOne = newBH.o.advBox.find("td:first").children();
		dayOne.unbind();
		newBH.o.sBox.find("td").append(dayOne.clone());
		//newBH.destroy();
		dayOne.remove();
		newBH.getTDEs();
		newBH.bindTDEven();
		newBH.o.tableBox.find("tbody").css("display","none");
		newBH.o.sBox.css("display","block")
		//newBH.o.sBox.removeAttr("style");
	},
	showAdv:function(){
		var allDay = newBH.o.sBox.find("td:first").children();
		newBH.o.sBox.css("display","none");
		allDay.unbind();
		newBH.o.advBox.find("td:first").append(allDay.clone());
		//newBH.destroy();
		allDay.remove();
		newBH.getTDEs();
		newBH.bindTDEven();
		newBH.o.sBox.css("display","none");
		newBH.o.advBox.css("display","block");
		//newBH.o.advBox.removeAttr("style");
	},
	bindTDEven:function(){
		
		newBH.o.delBfb.bind("click",function(){
			newBH.delBf(this);
		})

		newBH.o.allSelect.bind("change",function(){
			var pp = $(this).parent().parent();
			if(pp.find("select[name='BedsNumber']").length > 0){
				newBH.setBadNum(this);
			}
			newBH.getPrice();
		})
		
		$.each(newBH.o.pre,function(i,n){
			$(this).bind("click",function(){
				newBH.asPre(i,this);
			})
		})
		
		$.each(newBH.o.addBf,function(i){
			$(this).bind("click",function(){
				newBH.addBf(this);
			})
		})
	},
	setBadNum:function(t){
		
		if($(t).attr("name") == "RoomNum"){
			var maxo = parseInt($(t).val())+1,
				ns = $(t).parent().next().find("select"),
				nDay =ns.find("option").val().substr(ns.find("option").val().indexOf("_"),ns.find("option").val().length);
			ns.empty();
			for(var i = 0;i<maxo;i++){
				var ov;
				if(i == 0){
					ov = "<option selected=\"selected\" value=\""+ i + nDay +"\">"+i+"</option>";
				}else{
					ov = "<option value=\""+ i + nDay +"\">"+i+"</option>";
				}
				ns.append(ov);
			}
		}
	},
	bindEven:function(){
		newBH.o.advBook.bind("click",function(){
			if($(this).attr("checked") == true){
				newBH.showAdv();
			}else{
				newBH.setSimpleRoom();
			}
		})
		newBH.o.reChk.bind("click",function(){
			newBH.o.o.s_date = $("#checkIn").val();
			newBH.o.o.e_date = $("#checkOut").val();
			newBH.getJO();
			newBH.o.fDate = "HGRP_GuestRoomID=" + newBH.o.o.HGRP_GuestRoomID +"&s_date=" + newBH.o.o.s_date + "&e_date=" + newBH.o.o.e_date;
			newBH.getDate(null,function(){newBH.getTable()});
		})
		newBH.o.rooms.bind("click",function(){
			try{
				return false;
			}finally{
				var hrefs = $(this).attr("href"),
					nStr = "&s_date=" + $("#checkIn").val() + "&e_date=" + $("#checkOut").val();
				window.location.href = hrefs+nStr;
			}
		})
	},
	inntHotel:function(){
		newBH.setGlobal();
		if(newBH.o.chkCar == undefined){
			newBH.getDate();
			newBH.getTable();
		}else{
			newBH.getDate();
			newBH.setAllEven();
		}
	},
	destroy:function(o){
		if(o!=undefined && newBH.o.advBox != undefined){
			newBH.o.advBook.unbind();
			newBH.o.reChk.unbind();
			newBH.o.tableBox.find("select,b,del").unbind();
		}else{
			newBH.o.tableBox.find("select,b,del").unbind();
		}
	}
}),
/*
hotelScomb({
dayId:"#dayInfo",
roomId:"#cAndKInfo",
otId:"#bookTableBox",
sId:"#rnums",
totalId: ["#bookTotal","#TotalPrice"],
romId:"#rpInfo",
wpSet:["#wpId",function(){WdatePicker({minDate:'%y-%M-%d',doubleCalendar:true,onpicked:function(){reGetHotelScomb({t:this});}})},"dayType.html"],
idList:["#goodgoodstudy","#daydayup","#goNext",0,0],
roomSet:["roomType.html",123]
})
*/
hotelScomb = Class(newBH, {
    creat: function(o, c) {
        this.o = o;
        hotelScomb.o = this.o;
        if (c) {
            hotelScomb.o.cc = 1;
            hotelScomb.o.cb = c;
        }
    },
    setScomb: function() {
        hotelScomb.o.dayType = $(hotelScomb.o.dayId + " input:radio");
        hotelScomb.o.pBox = $(hotelScomb.o.otId);
        hotelScomb.o.wpBox = $(hotelScomb.o.wpSet[0]);
        hotelScomb.o.wpInput = hotelScomb.o.wpBox.find("input:first");
        hotelScomb.o.roomNum = $(hotelScomb.o.sId);
        hotelScomb.o.total = $(hotelScomb.o.totalId[0]);
        hotelScomb.o.totalHid = $(hotelScomb.o.totalId[1]);
        hotelScomb.o.man = $(hotelScomb.o.romId);
        hotelScomb.o.g = $(hotelScomb.o.idList[0]);
        hotelScomb.o.d = $(hotelScomb.o.idList[1]);
        hotelScomb.o.n = $(hotelScomb.o.idList[2]);
        if (hotelScomb.o.daysId) {
            hotelScomb.o.daysNum = parseInt($(hotelScomb.o.daysId).val());
        }
		hotelScomb.o.OTP = $("#OtherTotalPrice");
        hotelScomb.o.forms = typeof (hotelScomb.o.idList[3]) == "string" ? $(hotelScomb.o.idList[3]) : $("form").eq(hotelScomb.o.idList[3]);
    },
    setType: function(t, tt) {
        if (t == 0) {
            hotelScomb.o.g.html($(tt).next().text());
        }
        if (t == 1) {
            hotelScomb.o.d.html($(tt).next().html());
        }
        if (newPop.x != undefined) {
            newPop.ppHide();
        }
        //hotelScomb.getPrice();
    },
    getRoomType: function() {//获取房型
        var dat;
        if ($(hotelScomb.o.roomId).find("div").length == 0) {
            dat = "LodgingDate=" + hotelScomb.o.wpBox.find("input:first").val() + "&DayNumberID=" + hotelScomb.o.dayType.filter(":checked").val() + "&RoomID=" + hotelScomb.o.dayType.filter(":checked").attr("roomid");
        } else {
            dat = "LodgingDate=" + hotelScomb.o.wpBox.find("input:first").val() + "&DayNumberID=" + hotelScomb.o.dayType.filter(":checked").val();
        }
        $.ajax({
            url: hotelScomb.o.roomSet[0],
            type: "GET",
            data: dat,
            success: function(re) {
                $(hotelScomb.o.roomId + " input").unbind();
                if ($(hotelScomb.o.roomId).find("div").length == 0) {
                    $(hotelScomb.o.roomId).append(re);
                } else {
                    $(hotelScomb.o.roomId).find("div:first").html(re);
                }
                hotelScomb.o.roomType = $(hotelScomb.o.roomId + " input:radio");
                var theChk = hotelScomb.o.roomType.filter(":checked");
                hotelScomb.o.roomPrice = parseFloat(theChk.next().next().html().match(/\d+/));
                hotelScomb.o.d.html(theChk.next().html());
                hotelScomb.o.wpBox.find("td").eq(4).find("strong").html(theChk.next().next().html())
                hotelScomb.getProducts(theChk);
                //hotelScomb.bindSelect();
                hotelScomb.bindEven();
            }
        })
    },
    extendedStay: function(o, ac) {//延住天数价格计算
        $.ajax({
            type: "GET",
            url: hotelScomb.o.roomSet[3],
            async: true,
            data: "HPOI_ExtendedDayNumber=" + $(o).val() + "&HPOI_WeekMark=" + $(o).attr("mark") + "&HPOI_ExtendedWeekPrice=" + $(o).attr("extendedweekprice") + "&HPOI_ExtendedPrice=" + $(o).attr("extendedpric") + "&HPOI_LeaveDate=" + hotelScomb.o.leaveDate,
            success: function(re) {
                if (re != -1) {
                    hotelScomb.o.addProsPrice = parseFloat(re);
                    if (ac) {
                        var tfn = ac;
                        tfn();
                    }
                    hotelScomb.getPrice();
                } else {
                    alerter({ msg: "杯具了，发生了个未知的错误。请刷新页面已解决该问题。<br />如还未能解决请致电我们的客服热线<strong style=\"color:#f20;\">400-789-8888</strong>", set: { css: "padding:10px;width:250px;text-align:center;"} });
                }
            }
        })
    },
    getPrice: function() {
        var allRoomPrice = hotelScomb.o.roomPrice * parseInt(hotelScomb.o.roomNum.val())
        hotelScomb.o.allPrice = 0;
        hotelScomb.o.allAddProsPrice = 0;
        if (hotelScomb.o.addProsPrice == undefined) {
            hotelScomb.o.addProsPrice = 0;
        }

        if (hotelScomb.o.cPrice == undefined) {
            if (hotelScomb.o.hasBF != undefined) {
                hotelScomb.o.cPrice = parseFloat(hotelScomb.o.other.filter("[name='BreakfastChildNumber']").attr("price")) * parseInt(hotelScomb.o.other.filter("[name='BreakfastChildNumber']").val());
            } else {
                hotelScomb.o.cPrice = 0;
            }
        }
        if (hotelScomb.o.aPrice == undefined) {
            if (hotelScomb.o.hasBF != undefined) {
                hotelScomb.o.aPrice = parseFloat(hotelScomb.o.other.filter("[name='BreakfastNumber']").attr("price")) * parseInt(hotelScomb.o.other.filter("[name='BreakfastNumber']").val());
            } else {
                hotelScomb.o.aPrice = 0;
            }

        }
        if (hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").length > 0 && hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").val() == "0") {
            //hotelScomb.o.bPrice = 0;
            hotelScomb.o.addProsPrice = 0;
        }
        if (hotelScomb.o.other.filter("[name='BedsNumber']").length > 0) {
            hotelScomb.o.bPrice = parseFloat(hotelScomb.o.other.filter("[name='BedsNumber']").attr("price")) * parseInt(hotelScomb.o.other.filter("[name='BedsNumber']").val());
        } else {
            hotelScomb.o.bPrice = 0;
        }
		if(hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").length > 0){
			hotelScomb.o.addPrice = hotelScomb.o.addProsPrice * parseInt(hotelScomb.o.other.filter("[name='HPOI_NumExtendedDay']").val());
		}else{
			hotelScomb.o.addPrice = 0;
		}
		
        hotelScomb.o.allAddProsPrice = hotelScomb.o.addPrice + hotelScomb.o.bPrice + hotelScomb.o.cPrice + hotelScomb.o.aPrice;
        
		hotelScomb.o.allPrice = allRoomPrice + hotelScomb.o.allAddProsPrice;
        if (hotelScomb.o.totalHid != undefined) {
            hotelScomb.o.totalHid.val(hotelScomb.o.allPrice);
        }
        hotelScomb.o.addTotal.html("&yen;" + hotelScomb.o.allAddProsPrice);
		hotelScomb.o.OTP.val(hotelScomb.o.allAddProsPrice);
        hotelScomb.o.total.html("&yen;" + hotelScomb.o.allPrice);
    },
    getProducts: function(o) {//获取附加产品
        $.ajax({
            type: "GET",
            url: hotelScomb.o.roomSet[2],
            data: "LodgingDate=" + hotelScomb.o.wpBox.find("input:first").val() + "&DayNumberID=" + hotelScomb.o.dayType.filter(":checked").val() + "&RoomID=" + $(o).val(),
            success: function(re) {
                if (hotelScomb.o.pBox.html() != "") {
                    hotelScomb.o.pBox.find("select,span").unbind();
                }
                hotelScomb.o.pBox.html(re);
                hotelScomb.o.leaveDate = $(hotelScomb.o.otId + " input[name='HPOI_LeaveDate']").val();
                hotelScomb.o.addTotal = $(hotelScomb.o.totalId[2]);
                hotelScomb.setType(1, o);
                hotelScomb.o.addProsPrice = 0;
                hotelScomb.o.other = hotelScomb.o.pBox.find("select");
                hotelScomb.bindSelect();
                hotelScomb.getPrice();
            }
        })
    },
    setBedNum: function(t, o) {
        var Max, days,aD,aDN;
        if (hotelScomb.o.daysId != undefined) {
            days = hotelScomb.o.daysNum;
        } else {
            days = parseInt(hotelScomb.o.dayType.filter(":checked").parent().next().next().val());
        }
        if (days == undefined) {days = 1;}
		if(hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").length > 0){
			aD = parseInt(hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").val());
		}else{
			aD = 0;
		}
		if(hotelScomb.o.other.filter("[name='HPOI_NumExtendedDay']").length > 0){
			aDN = parseInt(hotelScomb.o.other.filter("[name='HPOI_NumExtendedDay']").val());
		}else{
			aDN = 0;
		}
        Max = parseInt(t.val()) * days + aD*aDN;

        if (o.find("option").length > 2) {
            o.find("option").eq(1).nextAll().remove();
        }
        for (var i = 1; i < Max; i++) {
            var no = parseInt(i) + 1;
            o.append("<option value=\"" + no + "\">" + no + "</option>");
        }
    },
    setAddProds: function(o) {
        var Max = parseInt(hotelScomb.o.roomNum.val());
        if (o.find("option").length > 1) {
            o.find("option:first").nextAll().remove();
        }
        for (var i = 1; i < Max; i++) {
            var no = parseInt(i) + 1;
            o.append("<option value=\"" + no + "\">" + no + "</option>")
        }
    },
    bindSelect: function(o) {
        if (hotelScomb.o.other == undefined) {
            hotelScomb.o.other = $(hotelScomb.o.otId + " select");
        }
        if (o == undefined) {
            hotelScomb.setAddProds(hotelScomb.o.other.filter("[name='HPOI_NumExtendedDay']"));
        }
        $.each(hotelScomb.o.other, function(i, n) {
            if ($(this).attr("name") == "HPOI_ExtendedDayNumber") {
                $(this).bind("change", function() {
                    if ($(this).val() == "0") {
                        hotelScomb.getPrice();
                    } else {
                        hotelScomb.extendedStay(this);
                    }
                })
            } else if ($(this).attr("name") == "BedsNumber") {

                $(this).bind("change", function() {
                    //if (hotelScomb.o.other.eq(0).val() != "0") {
                    hotelScomb.getPrice();
                    //}
                })
            } else if ($(this).attr("name") == "BreakfastNumber") {
                hotelScomb.o.hasBF = 1;
                $(this).bind("change", function() {
                    hotelScomb.o.aPrice = parseFloat($(this).attr("price")) * parseInt($(this).val());
                    hotelScomb.getPrice();
                })
            } else if ($(this).attr("name") == "HPOI_NumExtendedDay") {
                $(this).bind("change", function() {
                    //if(hotelScomb.o.other.eq(2).attr("name") =="BedsNumber"){
                    hotelScomb.setBedNum($(this),hotelScomb.o.other.filter("[name='BedsNumber']"));
                    //}
                    hotelScomb.getPrice();
                })
            } else if ($(this).attr("name") == "BreakfastChildNumber") {
                $(this).bind("change", function() {
                    hotelScomb.o.cPrice = parseFloat($(this).attr("price")) * parseInt($(this).val());
                    hotelScomb.getPrice();
                })
            } else {
                $(this).bind("change", function() {
                    hotelScomb.getPrice();
                })
            }
        })
    },
    bindEven: function() {

        hotelScomb.o.roomNum.bind("change", function() {
            hotelScomb.setAddProds(hotelScomb.o.other.filter("[name='HPOI_NumExtendedDay']"));
            if (hotelScomb.o.other.filter("[name='BedsNumber']").length > 0) {
                hotelScomb.setBedNum($(this),hotelScomb.o.other.filter("[name='BedsNumber']"));
            }
            hotelScomb.getPrice();
        })

        hotelScomb.o.wpInput.bind("click", function() {
            $(hotelScomb.o.wpSet[1]);
        })

        hotelScomb.o.dayType.bind("click", function() {
            hotelScomb.destroy();
            hotelScomb.setType(0, this);
            hotelScomb.getRoomType();
        })

        hotelScomb.o.roomType.bind("click", function() {
            hotelScomb.o.wpBox.find("td").eq(4).find("strong").html($(this).next().next().html())
            hotelScomb.o.roomPrice = parseFloat($(this).next().next().html().match(/\d+/));
            hotelScomb.o.addProsPrice = 0;
            hotelScomb.o.aPrice = 0;
            hotelScomb.o.cPrice = 0;
            hotelScomb.getProducts(this);
        })

        hotelScomb.o.n.click(function() {
            hotelScomb.o.forms.submit();
        })

        hotelScomb.o.forms.bind("submit", function() {
            newBH.o = {};
            newBH.o.manInfo = hotelScomb.o.man;
            if (hotelScomb.o.idList[3] == 0) {
                return newHBNext.chkHotle()
            } else {
                try {
                    return false;
                } finally {
                    ajaxFP(hotelScomb.o.idList[3]);
                    hotelScomb.o.forms.submit();
                }
            }
        })
    },
    inntScomb: function() {
        hotelScomb.setScomb();
        if ($(hotelScomb.o.roomId + " input").length > 0) {
            hotelScomb.o.roomType = $(hotelScomb.o.roomId + " input:radio");
            hotelScomb.o.roomPrice = parseFloat(hotelScomb.o.roomType.filter(":checked").next().next().html().match(/\d+/));
            hotelScomb.o.leaveDate = $(hotelScomb.o.otId + " input[name='HPOI_LeaveDate']").val();
            hotelScomb.bindEven();
            hotelScomb.bindSelect();
        } else {
            hotelScomb.getRoomType();
        }
    },
    destroy: function() {
        hotelScomb.o.wpBox.find("input,select,a").unbind();
        hotelScomb.o.pBox.find("select").unbind();
    }
}),

/*
carHotelScombs({
    nId:"#rnums",
    aId:"#bookTableBox",
    tId:"#wpId",
    rId:"#rpInfo",
    sId:"#goNext",
    totalId: ["#bookTotal","#addPrice"],
    purl:"ajax/hotelpackages-extendedtotalprice.aspx",
    f:"#innerForm"
})
*/
carHotelScomb = Class(hotelScomb, {
    creat: function(o, c) {
        this.o = o;
        carHotelScomb.o = this.o;
        if (c) {
            carHotelScomb.o.cc = 1;
            carHotelScomb.o.cb = c;
        }
    },
    setOps: function() {
        hotelScomb.o = {};
        hotelScomb.o.daysId = carHotelScomb.o.daysId;
        hotelScomb.o.roomNum = $(carHotelScomb.o.nId);
        hotelScomb.o.total = $(carHotelScomb.o.totalId[0]);
        hotelScomb.o.addTotal = $(carHotelScomb.o.totalId[1]);
        hotelScomb.o.other = $(carHotelScomb.o.aId + " select");
        hotelScomb.o.roomPrice = $(carHotelScomb.o.tId + " td").eq(4).html().match(/\d+/);
        hotelScomb.o.roomSet = ["", "", "", carHotelScomb.o.purl];
        carHotelScomb.o.manInfo = $(carHotelScomb.o.rId);
        carHotelScomb.o.next = $(carHotelScomb.o.sId);
        hotelScomb.o.leaveDate = $(carHotelScomb.o.aId + " input[name='HPOI_LeaveDate']").val();
        carHotelScomb.o.form = typeof (carHotelScomb.o.f) == "string" ? $(carHotelScomb.o.f) : $("form").eq(carHotelScomb.o.f);
    },
    chkCar: function() {
        var cf = function() {
            var mI = carHotelScomb.o.manInfo.find("input"), m = 0;
            $.each(mI, function() {
                if ($(this).val() != "") {
                    m += 1;
                }
            })
            if (m != mI.length) {
                alerter({ msg: "请填写完整的取房人信息 。", set: { css: "padding:10px;width:250px;text-align:center;"} });
                return false;
            } else {
                return true;
            }
        }, ss = cf();
        if (ss == true) {
            carHotelScomb.o.form.unbind();
            carHotelScomb.o.form.ajaxForm(function() {
                alert("修改成功!");
                carHotelScomb.o.form.find("*").unbind();
                carHotelScomb.o.form = null;
                closeCarInfo();
            })
            carHotelScomb.o.form.submit();
            if (carHotelScomb.o.cc != undefined) {
                carHotelScomb.o.cb();
            }
        }
    },
    bindEven: function() {
        hotelScomb.bindSelect(0);
        hotelScomb.o.roomNum.unbind();
        hotelScomb.o.roomNum.bind("change", function() {

            var o = hotelScomb.o.other.eq(1),
				Max = parseInt(hotelScomb.o.roomNum.val());
            if (o.find("option").length > 1) {
                o.find("option:first").nextAll().remove();
            }
            for (var i = 0; i < Max; i++) {
                var no = parseInt(i) + 1;
                o.append("<option value=\"" + no + "\">" + no + "</option>");
            }
            if (hotelScomb.o.other.filter("[name='BedsNumber']").length > 0) {
                hotelScomb.setBedNum($(this),hotelScomb.o.other.filter("[name='BedsNumber']"));
            }
            //hotelScomb.setAddProds(hotelScomb.o.other.eq(1));
            hotelScomb.getPrice();
        })

        carHotelScomb.o.form.submit(function() {
            try {
                return false;
            } finally {
                carHotelScomb.chkCar();
            }
        })
    },
    outBFP: function() {
    if (hotelScomb.o.hasBF == 1) {
            hotelScomb.o.aPrice = parseFloat(hotelScomb.o.other.filter("[name='BreakfastNumber']").attr("price")) * parseInt(hotelScomb.o.other.filter("[name='BreakfastNumber']").val());
            hotelScomb.o.cPrice = parseFloat(hotelScomb.o.other.filter("[name='BreakfastChildNumber']").attr("price")) * parseInt(hotelScomb.o.other.filter("[name='BreakfastChildNumber']").val());
        }
    },
    inntCar: function() {
        carHotelScomb.setOps();
        carHotelScomb.bindEven();
        if (hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").length > 0 && hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']").val() != "0") {
            hotelScomb.extendedStay(hotelScomb.o.other.filter("[name='HPOI_ExtendedDayNumber']"), carHotelScomb.outBFP());
        } else {
            hotelScomb.getPrice();
        }
    }
}),
reHotelScomb = Class(hotelScomb, {
    creat: function(o, c) {
        this.o = o;
        reHotelScomb.o = this.o;
    },
    isThatOk: function() {
        $.ajax({
            type: "GET",
            data: "HotelPackagesID=" + hotelScomb.o.roomSet[1] + "&LodgingDate=" + $(reHotelScomb.o.t).val(),
            url: hotelScomb.o.wpSet[2],
            async: true,
            success: function(re) {
                if (re != 0) {
                    hotelScomb.destroy();
                    reHotelScomb.o.forms.unbind();
                    reHotelScomb.o.forms.attr("action", hotelScomb.o.wpSet[3]);
                    reHotelScomb.o.forms.submit();
                } else {
                    alerter({ msg: "您所选的日期无价格 。<br />请重新选择。", set: { css: "padding:10px;width:250px;text-align:center;"} });
                }
            }
        })
    },
    doRe: function() {
        if (reHotelScomb.o.f != undefined) {
            reHotelScomb.o.forms = typeof (reHotelScomb.o.f) == "stribg" ? $(reHotelScomb.o.f) : $("form").eq(reHotelScomb.o.f);
        } else {
            reHotelScomb.o.forms = $("form:first");
        }
        reHotelScomb.isThatOk();
    }
}),
newHBNext = Class(newBH, {
    creat: function(o, c) {
        this.o = o;
        newHBNext.o = this.o;
        if (c) {
            newHBNext.o.cCtrl = 1;
            newHBNext.o.chkCC = c;
        }
    },
    chkHotle: function() {
        var mI = newBH.o.manInfo.find("input"), m = 0;
        $.each(mI, function() {
            if ($(this).val() != "") {
                m += 1;
            }
        })
        if (m != mI.length) {
            alerter({ msg: "请填写完整的取房人信息 。", set: { css: "padding:10px;width:250px;text-align:center;"} });
            return false;
        } else {
            return true;
        }
        return false;
    },
    loser: function() {
        return false;
    },
    aChks: function() {
        try {
            return false;
        } finally {
            $.ajax({
                type: "GET",
                url: newBH.o.oUrl.next,
                data: newBH.o.fDate,
                async: true,
                error: function() {
                    alert(O_o.FailMsgE);
                    return false;
                },
                success: function(Re) {
                    if (Re != 0) {
                        newHBNext.doNext();

                    } else {
                        alerter({ msg: "您选择的时间段内有一或多天无客房出售（日历上无价格）。<br />您可以重新选择预订的时间段或拨打我们的客服热线：400-789-8888咨询预订。", set: { css: "padding:10px;width:250px;text-align:center;text-align:left;" }, ot: 4000 });
                        return false;
                    }
                }
            });
        }

    },
    doNext: function() {
        var ntt = newHBNext.chkHotle();
        if (ntt == true) {
            if (newHBNext.o.cCtrl) {
                //newHBNext.o.chkCC();
                newHBNext.o.form.unbind();

                newHBNext.o.form.ajaxForm(function() {
                    alert("修改成功!");
                    newHBNext.o.form.find("*").unbind();
                    newHBNext.o.form = null;
                    closeCarInfo();
                })
                newHBNext.o.form.submit();
            } else {
                newHBNext.o.form.unbind();
                newHBNext.o.form.submit();
            }
        }
    },
    inntNext: function() {
        newHBNext.o.form = typeof (newHBNext.o.f) == "string" ? $("#" + newHBNext.o.f) : $("form").eq(newHBNext.o.f);
        newHBNext.o.form.unbind();
        if (newHBNext.o.cCtrl) {
            newHBNext.o.form.bind("submit", function() {
                return newHBNext.aChks();
            })
        } else {
            newHBNext.o.form.bind("submit", function() {
                return newHBNext.aChks();
            })
        }
    }
}),
/*
recommendJourney({
	pBoxId:["#topTotal","#bookTotal"],//顶部的总价跟底部的总价
	cBoxId:"#orderBox",//主要加载容器
	nextId:"#nextBut",//下一步
	varBoxId:"#varBox",//参数主容器
	DIYid:"diySp",//自费项目
	priceId:"#allPrices",/总价隐藏域
	loadBoxId:"#isLoadding",//正在加载时的有好界面
	uList:{//ajax请求页面地址
		G:"recommendJourneyInner.html",
		D:"123.html"
	}
})
 */
journey = Class($_$,{
	creat:function(o,c){
		this.o = o;
		journey.o = this.o;
		if(c){
			journey.o.cc = 1;
			journey.o.cb = c;
		}
	},
	setGlobal:function(){
		journey.o.topPrice = $(journey.o.pBoxId[0]);
		journey.o.bottomPrice = $(journey.o.pBoxId[1]);
		journey.o.allPrices = $(journey.o.priceId);
		journey.o.contentBox = $(journey.o.cBoxId);
		journey.o.next = $(journey.o.nextId);
		journey.o.varEles = $(journey.o.varBoxId).find("input,select");
		journey.o.varSelect = $(journey.o.varBoxId + " select");
		journey.o.loadBox = $(journey.o.loadBoxId);
		journey.o.tmp = "";
		journey.o.uStr ="";
		$.each(journey.o.varEles,function(){
			
			if($(this).attr("name") == ""){
				return
			}
			var na = $(this).attr("name"),
				va = $(this).val();
			journey.o.tmp += na+":\""+va+"\",";
			
		})
		eval("journey.o.obj={"+journey.o.tmp.substr(0,journey.o.tmp.length-1)+"}");
		journey.o.tmp = null;
		journey.o.uStr = $.param(journey.o.obj);
	},
	setPart:function(){
		journey.o.reChkMsg = "您必须点击<strong class=\"cf20\">重新查询按钮</strong>使您新的人数或房间数生效。";
		journey.o.roomNumSelecter = $("#roomNum");
		journey.o.alerterCss = "padding:10px;width:250px;text-align:left;";
		journey.o.alerterOt = 3500;
		journey.o.moreSpan = journey.o.contentBox.find("span[bt]");
		journey.o.moreBut = journey.o.contentBox.find("input[bt]");
		journey.o.allRadio = journey.o.contentBox.find(":radio");
		journey.o.rBox = journey.o.contentBox.find("table[id]");
		journey.o.allCheckbox = journey.o.contentBox.find(":checkbox");
		journey.o.allSelect = journey.o.contentBox.find("select");
		journey.o.DIYbox = $(journey.o.DIYid);
		journey.o.diyImg = journey.o.allCheckbox.prev("img");
		
		var ta = [],nt = [];
		$.each(journey.o.allRadio,function(i){
			if($(this).attr("name") != journey.o.allRadio.eq(i+1).attr("name")){
				nt.push($(this));
				ta.push(nt);
				nt = [];
			}else{
				nt.push($(this));
			}
		})
		$.each(ta,function(i,n){
			$.each(n,function(ii,n){
				$(this).attr("an",i);
				//$(this).attr("tn",ii);
			})
		})
		
	},
	isFly:function(t){
		var t1 = "<tr>"+$(t).parent().parent().parent().html()+"</tr>",
			t2 = "<tr>"+$(t).parent().parent().parent().next().html()+"</tr>";
		tr = t1+t2;
		if(journey.o.rBox.eq(0).find("tr").length > 1){
			journey.o.rBox.eq(0).find("tr").eq(0).nextAll().remove();
			journey.o.rBox.eq(0).append(tr);
		}else{
			journey.o.rBox.eq(0).append(tr);
		}
		journey.o.rBox.eq(0).attr("price",$(t).attr("price"));
		journey.o.rBox.eq(0).find("p").attr("class","isSelect");
		journey.o.rBox.eq(0).find("input").remove();
	},
	isOther:function(t,i){
		if($(t).parent().parent().parent().find("td").length == 8){
			tr = "<tr>"+$(t).parent().parent().parent().html()+"</tr>";
		}else{
			tr = "<tr><td>"+$(t).parent().parent().parent().parent().find("td").html()+"</td>"+$(t).parent().parent().parent().html()+"</tr>";
		}
		if(journey.o.rBox.eq(i).find("tr").length > 1){
			journey.o.rBox.eq(i).find("tr").eq(1).replaceWith(tr.replace(/rowspan/g,"rowspans"));
		}else{
			journey.o.rBox.eq(i).append(tr.replace(/rowspan/g,"rowspans"));
		}
		
		var ss = journey.o.rBox.eq(i).find("select"),
			ssv = ss.find("option[sl]").text(),
			rn = ssv==""?ss.val():ssv;
		journey.o.rBox.eq(i).attr("price",$(t).attr("price"));
		journey.o.rBox.eq(i).attr("rnum",rn);
		journey.o.rBox.eq(i).find("p").attr("class","isSelect");
		ss.parent().html(rn);
		journey.o.rBox.eq(i).find("input").remove();
	},
	setAlready:function(){
		var isCheck = journey.o.allRadio.filter(":checked"),tr;
		$.each(isCheck,function(i){
			if($(this).attr("name").indexOf("fly")!= -1){
				$(this).attr("checked",true);
				journey.isFly(this);
			}
			if($(this).attr("name").indexOf("Room")!=-1){
				$(this).attr("checked",true);
				journey.isOther(this,i);
			}
		})
	},
	bindEven:function(){
		$.each(journey.o.moreSpan,function(){
			$(this).toggle(
				function(){
					$(this).attr("class","hideMore");
					$(this).attr("txt",$(this).html());
					$(this).html("收起列表");
					$(this).parent().prev().find("tbody").eq(1).removeAttr("style");
				},
				function(){
					$(this).attr("class","showMore");
					$(this).html($(this).attr("txt"));
					$(this).parent().prev().find("tbody").eq(1).css("display","none");
				}
			)
		})
		$.each(journey.o.moreBut,function(){
			//.moreInfo ,.closeMoreInfo
			$(this).toggle(
				function(){
					$(this).attr("class","closeMoreInfo");
					$(this).attr("txt",$(this).val());
					$(this).val("收起列表");
					$(this).parent().next().find("table").removeAttr("style");
				},
				function(){
					$(this).attr("class","moreInfo");
					$(this).val($(this).attr("txt"));
					$(this).parent().next().find("table").css("display","none");
				}
			)
		})
		journey.o.allRadio.bind("click",function(){
			if($(this).attr("name").indexOf("fly")!= -1){
				journey.isFly(this);
			}
			if($(this).attr("name").indexOf("Room")!=-1){
				journey.isOther(this,parseInt($(this).attr("an")));
			}
			journey.getPrice();
		})
		journey.o.allCheckbox.bind("click",function(){
			$(this).parent().attr("class","isSelect");
			journey.getPrice();
		})
		journey.o.diyImg.bind("click",function(){
			$(this).next().click();
			$(this).parent().removeAttr("class");
			journey.getPrice();
		})
		journey.o.allSelect.bind("change",function(){
			var nR = $(this).parent().parent().find(":radio").filter(":checked"),
				nC=  $(this).parent().parent().find("input:checkbox").filter(":checked");
			
			function r2Get(o,o2){
				journey.o.contentBox.find("table[id]").eq(parseInt(o2.attr("an"))).attr("rnum",$(o).val());
				$(o).find("option").removeAttr("sl");
				$(o).find("option").eq(parseInt($(o).val())-1).attr("sl","1");
			}
			
			if(nR.length > 0){
				r2Get(this,nR);
				journey.getPrice();
			}
			if(nC.length > 0){
				r2Get(this,nC);
				journey.getPrice();
			}
		})
		journey.o.varSelect.change(function(){
			if($(this).attr("id") == "aduNum"){
				var a=parseInt($(this).val());
				journey.o.roomNumSelecter.empty();
				for(var i=0;i<a;i++){
					var n = i+1;
					if(i==0){
						journey.o.roomNumSelecter.append("<option value=\""+n+"\" selected=\"selected\" >"+n+"</option>");
					}else{
						journey.o.roomNumSelecter.append("<option value=\""+n+"\" >"+n+"</option>");
					}
				}
				journey.o.roomNumSelecter
			}
			
			alerter({msg:journey.o.reChkMsg,set:{css:journey.o.alerterCss},ot:journey.o.alerterOt});
		})
	},
	getPrice:function(){
		var pt1 = journey.o.contentBox.find("table[id]"),
			allCheck = journey.o.contentBox.find(":checkbox").filter(":checked");
		journey.o.pArr = [];
		journey.o.price = 0;
		
		$.each(pt1,function(i,n){
			var rP,pp = parseFloat($(this).attr("price")),rn;
			if($(this).attr("rnum") != undefined){
				rn = parseInt($(this).attr("rnum"));
				rP = pp*rn;
			}else{
				rP = pp;
			}
			journey.o.pArr.push(rP);
		})
		
		$.each(allCheck,function(){
			var tv = 0,
				theS = $(this).parent().parent().parent().find("select"),
				AdultNum = parseInt(theS.eq(0).val()),
				ChildNum = parseInt(theS.eq(1).val()),
				AdultPrice = parseFloat($(this).attr("adultprice")),
				ChildPrice = parseFloat($(this).attr("childprice"));
			tv = AdultPrice*AdultNum + ChildPrice*ChildNum;
			journey.o.pArr.push(tv);
		})
		
		$.each(journey.o.pArr,function(i,n){
			journey.o.price += parseFloat(n);
		})
		journey.o.allPrices.val(journey.o.price);
		journey.o.topPrice.html("&yen;"+journey.o.price);
		journey.o.bottomPrice.html("&yen;"+journey.o.price);
	},
	stars:function(){
		journey.o.loadBox.ajaxStart(function(){
			$(this).show();
		});
		$.ajax({
			type:"GET",
			url:journey.o.uList.G,
			data:journey.o.uStr,
			cache:false,
			success: function(re){
				journey.o.contentBox.html(re);
				journey.setPart();
				journey.bindEven();
				journey.setAlready();
				journey.getPrice();
				journey.o.ot = setTimeout(function(){
					journey.o.loadBox.animate({
						opacity:"hide"
					},"fast",function(){
						clearTimeout(journey.o.ot);
						journey.o.ot = null;
						journey.o.loadBox.unbind();
						journey.o.contentBox.animate({
							opacity:"show"
						});
					})
				},500)
			}
		});
	},
	innt:function(){
		journey.setGlobal();
		journey.stars();
	}
}),
rjGetPrice = Class(journey,{
	creat:function(o){
		this.o = o
		rjGetPrice.o = this.o;
	},
	doGet:function(){
		var t = $(rjGetPrice.o.ev),
			tag = t.parent().prev(),
			tArr = t.attr("pid").split(","),
			pStr = "ProID="+tArr[0]+"&Type="+tArr[1]+"&Date="+t.val();
		
		$.ajax({
			type:"GET",
			url:journey.o.uList.D,
			data:pStr,
			success: function(re){
				tag.html(re);
			}
		});
	}
}),
/*
journeyChk({flyId:'flyPeople',hotelId:'rpInfo',sendId:'sendM',f:0})
*/
journeyChked = Class($_$,{
	creat:function(o,c){
		this.o = o;
		journeyChked.o = this.o;
		if(c){
			journeyChked.o.cc = 1;
			journeyChked.o.cb = c;
		}
	},
	setVar:function(){
		newBH.o = {};
		flyOrder.o = {};
		newBH.o.manInfo = $(journeyChked.o.hotelId);
		flyOrder.o.aInput = $(journeyChked.o.flyId).find("input");
		flyOrder.o.sBox = $(journeyChked.o.sendId);
		flyOrder.o.rad = flyOrder.o.sBox.find("input:radio");
		flyOrder.bindRad();
	},
	whosyourdaddy:function(){
		journeyChked.setVar();
		journeyChked.o.form = typeof(journeyChked.o.f)=="string"?$("#"+journeyChked.o.f):$("form").eq(journeyChked.o.f);
		journeyChked.o.form.bind("submit",function(){
			
			var h = newHBNext.chkHotle(),
				f = flyOrderChk.chkMoth(),
				n = 0;
			if(h == true){
				n+=1;
			}
			if(f == true){
				n+=1;
			}
			if(n < 2){
				return false;
			}else{
				
				try{
					var aa = loger({tid:'topLog',but:this,lid:'subLog'},function(){sendUrl({url:O_o.logUrl});})
					return aa;
				}finally{
					aa = loger({tid:'topLog',but:this,lid:'subLog'},function(){sendUrl({url:O_o.logUrl});})
					if(aa == true){
						journeyChked.o.form.unbind();
						journeyChked.o.form.submit();
					}
				}
			}
		})
	}
}),
//oneDAY({tid:"#diveSelect",totalId:"#bookTotal",pid:"#prices"})
oneNight = Class($_$,{
	creat:function(o,c){
		this.o =o;
		oneNight.o = this.o;
		if(c){
			oneNight.o.cb = c;	
		}
	},
	setONS:function(){
		oneNight.o.sEle = $(oneNight.o.tid + " select");
		oneNight.o.priceBox = $(oneNight.o.totalId);
		oneNight.o.pBox = $(oneNight.o.pid);
		oneNight.o.aps = [];
		oneNight.o.aSelecter = [];
	},
	getAddPrice:function(){
		if(isNaN(parseInt(oneNight.o.pBox.val().split(",")[0])) == true){
			oneNight.o.ap = parseFloat(oneNight.o.pBox.val().split(",")[0].match(/\d+/));
			oneNight.o.cp = parseFloat(oneNight.o.pBox.val().split(",")[1].match(/\d+/));
		}else{
			oneNight.o.ap = parseFloat(oneNight.o.pBox.val().split(",")[0]);
			oneNight.o.cp = parseFloat(oneNight.o.pBox.val().split(",")[1]);
		}
		if(oneNight.o.addId != undefined){
			if(oneNight.o.addId !== null){
				var pn;
				oneNight.o.aSelecter = [];
				$.each($(oneNight.o.addId +" select"),function(){
					pn = $(this).parent().parent().find("strong").text().match(/\d+/);
					oneNight.o.aps.push(pn);
					oneNight.o.aSelecter.push(parseInt($(this).val()));
				})
				
			}
		}
	},
	getPrice:function(){
		oneNight.getAddPrice();
		var yp = 0,app = 0;
		oneNight.o.price = 0;
		$.each(oneNight.o.sEle,function(){
			var tn = $(this).attr("name"),np = parseInt($(this).val());
			if(tn == "BookNum"){
				yp += np*oneNight.o.ap;
			}
			if(tn == "BookChildNum"){
				yp += np*oneNight.o.cp;
			}
		})
		if(oneNight.o.addId != undefined && oneNight.o.aps.length !== 0){
			$.each(oneNight.o.aSelecter,function(i,n){
				app += oneNight.o.aps[i][0]*n;
			})
		}
		oneNight.o.price = yp+app;
		oneNight.o.priceBox.html("&yen;"+oneNight.o.price);
	},
	bindEven:function(){
		oneNight.o.sEle.bind("change",function(){
			oneNight.getPrice();
		})
	},
	inntONS:function(){
		oneNight.setONS();
		oneNight.bindEven();
		oneNight.getPrice();
	}
}),
//checkPay({pe:"#payee",pr:"#payer",pn:"#productName",pp:"#price",pt:"payNow",nb:"#goNext",f:0})
paySetp = Class($_$,{
	creat:function(o,c){
		this.o = o;
		paySetp.o = this.o;
		if(c){
			paySetp.o.cb = c;
		}
	},
	setDefOp:function(){
		paySetp.o.alerterCss = "padding:10px;width:250px;text-align:center;text-align:center;";
		paySetp.o.alerterOt = 1500;
		paySetp.o.subBut = $(paySetp.o.nb);
		if(paySetp.o.f != undefined){
			paySetp.o.forms = typeof(paySetp.o.f) == "string"?$(paySetp.o.f):$("form").eq(paySetp.o.f);
		}else{
			paySetp.o.forms = $("form:first");
		}
	},
	getFirst:function(txt){
		var f = txt.substr(0,1);
		return f;
	},
	getLast:function(txt){
		var l = txt.substr(txt.length-1,txt.length);
		return l;
	},
	inputNoSpace:function(strArr,num,arr,cb){
		$.each(strArr,function(i,n){
			if(n == "" || n == " "){
				alerter({msg:paySetp.o.payNowMsg[num[i]][0],set:{css:paySetp.o.alerterCss},ot:paySetp.o.alerterOt});
				return false;
			}else{
				if(paySetp.getFirst(n) == " "){
					alerter({msg:paySetp.o.payNowMsg[num[i]][1],set:{css:paySetp.o.alerterCss},ot:paySetp.o.alerterOt});
					return false;
				}else{
					if(paySetp.getLast(n) == " "){
						alerter({msg:paySetp.o.payNowMsg[num[i]][2],set:{css:paySetp.o.alerterCss},ot:paySetp.o.alerterOt});
						return false;
					}
				}
			}
			if(arr){
				arr.push(1);
			}
			if(i == strArr.length-1 && cb != undefined){
				var a = cb;
				a();
			}
			return true;
		})
		//arr.push(1);
	},
	chkNum:function(str,num,arr){
		$.each(str,function(i,n){
			if(isNaN(n) == true){
				alerter({msg:paySetp.o.payNowMsg[num[i]][0],set:{css:paySetp.o.alerterCss},ot:paySetp.o.alerterOt});
				return false;
			}
			if(arr){
				arr.push(1);
			}
			return true;
		})
	},
	chkEmail:function(str,i,arr){
		var theReg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
	    if (!theReg.test(str)) {
			alerter({msg:paySetp.o.payNowMsg[i][0],set:{css:paySetp.o.alerterCss},ot:paySetp.o.alerterOt});
	        return false;
	    }
		if(arr){
			arr.push(1);
		}
		return true;
	},
	doSetp:function(){
		paySetp.setDefOp();
		paySetp.toCheck();
	},
	toCheck:function(){
		paySetp.o.subBut.unbind();
		
		if(paySetp.o.chkId.ci != undefined){
			if(paySetp.o.chkId.ci.length == 2){
				$.each($(paySetp.o.chkId.ci[0]+" input:radio"),function(){
					$(this).bind("click",function(){
						$(paySetp.o.chkId.ci[1]).val($(this).val());
						paySetp.o.method = $(paySetp.o.chkId.ci[1]).val();
					})
				})
				if(paySetp.o.method == undefined){
					paySetp.o.method = $(paySetp.o.chkId.ci[1]).val();
				}
			}else{
				paySetp.o.method = $(paySetp.o.chkId.ci[0]+" input:checked").val();
			}
		}else{
			paySetp.o.method = "0";
		}
		switch(paySetp.o.pt){
			case "payNow":
				paySetp.o.forms.submit(function(){
					paySetp.o.forms.unbind();
					return paySetp.payNow(3);
				})
			break;
			
			case "contact":
				paySetp.o.forms.submit(function(){
					return paySetp.contacts(4);
				})
			break;
			
			default:
			break
		}
	},
	contacts:function(){
		/*
		ni:"#theName",
	    mi:"#theMoblie",
	    pi:"#thePhone",
	    ei:"#theEmail",
	    ci:["#comType","#radiomethod"]
		 */
		paySetp.o.theName = $(paySetp.o.chkId.ni).val();
		paySetp.o.theMoblie = parseInt($(paySetp.o.chkId.mi).val());
		paySetp.o.thePhone = parseInt($(paySetp.o.chkId.pi).val());
		paySetp.o.theEmail = $(paySetp.o.chkId.ei).val();
		paySetp.o.contactMsg = [["姓名不能为空","姓名不能以空格开头","姓名不能以空格结尾"],["手机号码不能为空或必须是数字"],["电话号码不能为空或必须是数字"],["E-mail格式错误","E-mail不能为空"],["电话或手机至少需"]];
		paySetp.o.payNowMsg = paySetp.o.contactMsg;
		paySetp.o.ta = [];
		
		function chkPhoneOrCellPhone(){
			
		}
		
		//0未定义，全部必填,1电话确认,2电子邮件确认,3传真确认,4短信确认
		switch(paySetp.o.method){
			case "0":
				n = 4;
				paySetp.inputNoSpace([paySetp.o.theName],[0],paySetp.o.ta);
				paySetp.chkNum([paySetp.o.theMoblie,paySetp.o.thePhone],[1,2],paySetp.o.ta);
				if (paySetp.o.theEmail == "") {
					alerter({msg:paySetp.o.payNowMsg[3][1],set:{css:paySetp.o.alerterCss}});
					return false;
				}else{
					paySetp.chkEmail(paySetp.o.theEmail,3,paySetp.o.ta);
				}
			break;
			
			case "1":
				n = 2;
				paySetp.inputNoSpace([paySetp.o.theName],[0],paySetp.o.ta);
				paySetp.chkNum([paySetp.o.thePhone],[2],paySetp.o.ta);
			break;
			
			case "2":
				n = 2;
				paySetp.inputNoSpace([paySetp.o.theName],[0],paySetp.o.ta);
				if (paySetp.o.theEmail == "") {
					alerter({msg:paySetp.o.payNowMsg[3][1],set:{css:paySetp.o.alerterCss}});
					return false;
				}else{
					paySetp.chkEmail(paySetp.o.theEmail,3,paySetp.o.ta);
				}
				if($.trim(paySetp.o.thePhone)=="" || $.trim(paySetp.o.theMoblie)==""){
					alerter({msg:paySetp.o.payNowMsg[4][0],set:{css:paySetp.o.alerterCss}});
					return false;
				}else{
					if($.trim(paySetp.o.thePhone)!=""){
						paySetp.chkNum([paySetp.o.thePhone],[2],paySetp.o.ta);
					}
					if($.trim(paySetp.o.theMoblie)!=""){
						paySetp.chkNum([paySetp.o.theMoblie],[1],paySetp.o.ta);
					}
				}
			break;
			
			case "3":
				n = 2;
				paySetp.inputNoSpace([paySetp.o.theName],[0],paySetp.o.ta);
				paySetp.chkNum([paySetp.o.thePhone],[2],paySetp.o.ta);
			break;
			
			case "4":
				n = 2;
				paySetp.inputNoSpace([paySetp.o.theName],[0],paySetp.o.ta);
				paySetp.chkNum([paySetp.o.theMoblie],[1],paySetp.o.ta);
			break;
			
		}

		if(paySetp.o.ta.length != n){
			return false
		}
		paySetp.o.ta = null;
		return true;
	},
	payNow:function(n){
		paySetp.o.payee = $(paySetp.o.chkId.pe).val();
		paySetp.o.payer = $(paySetp.o.chkId.pr).val();
		paySetp.o.productName = $(paySetp.o.chkId.pn).val();
		paySetp.o.price = parseFloat($(paySetp.o.chkId.pp).val());
		paySetp.o.payNowMsg = [["付款人不能为空","付款人不能以空格开头","付款人不能以空格结尾"],["商品名称不能为空","商品名称不能以空格开头","商品名称不能以空格结尾"],["付款金额必须为数字"]];
		paySetp.o.ta = [];
		paySetp.inputNoSpace([paySetp.o.payer,paySetp.o.productName],[0,1],paySetp.o.ta,function(){paySetp.chkNum([paySetp.o.price],[2],paySetp.o.ta)});
		if(paySetp.o.ta.length != n){
			return false
		}
		paySetp.o.ta = null;
		return true;
	}
}),
newWoW = Class($_$, {
    creat: function(o, c) {
        this.o = o;
        newWoW.o = this.o;
        if (c) {
            newWoW.o.cb = c;
        }
    },
    setWoW: function() {
        newWoW.o.firstDay = $(newWoW.o.chkOpIds[0]).val();
        if (newWoW.o.firstDay == "") {//如果第一天没内容的话则视为失败不再往下
            return false;
        } else {
            newWoW.o.endDay = $(newWoW.o.chkOpIds[1]).val();
            newWoW.o.aduNum = $(newWoW.o.chkOpIds[2]).val();
            newWoW.o.chiNum = $(newWoW.o.chkOpIds[3]).val();
            newWoW.o.houses = $(newWoW.o.chkOpIds[4]).val();
            newWoW.o.starCity = encodeURIComponent($(newWoW.o.chkOpIds[5]).val());
            newWoW.o.endCity = encodeURIComponent($(newWoW.o.chkOpIds[6]).val());
            newWoW.o.days = $(newWoW.o.chkOpIds[7]).val();
            newWoW.o.travel = $(newWoW.o.chkOpIds[8]).val();
            newWoW.o.travelCity = $(newWoW.o.chkOpIds[9]).val();
            newWoW.o.defFly = $(newWoW.o.chkOpIds[10]).val();
            newWoW.o.fTypeBox = $(newWoW.o.chkOpIds[10]);
            newWoW.o.flieNameBox = $(newWoW.o.oderOpIds[7]);
            newWoW.o.orderBox = $(newWoW.o.obId);
            newWoW.o.flyfield = $(newWoW.o.flyBoxId[0]);
            newWoW.o.hidFlyfield = $(newWoW.o.flyBoxId[1]);
            newWoW.o.field = $(newWoW.o.innerId);
            newWoW.o.honor = $(newWoW.o.pricesIds[0]);
            newWoW.o.honorT = $(newWoW.o.pricesIds[1]);
            newWoW.o.allPriceBox = $(newWoW.o.pricesIds[2]);
            newWoW.o.reBut = $(newWoW.o.reChkId[0]);
            newWoW.o.reForm = typeof (newWoW.o.reChkId[1]) == "string" ? $(newWoW.o.reChkId[1]) : $("form").eq(newWoW.o.reChkId[1]);
            newWoW.o.nextBut = $(newWoW.o.nextId[0]);
            newWoW.o.nextForm = typeof (newWoW.o.reChkId[1]) == "string" ? $(newWoW.o.nextId[1]) : $("form").eq(newWoW.o.nextId[1]);
            newWoW.o.honors = [];
            newWoW.o.nowLoadding = "<p class=\"loadding\" id=\"nowLoadding\">" + O_o.loadMsgA + "</p>"; //加载提示信息
            newWoW.o.loading = $("#isLoadding");
            newWoW.o.maxCoun = 2;
            newWoW.o.waitCoun = 15;
            newWoW.o.varBoxId = "#itinerarySet";
            newWoW.o.moreMsg = [["查看更多航班", "查看更多", "收起列表"], ["moreInfo", "closeMoreInfo"], ["showMore", "hideMore"]];
            newWoW.o.varSelect = $(newWoW.o.varBoxId + " select");
            newWoW.o.roomNumSelecter = $("#rooms");
            newWoW.o.reChkMsg = "您必须点击<strong class=\"cf20\">重新查询按钮</strong>使您新的人数或房间数生效。";
            newWoW.o.alerterCss = "padding:10px;width:250px;text-align:left;";
            newWoW.o.alerterOt = 3500;
        }
    },
    advWoWOp: function() {
        newWoW.o.Echelon = $(newWoW.o.daysId + " li");
        newWoW.o.showMore = newWoW.o.field.find("a[bt]").add("input[bt]");
        newWoW.o.showBox = [];
        for (var i = 0; i < newWoW.o.Echelon.length; i++) {
            var id = newWoW.o.daysId + i;
            newWoW.o.showBox.push($(id));
        }
        newWoW.o.teamBox = newWoW.o.field.find("div[type]");
        newWoW.o.hotelBoxList = [];
        newWoW.o.onedayBoxList = [];
        newWoW.o.foodBoxList = [];
        newWoW.o.carBoxList = [];
        newWoW.o.entBoxList = [];
        newWoW.o.marryBoxList = [];

        newWoW.o.beHotel = [];
        newWoW.o.beOneday = [];
        newWoW.o.beFood = [];
        //newWoW.o.beCar = [];
        newWoW.o.beEnt = [];
        newWoW.o.beMarry = [];
        //newWoW.o.beOther = [];

        $.each(newWoW.o.teamBox, function(i) {
            switch ($(this).attr("type")) {
                case "hotel":
                    newWoW.o.hotelBoxList.push($(this));
                    break;
                case "oneday":
                    newWoW.o.onedayBoxList.push($(this));
                    break;
                case "food":
                    newWoW.o.foodBoxList.push($(this));
                    break;
                case "car":
                    newWoW.o.carBoxList.push($(this));
                    break;
                case "ent":
                    newWoW.o.entBoxList.push($(this));
                    break;
                case "marry":
                    newWoW.o.marryBoxList.push($(this));
                    break;
            }
            if (i == newWoW.o.teamBox.length - 1) {
                newWoW.o.teamBox = null;
            }
        })
    },
    theTabSelecter: function() {
        $.each(newWoW.o.Echelon, function(i) {
            $(this).bind("click", function() {
                if ($(this).attr("class") == newWoW.o._eOn) {
                    return false;
                }
                newWoW.o.Echelon.removeAttr("class");
                $(this).attr("class", newWoW.o._eOn);
                $.each(newWoW.o.showBox, function(ii) {
                    if (ii == i) {
                        $(newWoW.o.showBox[ii]).css("display", "block");
                    } else {
                        $(this).css("display", "none");
                    }
                })
            })
        })
    },
    showTheBox: function() {
        clearInterval(newWoW.o.counter);
        newWoW.o.tCoun = 0;
        newWoW.o.coun = 0;
        newWoW.o.waitCoun = null;
        newWoW.o.maxCoun = null;
        newWoW.getPrice(); //初始化后获取总价
        if (newWoW.o.cb != undefined) {
            newWoW.o.cb();
        }

        $.each(newWoW.o.showBox, function(i, n) {
            if (i > 0) {
                n.css("display", "none");
            }
        })
        newWoW.o.orderBox.css("display", "none");
        newWoW.o.loading.css("display", "none");
        newWoW.o.orderBox.css({
            position: "static",
            left: "auto",
            top: "auto"
        });
        newWoW.o.orderBox.animate({ opacity: "show" }, "fast", function() { newWoW.o.orderBox.removeAttr("style") });
        newWoW.o.counter = null;
        delete (newWoW.o.counter);
        //newWoW.o.counter = null;

    },
    theCounter: function() {
        newWoW.o.coun = 0;
        newWoW.o.tCoun = 0;
        newWoW.o.counter = setInterval(function() {
            if (newWoW.o.coun == newWoW.o.maxCoun || newWoW.o.tCoun == newWoW.o.waitCoun) {

                if (newWoW.o.coun == newWoW.o.maxCoun) {
                    newWoW.showTheBox();
                }
                if (newWoW.o.tCoun == newWoW.o.waitCoun) {
                    if (newWoW.o.field.find("div").length > 0 && newWoW.o.flyfield.find("div").length > 0) {
                        newWoW.showTheBox();
                    } else {
                        if (confirm("很抱歉，看来页面似乎失去了响应。请点击“确定”按钮重新刷新，或点击“取消”按钮继续等待")) {
                            clearInterval(newWoW.o.counter);
                            newWoW.o.reForm.unbind();
                            newWoW.o.reForm.attr("action", "");
                            newWoW.o.reForm.submit();
                        } else {
                            newWoW.o.tCoun = 0;
                        }
                    }
                }

            } else {
                newWoW.o.tCoun += 1;
            }

        }, 1000)
    },
    huntersMark: function(dat) {//Ajax请求
        $.ajax({
            type: "GET",
            url: newWoW.o.innerUrl,
            data: dat,
            cache: false,
            error: function() {//团灭
                var otMsg;
                otMsg = setTimeout(function() {
                    alerter({ msg: "很抱歉，获取您的行程安排时发生了个错误，请重新点击您要安排行程的日期重新获取您的行程安排。", set: { css: "width:200px;padding:15px 0;" }, ot: 2000 }, function() {
                        clearTimeout(otMsg);
                        otMsg = null;
                    });
                }, 500)
                return false;
            },
            success: function(re) {
            //$(newWoW.o.field).append(re);
                _$("innerJourney").innerHTML = re;
                newWoW.o.orderBox.css("display", "block");
                newWoW.advWoWOp();
                newWoW.bindEvents();
                newWoW.o.coun += 1;
                newWoW.theTabSelecter();
            }
        })
    },
    morePT: function(t) {//机票获取办法
        var PTLP, aDat,
			sDat = "TravelID=" + newWoW.o.travel + "&TravelCityID=" + newWoW.o.travelCity + "&Ticket_BeginDate=" + newWoW.o.firstDay + "&Ticket_BeginDate_B=" + newWoW.o.endDay + "&strStart_City=" + newWoW.o.starCity + "&strEnd_City=" + newWoW.o.endCity + "&LodgingAdultNum=" + newWoW.o.aduNum + "&LodgingChildNum=" + newWoW.o.chiNum + "&isAPIOrData=";
        if (t) {
            PTLP = t;
        } else {
            PTLP = $(newWoW.o.chkOpIds[10]).val() == 0 ? 1 : 0
        }
        aDat = sDat + PTLP;
        $.ajax({
            type: "GET",
            url: newWoW.o.flyUrl,
            data: aDat,
            cache: false,
            error: function() { /*团灭*/ },
            success: function(h) {
                if (h != "0") {
                    newWoW.o.flyfield.html(h);
                    if (!t) { newWoW.o.fTypeBox.val(PTLP) }
                    newWoW.o.nowFly = PTLP;
                    newWoW.o.flyIsSelect = newWoW.o.flyfield.find("table");
                    newWoW.o.flySelecter = newWoW.o.flyfield.find("input:radio");
                    var chk = newWoW.o.flyfield.find("input:checked");
                    chk.attr("chk", "1");
                    newWoW.setFly(chk);
                    chk.attr("checked", true);
                    newWoW.o.coun += 1;
                }
            }
        })
    },
    setHeight: function(t1, t2) {
        var arr = [], theMax;
        t1.removeAttr("style");
        t2.removeAttr("style");
        arr.push(t1.outerHeight());
        arr.push(t2.outerHeight());
        theMax = arr.Max();
        t1.height(theMax);
        t2.height(theMax);
    },
    showAndHide: function(o) {
        var type = $(o).attr("bt"), tag, uls, ob;
        function sAndH(t, tt) {
            var h1, h2;
            if (t.css("display") == "none") {

                t.css("display", "block");
                if (tt == 0) {
                    $(o).val(newWoW.o.moreMsg[0][2]);
                    $(o).attr("class", newWoW.o.moreMsg[1][1])
                }
                if (tt == 1) {
                    $(o).html(newWoW.o.moreMsg[0][2]);
                    $(o).attr("class", newWoW.o.moreMsg[2][1])
                }
            } else {
                t.css("display", "none");
                if (tt == 0) {
                    $(o).val(newWoW.o.moreMsg[0][tt]);
                    $(o).attr("class", newWoW.o.moreMsg[1][0])
                }
                if (tt == 1) {
                    $(o).html(newWoW.o.moreMsg[0][tt]);
                    $(o).attr("class", newWoW.o.moreMsg[2][0])
                }
                var pBox = $(o).parent().parent();
                newWoW.setHeight(pBox.find(".dayConLeft"), pBox.find(".dayConRight"));
            }
        }
        if (type == "showMore") {
            tag = $(o).parent().next();
            sAndH(tag, 0);
        }
        if (type == "showMoreA") {
            ob = $(o).parent().prev();
            uls = ob.find("ul");
            tag = ob.find("ul:last");
            if (uls.length == 2) {
                $(o).attr("h", ob.height())
                ob.css("height", "auto");
                sAndH(tag, 1);
            }
        }
    },
    tenSelect: function(n, z, ks) {//下拉列表生成方法
        var Zz, tSe, tses;
        if (n != 1) {
            var a;
            if (n == -1) {
                a = "<select " + z + ">";
            } else {
                a = "<select name=\"" + z + "\">";
            }
            if (ks) {
                tses = "<option selected=\"selected\">0</option>";
                for (i = 0; i < ks; i++) {
                    tses += "<option>" + (i + 1) + "</option>";
                }
                tSe = a + tses + "</select>";
            }
            else {
                tSe = a + "<option selected=\"selected\">0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>";
            }
        } else if (n == 1) {
            if (ks) {
                tses = "";
                for (i = 0; i < ks; i++) {
                    tses += "<option>" + (i + 1) + "</option>";
                }
                tSe = "<select name=\"" + z + "\">" + tses + "</select>";
            }
            else {
                tSe = "<select name=\"" + z + "\"><option selected=\"selected\">1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>";
            }
        }
        return tSe;
    },
    showHotelList: function(o) {
        shower({
            oid: $(o).attr("to"),
            evn: o,
            set: {
                type: "nal|nal",
                showType: "arrow",
                cls: ["newPopBox", "newArrow", "newClosePop"],
                bStyle: "width:250px;"
            }
        }, function() { })
    },
    returnDPrice: function(o) {
        var dp, vp = parseInt($(o).val().split(",")[1]);
        if (vp == 0) {
            dp = "----";
        } else {
            dp = "+" + vp;
        }
        return dp;
    },
    removeThisTr: function(o, roomList) {
        var tr = $(o).parent().parent();
        try {
            var rooms = roomList.find("tr").length;
            if (rooms == 2) {
                alert("必须至少选择一个房型");
                return false;
            }
            $("#" + tr.attr("room")).attr("checked", false);
            tr.find("img,a,select").unbind();
            tr.remove();
            newWoW.reGetList(roomList, "room");
            newWoW.getPrice();
        } finally {
            rooms = null;
            tr = null;
        }
    },
    addRooms: function(mt, o) {
        var str = "<tr class=\"dayConLeftTd\" room=\"" + $(o).attr("id") + "\"><td><img src=\"/images/del.gif\" /></td><td><a class=\"hotelName\" href=\"/hotel/ShowDetel.aspx?hotelid="+$(o).attr("hotelid")+"\" title=\""+$(o).attr("hotelname")+"\" target=\"_blank\">" + $(o).attr("hotelname") + "</td><td>" + $(o).attr("roomname") + "<a href=\"javascript:;\" title=\"查看详情\"  onclick=\"shower({oid:null,evn:this,set:{type:'ajax|GET',showType:'arrow',cls:['newPopBox','newArrow','newClosePop'],bStyle:'width:500px;'},bPath:'/Ajax/Hotel/HotelGuestRoomsDes.aspx?roomID=" + $(o).attr("proid") + "'})\" >（查看详情）</a></td><td><span>（<a href=\"javascript:;\" onclick=\"shower({oid:null,evn:this,set:{type:'ajax|GET',showType:'arrow',cls:['newPopBox orederCal','newArrow','newClosePop'],bStyle:'width:500px;'},bPath:'/Ajax/show-breakfast-detail.aspx?HGRP_GuestRoomID=440&amp;s_date=" + $(o).attr("s_date") + "&amp;e_date=" + $(o).attr("e_date") + "'},function(){bindBFELE()})\">早餐说明</a>）</span></td><td>" + newWoW.returnDPrice(o) + "</td><td>" + newWoW.tenSelect(1, $(o).attr("createname"), $("#aNum").val()) + "</td></tr>";
        mt.append(str);
        var tt = mt.find("tr[room='" + $(o).attr("id") + "']");
        tt.find("select").bind("change", function() {
            newWoW.getPrice();
        })
        newWoW.o.beHotel.push(tt);
        tt.find("img").bind("click", function() {
            newWoW.removeThisTr(this, mt);
        })
        str = null;
    },
    addOneday: function(mt, o) {
        var adds = $("#add" + $(o).attr("id")), str, addInfo, rArr;
        if (adds.val() == "") {
            str = "<tbody oneday=\"" + $(o).attr("id") + "\"><tr oneday=\"" + $(o).attr("id") + "\"><td class=\"tleft\">" + $(o).attr("pname") + "</td><td>成人：" + newWoW.tenSelect(1, $(o).attr("createname")) + "儿童： " + newWoW.tenSelect(0, $(o).attr("createnamechild")) + "</td></tr></tbody>"
            mt.append(str);
        } else {
            if (adds.val() == undefined) { return false; }
            var rArrVal = decodeURIComponent(adds.val());

            str = "<tbody oneday=\"" + $(o).attr("id") + "\"><tr oneday=\"" + $(o).attr("id") + "\"><td class=\"tleft\">" + $(o).attr("pname") + "</td><td>成人：" + newWoW.tenSelect(1, $(o).attr("createname")) + "儿童： " + newWoW.tenSelect(0, $(o).attr("createnamechild")) + "</td></tr>";
            eval("rArr=" + rArrVal);
            $.each(rArr, function(i, n) {
                var rAddVal = n;
                eval("addInfo=rAddVal");
                str += "<tr><td class=\"tleft\">" + addInfo._AOI_TypeName + "</td><td>份数：" + newWoW.tenSelect(-1, "name=\"" + adds.attr("breforemark") + i + "\" price=\"" + addInfo._AOI_Price + "\"") + "&yen;" + addInfo._AOI_Price + "/份</td></tr><tr><td colspan=\"2\" class=\"tleft\">备注：" + addInfo._AOI_FeeDesc + "</td></tr>";
            })
            str += "</tbody>";

            mt.append(str);
            addInfo = null;
            rArr = null;
        }
        var tt = mt.find("tbody[oneday='" + $(o).attr("id") + "']");
        tt.find("select").bind("change", function() {
            newWoW.getPrice();
        })
        newWoW.o.beOneday.push(tt);
        str = null;
    },
    addOther: function(mt, o, type) {
        var str = "<tr " + type + "=\"" + $(o).attr("id") + "\"><td>" + $(o).attr("pname") + "</td><td>成人：" + newWoW.tenSelect(1, $(o).attr("createname")) + "儿童： " + newWoW.tenSelect(0, $(o).attr("createnamechild")) + "</td></tr>";
        mt.append(str);
        var tt;
        if (type == "ent") {
            tt = mt.find("tr[ent='" + $(o).attr("id") + "']");
            tt.find("select").bind("change", function() {
                newWoW.getPrice();
            })
            newWoW.o.beEnt.push(mt.find("tr[ent='" + $(o).attr("id") + "']"));
        }
        if (type == "food") {
            tt = mt.find("tr[food='" + $(o).attr("id") + "']");
            tt.find("select").bind("change", function() {
                newWoW.getPrice();
            })
            newWoW.o.beFood.push(mt.find("tr[food='" + $(o).attr("id") + "']"));
        }
        str = null;
    },
    addMarry: function(mt, o) {
        var str = "<tr marry=\"" + $(o).attr("id") + "\"><td>" + $(o).attr("pname") + "</td><td>" + newWoW.tenSelect(1, $(o).attr("createname")) + "</td></tr>";
        mt.append(str);
        var tt = mt.find("tr[marry='" + $(o).attr("id") + "']");
        tt.find("select").bind("change", function() {
            newWoW.getPrice();
        })
        newWoW.o.beMarry.push(tt);
        str = null;
    },
    reGetList: function(mt, type) {
        var tags, tArr = [];
        if (type == "oneday") {
            tags = newWoW.o.field.find("tbody[" + type + "]");
        } else {
            tags = newWoW.o.field.find("tr[" + type + "]");
        }
        tArr = $.makeArray(tags);
        switch (type) {
            case "room":
                newWoW.o.beHotel = [];
                newWoW.o.beHotel = tArr;
                break;
            case "oneday":
                newWoW.o.beOneday = [];
                newWoW.o.beOneday = tArr;
                break;
            case "ent":
                newWoW.o.beEnt = [];
                newWoW.o.beEnt = tArr;
                break;
            case "food":
                newWoW.o.beFood = [];
                newWoW.o.beFood = tArr;
                break;
            case "marry":
                newWoW.o.beMarry = [];
                newWoW.o.beMarry = tArr;
                break;
        }
        tArr = null;
    },
    setHotelBox: function(o) {//设定酒店
        var roomListBox = $(o).find("div[US='unSelect']"),
			sBox = $(o).find("div[US='selected']"),
			roomList = sBox.find("table"),
			roomSelecter = roomListBox.find("span"),
			roomInput = roomListBox.find("input"),
			isSelected = roomListBox.find("input:checked");

        $.each(isSelected, function() {
            newWoW.addRooms(roomList, this);
        })
        newWoW.setHeight(roomListBox, sBox);
        $.each(roomSelecter, function() {
            var ri = $("#" + $(this).attr("to") + " input"), tb = $("#" + $(this).attr("to"));
            $.each(ri, function() {
                if (tb.attr("class") == "" || tb.attr("class") == undefined) {
                    $(this).bind("click", function() {
                        if ($(this).attr("checked") == false) {
                            var a = roomInput.filter(":checked").length;
                            if (a == 0) {
                                $(this).attr("checked", true);
                                alert("必须至少选择一个房型");
                                return false;
                            }
                            var tag = roomList.find("tr[room='" + $(this).attr("id") + "']"); //目标位于所属数组中的位置
                            tag.find("img,select,a").unbind();
                            tag.remove();
                            roomListBox.css("height", "auto");
                            sBox.css("height", "auto");
                            newWoW.setHeight(roomListBox, sBox);
                            newWoW.reGetList(roomList, "room");
                        } else {
                            newWoW.addRooms(roomList, this);
                            if (parseFloat(roomList.height()) > parseFloat(sBox.css("height"))) {
                                newWoW.setHeight(roomListBox, sBox);
                            }
                        }
                        newWoW.getPrice();
                    })
                }
            })
            $(this).bind("click", function() {
                newWoW.showHotelList(this);
            });
        })
    },
    setOnedayBox: function(o) {//设定一日游
        var onedayListBox = $(o).find("div[US='unSelect']"),
			sBox = $(o).find("div[US='selected']"),
			onedayList = sBox.find("table"),
			onedayChker = onedayListBox.find("input:checkbox"),
			isSelected = onedayListBox.find("input:checked");
        $.each(isSelected, function() {
            newWoW.addOneday(onedayList, this);
        })
        newWoW.setHeight(onedayListBox, sBox);
        $.each(onedayChker, function() {
            $(this).bind("click", function() {
                if ($(this).attr("checked") == false) {
                    var tag = onedayList.find("tbody[oneday='" + $(this).attr("id") + "']");
                    tag.find("select").unbind();
                    tag.remove();
                    onedayListBox.css("height", "auto");
                    sBox.css("height", "auto");
                    newWoW.setHeight(onedayListBox, sBox);

                    newWoW.reGetList(onedayList, "oneday");
                } else {
                    newWoW.addOneday(onedayList, this);
                    if (parseFloat(onedayList.height()) > parseFloat(sBox.css("height"))) {
                        newWoW.setHeight(onedayListBox, sBox);
                    }
                }
                newWoW.getPrice();
            })
        })
    },
    setOtherBox: function(o, t, type) {//设定其他类型
        var otherListBox = $(o).find("div[US='unSelect']"),
			sBox = $(o).find("div[US='selected']"),
			otherList = sBox.find("table"),
			otherChker = otherListBox.find("input:checkbox"),
			isSelected = otherListBox.find("input:checked");

        $.each(isSelected, function() {
            if (t == 0) {
                newWoW.addOther(otherList, this, type);
            } else {
                newWoW.addMarry(otherList, this);
            }
        })

        newWoW.setHeight(otherListBox, sBox);

        $.each(otherChker, function() {
            $(this).bind("click", function() {
                if ($(this).attr("checked") == false) {
                    if (t == 0) {
                        tag = otherList.find("tr[" + type + "='" + $(this).attr("id") + "']")
                    } else {
                        tag = otherList.find("tr[marry='" + $(this).attr("id") + "']")
                    }
                    tag.find("select").unbind();
                    tag.remove();
                    otherListBox.css("height", "auto");
                    sBox.css("height", "auto");
                    newWoW.setHeight(otherListBox, sBox);

                    if (t == 0) {
                        newWoW.reGetList(otherList, type);
                    } else {
                        newWoW.reGetList(otherList, "marry");
                    }
                } else {
                    if (t == 0) {
                        newWoW.addOther(otherList, this, type);
                    } else {
                        newWoW.addMarry(otherList, this);
                    }
                    if (parseFloat(otherList.height()) > parseFloat(sBox.css("height"))) {
                        newWoW.setHeight(otherListBox, sBox);
                    }
                }
                newWoW.getPrice();
            })
        })

    },
    setFly: function(t) {
        var t1 = "<tr>" + $(t).parent().parent().parent().html() + "</tr>",
			t2 = "<tr>" + $(t).parent().parent().parent().next().html() + "</tr>";
        tr = t1 + t2;
        if (newWoW.o.flyIsSelect.eq(0).find("tr").length > 1) {
            newWoW.o.flyIsSelect.eq(0).find("tr").eq(0).nextAll().remove();
            newWoW.o.flyIsSelect.eq(0).append(tr);
        } else {
            newWoW.o.flyIsSelect.eq(0).append(tr);
        }
        newWoW.o.flyIsSelect.eq(0).attr("price", $(t).attr("price"));
        newWoW.o.flyIsSelect.eq(0).find("p").attr("class", "isSelect");
        newWoW.o.flyIsSelect.eq(0).find("input").remove();
    },
    getPrice: function() {
        if ((newWoW.o.addNow == undefined) || (newWoW.o.addNow == 0)) {
            newWoW.o.addNow = 1;
            if (newWoW.o.counter && newWoW.o.counter != null) {
                clearInterval(newWoW.o.counter);
            }

            var allList = [newWoW.o.beHotel, newWoW.o.beOneday, newWoW.o.beFood, newWoW.o.beEnt, newWoW.o.beMarry]; //数组合并与初始化
            newWoW.o.allPricesArr = [];

            function getOnePrice(key, type, ev) {
                var tInput = $("#" + $(ev).attr(key)),
					anum = parseInt($(ev).find("select:first").val()),
					aprice = parseFloat(tInput.val().split(",")[0]),
					cprice, cnum, addInput,
					addPrice = 0,
					p = 0;

                switch (type.toString()) {
                    case "1": //只有成人
                        p = aprice * anum;
                        return p;
                        break;

                    case "2": //成人+儿童
                        cnum = parseInt($(ev).find("select:last").val());
                        cprice = parseFloat(tInput.val().split(",")[1]);
                        p = aprice * anum + cprice * cnum;
                        return p;
                        break;

                    case "3": //有附加产品的情况
                        addInput = $("#add" + $(ev).attr(key));
                        if (addInput.length == 0) {
                            return false;
                        }
                        cnum = parseInt($(ev).find("select").eq(1).val());
                        addSelecter = $(ev).find("select[price]");
                        cprice = parseFloat(tInput.val().split(",")[1]);
                        if ($(this).find("select").eq(2).val() != null) {
                            addPrice = parseInt($(this).find("select").eq(2).val()) * parseInt($(this).find("select").eq(2).attr("price"));
                        }
                        if (addInput.val() != "") {
                            $.each(addSelecter, function() {
                                addPrice += parseFloat($(this).attr("price")) * parseInt($(this).val());
                            })
                        }
                        p = aprice * anum + cprice * cnum + addPrice;
                        return p;
                        break;
                }
            }

            $.each(allList, function(i, n) {
                if ($(this).length > 0 && n != undefined) {
                    $.each(n, function(ii, nn) {
                        var p = 0;
                        switch (i.toString()) {
                            case "0":
                                newWoW.o.allPricesArr.push(getOnePrice("room", 1, this));
                                break;

                            case "1":
                                newWoW.o.allPricesArr.push(getOnePrice("oneday", 3, this));
                                break;

                            case "2":
                                newWoW.o.allPricesArr.push(getOnePrice("food", 2, this));
                                break;

                            case "3":
                                newWoW.o.allPricesArr.push(getOnePrice("ent", 2, this));
                                break;

                            case "4":
                                newWoW.o.allPricesArr.push(getOnePrice("marry", 1, this));
                                break;
                        }
                    })
                }
            })
            newWoW.o.honors = 0;
            $.each(newWoW.o.allPricesArr, function(i, n) {
                newWoW.o.honors += n;
            })
            var flyPrice = parseInt(newWoW.o.flyIsSelect.eq(0).attr("price"));
            newWoW.o.honors += flyPrice;
            newWoW.o.allPriceBox.val(newWoW.o.honors);
            newWoW.o.honor.html("&yen;" + newWoW.o.honors);
            newWoW.o.honorT.html("&yen;" + newWoW.o.honors);
            newWoW.o.allPricesArr = [];
            newWoW.o.addNow = 0
        } else {
            if (newWoW.o.addNow == 1) {
                newWoW.o.counter = setInterval(function() {
                    if (newWoW.o.addNow == 0) {
                        clearInterval(newWoW.o.counter);
                        delete (newWoW.o.counter);
                        newWoW.getPrice();
                    }
                }, 500)
            }
        }
    },
    bindEvents: function() {

        newWoW.o.varSelect.change(function() {
            if ($(this).attr("id") == "aNum") {
                var a = parseInt($(this).val());
                newWoW.o.roomNumSelecter.empty();
                for (var i = 0; i < a; i++) {
                    var n = i + 1;
                    if (i == 0) {
                        newWoW.o.roomNumSelecter.append("<option value=\"" + n + "\" selected=\"selected\" >" + n + "</option>");
                    } else {
                        newWoW.o.roomNumSelecter.append("<option value=\"" + n + "\" >" + n + "</option>");
                    }
                }
                newWoW.o.roomNumSelecter
            }

            alerter({ msg: newWoW.o.reChkMsg, set: { css: newWoW.o.alerterCss }, ot: newWoW.o.alerterOt });
        })


        $.each(newWoW.o.hotelBoxList, function() {//酒店
            if (newWoW.o.hotelBoxList.length == 0) { return false; }
            newWoW.setHotelBox(this);
        })

        $.each(newWoW.o.onedayBoxList, function() {//周边游
            if (newWoW.o.onedayBoxList.length == 0) { return false; }
            newWoW.setOnedayBox(this);
        })

        $.each(newWoW.o.foodBoxList, function() {//美食
            if (newWoW.o.foodBoxList.length == 0) { return false; }
            newWoW.setOtherBox(this, 0, "food");
        })

        $.each(newWoW.o.carBoxList, function() {//猪车
            if (newWoW.o.carBoxList.length == 0) { return false; }
        })

        $.each(newWoW.o.entBoxList, function() {//娱乐
            if (newWoW.o.entBoxList.length == 0) { return false; }
            newWoW.setOtherBox(this, 0, "ent");
        })

        $.each(newWoW.o.marryBoxList, function() {//婚纱
            if (newWoW.o.marryBoxList.length == 0) { return false; }
            newWoW.setOtherBox(this, 1);
        })

        $.each(newWoW.o.showMore, function() {//查看更多
            $(this).bind("click", function() {
                newWoW.showAndHide(this);
            })
        })

        newWoW.o.reBut.bind("click", function() {//重新查询
            newWoW.o.reForm.submit();
        })

        newWoW.o.nextBut.bind("click", function() {//下一步 
            newWoW.o.nextForm.submit();
        })

        $.each(newWoW.o.flySelecter, function() {//机票
            $(this).bind("click", function() {
                newWoW.setFly(this);
                newWoW.getPrice();
            })
        })

        newWoW.o.hotelBoxList = null;
        newWoW.o.onedayBoxList = null;
        newWoW.o.foodBoxList = null;
        newWoW.o.carBoxList = null;
        newWoW.o.entBoxList = null;
        newWoW.o.marryBoxList = null;
    },
    firstBlood: function() {//初始化
        newWoW.setWoW();
        var echData = "Ticket_BeginDate=" + newWoW.o.firstDay + "&Ticket_EndDate=" + newWoW.o.endDay,
			hunterData;
        hunterData = "TravelID=" + newWoW.o.travel + "&TravelCityID=" + newWoW.o.travelCity + "&Ticket_BeginDate=" + newWoW.o.firstDay + "&Ticket_EndDate=" + newWoW.o.endDay + "&LodgingAdultNum=" + newWoW.o.aduNum + "&LodgingChildNum=" + newWoW.o.chiNum + "&RoomNum=" + newWoW.o.houses;
        newWoW.o.orderBox.css({
            position: "absolute",
            left: "-10000px",
            top: "-10000px"
        })
        newWoW.morePT();
        newWoW.huntersMark(hunterData); //内容获取
        newWoW.theCounter();
        if (newWoW.o.cb != undefined) {
            newWoW.o.cb(); //回调函数
        }
    }
}),
//groupTravel({tid:["#topTotal","#allPrices"],fid:"#flyPeople",sid:"#sendM",nid:"#goNext"})
inGroupTravel = Class($_$, {
    creat: function(o, c) {
        this.o = o;
        inGroupTravel.o = this.o;
        if (c) {
            inGroupTravel.o.cb = c;
        }
    },
    getOp: function() {
        inGroupTravel.o.topPrice = $(inGroupTravel.o.tid[0]);
        inGroupTravel.o.bottomPrice = $(inGroupTravel.o.tid[1]);
        inGroupTravel.o.productPrice = parseFloat(inGroupTravel.o.topPrice.attr("producttotalprice"));
        inGroupTravel.o.allPriceBox = $(inGroupTravel.o.tid[2]);
        inGroupTravel.o.flyPrice = 0;
        inGroupTravel.o.flyBox = $(inGroupTravel.o.fid[0] + " table:first");
        inGroupTravel.o.flyList = $(inGroupTravel.o.fid[0] + " input:radio");
        inGroupTravel.o.flyIsSelect = $(inGroupTravel.o.fid[0] + " input:checked");
        inGroupTravel.o.showMoreBut = $(inGroupTravel.o.fid[0] + " input:button");
        inGroupTravel.o.flyPeopleBox = $(inGroupTravel.o.fid[1]);
        inGroupTravel.o.selfSelecter = [];
        $.each(inGroupTravel.o.flyPeopleBox.find("select"), function() {
            if ($(this).attr("name").indexOf("CustSafe") != -1) {
                inGroupTravel.o.selfSelecter.push(this);
            }
        })

        inGroupTravel.o.sendBox = $(inGroupTravel.o.sid);
        inGroupTravel.o.nextBut = $(inGroupTravel.o.nid);
        inGroupTravel.o.form = typeof (inGroupTravel.o.f) == "string" ? $(inGroupTravel.o.f) : $("form").eq(inGroupTravel.o.f);
        inGroupTravel.o.moreMsg = [["查看更多航班", "收起列表"], ["moreInfo", "closeMoreInfo"]];
    },
    bindEvent: function() {
        inGroupTravel.getFly(inGroupTravel.o.flyIsSelect);
        inGroupTravel.o.flyIsSelect.attr("checked", true);
        $.each(inGroupTravel.o.flyList, function() {
            $(this).bind("click", function() {
                inGroupTravel.getFly(this);
                inGroupTravel.getPrice();
            })
        })

        inGroupTravel.o.showMoreBut.click(function() {
            var o = this, tag = $(o).parent().next();
            if (tag.css("display") == "none") {
                tag.css("display", "block");
                $(o).val(inGroupTravel.o.moreMsg[0][1]);
                $(o).attr("class", inGroupTravel.o.moreMsg[1][1]);
            } else {
                tag.css("display", "none");
                $(o).val(inGroupTravel.o.moreMsg[0][0]);
                $(o).attr("class", inGroupTravel.o.moreMsg[1][0]);
            }
        })

        inGroupTravel.o.sendBox.find("input:radio").click(function() {
            if ($(this).parent().find("div").length > 0) {
                if ($(this).parent().find("div").css("display") == "none") {
                    $(this).parent().find("div").css("display", "block");

                }
            }
            inGroupTravel.getPrice();
        })

        $.each(inGroupTravel.o.selfSelecter, function() {
            $(this).change(function() {
                inGroupTravel.getPrice();
            })
        })

        inGroupTravel.o.form.submit(function() {
            function check() {
                var inputs = inGroupTravel.o.flyPeopleBox.find("input"),
					csr = inGroupTravel.o.sendBox.find("input:checked").parent().find("div:first input"),
					aN = 0,
					bN = 0,
					cssSet = "padding:10px;width:250px;text-align:center;";

                $.each(inputs, function() {
                    if ($.trim($(this).val()) != "") {
                        aN += 1;
                    }
                })

                $.each(csr, function() {
                    if ($.trim($(this).val()) != "") {
                        bN += 1;
                    }
                })

                if (aN != inputs.length) {
                    alerter({ msg: "请填写完整的乘机人信息。", set: { css: cssSet} });
                    return false;
                }

                if (bN != csr.length) {
                    alerter({ msg: "请填写完整的行程单（发票）配送方式。", set: { css: cssSet} });
                    return false;
                }

            }
            return check();
        })

    },
    getSelf: function() {
        inGroupTravel.o.sp = 0;
        var tsp = 0;
        $.each(inGroupTravel.o.selfSelecter, function() {
            tsp = 20 * parseInt($(this).val());
            inGroupTravel.o.sp += tsp;
        })

    },
    getFly: function(t) {
        var t1 = "<tr>" + $(t).parent().parent().parent().html() + "</tr>",
			t2 = "<tr>" + $(t).parent().parent().parent().next().html() + "</tr>";
        tr = t1 + t2;
        if (inGroupTravel.o.flyBox.find("tr").length > 1) {
            inGroupTravel.o.flyBox.find("tr:first").nextAll().remove();
            inGroupTravel.o.flyBox.append(tr);
        } else {
            inGroupTravel.o.flyBox.append(tr);
        }
        inGroupTravel.o.flyPrice = parseFloat($(t).attr("price"));
        inGroupTravel.o.flyBox.find("p").attr("class", "isSelect");
        inGroupTravel.o.flyBox.find("input").remove();
        $(t).attr("checked", true);
    },
    getPrice: function() {
        inGroupTravel.getSelf();
        inGroupTravel.o.send = 0;
        if (inGroupTravel.o.sendBox.find("input:radio").filter(":checked").val() == "2") {
            inGroupTravel.o.send = 10;
        }
        inGroupTravel.o.allPrice = inGroupTravel.o.productPrice + inGroupTravel.o.flyPrice + inGroupTravel.o.sp + inGroupTravel.o.send;
        inGroupTravel.o.allPriceBox.val(inGroupTravel.o.allPrice);
        inGroupTravel.o.topPrice.html("&yen;" + inGroupTravel.o.allPrice);
        inGroupTravel.o.bottomPrice.html("&yen;" + inGroupTravel.o.allPrice);
    },
    innt: function() {
        inGroupTravel.getOp();
        inGroupTravel.bindEvent();
        inGroupTravel.getPrice();
    }
}),
newPicLib = Class($_$,{
	creat:function(o,cb){
		this.o = o;
		newPicLib.o = this.o;
		if(cb&&typeof(cb) == "function"){
			newPicLib.o.cb = cb;
		}
	},
	setDefOption:function(){
		newPicLib.o.body = "<div class=\"picLib\" id=\"picLib\"><h4><span id=\"picTitle\"></span><span class=\"picClose\" id=\"picClose\"></span></h4><div class=\"bigPic\" id=\"bigPic\"></div><div class=\"leftArrBox\"><div class=\"leftArr\" id=\"leftArr\"></div></div><div class=\"smallImgList\"><div class=\"picBox\" id=\"picBox\"></div></div><div class=\"rightArrBox\"><div class=\"rightArr\" id=\"rightArr\"></div></div></div>";
		
	},
	setLib:function(){
		if(!newPicLib.o.libBox){
			$(function(){
				$("body").append(newPicLib.o.body);
				newPicLib.o.libBox = $("#picLib");
				newPicLib.o.libBox.removeAttr("id");
			})
		}
	},
	doShower:function(){
		
	},
	inntPicLib:function(){
		newPicLib.setDefOption();
		newPicLib.setLib();
		newPicLib.doShower();
	}
})




//释放内存,请保持在最后
$(document).bind("unload", function() {
	try {
		$_$ = null;
		$("*").unbind();
	} catch(e){}
});
window.onerror = function() { return true; }