function getAirPortCode(name) {
	var cities = _basic_data.city;
	for ( var i = 0; i < cities.length; i++) {
		if (name == cities[i][1]) {
			return cities[i][0];
		}
	}
	return undefined;
};
function setkey(obj) {
	var val = obj.innerHTML;
	$(obj).parent().parent().siblings().eq(0).children("input").val(val);
}
function releaseTrans_callback(){
		window.open("http://trains.oyesgo.com/train_Release.jsp");
}
var channel = 0;
var index_type = "flights";
var ctx = null;
var current = null;
var index_map = {0 : "flights",1 : "hotels",2 : "trains",3 : "carrental",4 : "vacations"};
var re_index_map = {"flights":0,"hotels":1,"trains":2,"carrental":3,"vacations":4};
var locUrl = String(window.document.location.href);
function getParamValue(str){   
	var rs = new RegExp("(^|)"+str+"=([^\&]*)(\&|$)","gi").exec(locUrl), tmp;   
    if(tmp=rs){  
        return tmp[2];   
    }   
    return "";   
}

$(function() {
	var ifcs = getCookie("index_flight_city");
	if(ifcs!=null && ifcs.split(";").length ==4){
		var ifcss = ifcs.split(";");
		$("#city_to").attr("cid",ifcss[3]).val(ifcss[2]);
		$("#city_from").attr("cid",ifcss[1]).val(ifcss[0]);
	}
	function error(cid) {
		return /^\d+$/.test(cid);
	}
	function isPass(cid) {
		return /^\d+$/.test(cid);
	}
	var day = 1;//for one_way_flight
	var price = "不限";
	var pr = "[0,100000]";
	$("#flight_type1").attr("checked", "true");
	var flag = getCookie("oyesgo_history_tip");
	if (flag == null || flag != "1") {
		flag = false;
	} else {
		flag = true;
	}
	$(".new_btn")
			.click(
					function() {
						if (!flag) {
							var offset = $(this).offset();
							$(".search_clue").css("left", offset.left + 134)
									.css("top", offset.top - 60).show();
							setTimeout(function() {
								$(".search_clue").hide();
							}, 1000);
						}
						var jump = "http://www.oyesgo.com";
						var left = "";
						var right = "";
						if (index_type == "flights") {
							//ctx = $(".search_conditions").eq(i);
			                    var href = "http://flights.oyesgo.com/search.jsp?out=$fromCity&ret=$toCity&odt=$fromDate&ds=$day";
							var href2 = "http://flights.oyesgo.com/searchDouble.jsp?odt=$fromDate&rdt=$toDate&out=$fromCity&ret=$toCity&ds=0";
							var toFlightCity = $("#city_to").attr("cid");
							var fromFlightCity = $("#city_from").attr("cid");
							var checkout = formatDate(tom);
							fromFlightCity = getAirPortCode($("#city_from").val());//flight_citys[$("#city_from").val()];
							if (fromFlightCity == undefined
									|| fromFlightCity == "undefined" || $("#city_from").val() =="" || fromFlightCity == undefined) {
								
								if (fromFlightCity == undefined) {
									alert("出发城市为空或填写错误——请输入正确的出发城市!");
									return;
								}
							}
							
							toFlightCity = getAirPortCode($("#city_to").val());//flight_citys[$("#city_to").val()]
							if (toFlightCity == undefined
									|| toFlightCity == "undefined" || $("#city_to").val()=="" || toFlightCity == undefined) {
								if (toFlightCity == undefined){
									alert("到达城市为空或填写错误——请输入正确的到达城市!");
									return;
								}
							} 
							if(toFlightCity==fromFlightCity){
								alert("出发城市和到达城市不能相同");
								return false;
							}
							setCookie("index_flight_city",$("#city_from").val()+";"+fromFlightCity+";"+$("#city_to").val()+";"+toFlightCity);
							if ($("#flight_type1").attr("checked") == true) {
								var dateFrom = $("#flight_start_date").val();
								var dsds = dateFrom.split("-");
								var tmtm = new Date(dsds[0],parseInt(dsds[1])-1,(parseInt(dsds[2])+1));
								checkout = formatDate(tmtm);
								jump = href
										.replace("$fromCity", fromFlightCity)
										.replace("$toCity", toFlightCity)
										.replace("$day", day).replace(
												"$fromDate", dateFrom);
								left = "单程：" + $("#city_from").val() + "-"
										+ $("#city_to").val();
								right = dateFrom;
							} else {
								var dateFrom = $("#flight_start_date").val();
								var dateTo = $("#flight_end_date").val();
								checkout = dateTo;
								jump = href2.replace("$fromCity",
										fromFlightCity).replace("$toCity",
										toFlightCity)
										.replace("$toDate", dateTo).replace(
												"$fromDate", dateFrom);
								left = "往返：" + $("#city_from").val() + "-"
										+ $("#city_to").val();
								right = dateFrom + "至" + dateTo;
							}
							save_new_history(jump, "flights", left, right);
							if ($("#with_hotel").attr("checked")) {
								jump += "$http://hotels.oyesgo.com/hotel!s.action?star=-1&pr=[0,100000]&city="
										+ encodeURI($("#city_to").val())
										+ "&checkin="
										+ dateFrom
										+ "&checkout="
										+ checkout + "&key=";
							}

						} else if (index_type == "hotels") {
							var fromFlightCity = $("#city").attr("cid");
							var fromCity = $("#city").val();
							if($.trim(fromCity)==""){
								alert("入住城市不能为空!");
								return;
							}
							var href = "http://hotels.oyesgo.com/hotel!s.action?star=-1&city=$fromCity&checkin=$fromDate&checkout=$toDate&key=$key&pr=$pr&price=$price";
							var checkin = $("#checkin").val();
							var checkout = $("#checkout").val();
							var key = $("#keyword").val();
							price = $("#pricerange").val();
							jump = href.replace("$fromCity", fromCity).replace(
									"$key", key).replace("$toDate", checkout)
									.replace("$fromDate", checkin).replace(
											"$price", price).replace("$pr", pr);
							left = fromCity + "   " + price;
							right = checkin + "至" + checkout;
							var jump1 = jump = href.replace("$fromCity",
									encodeURI(fromCity)).replace("$key",
									encodeURI(key))
									.replace("$toDate", checkout).replace(
											"$fromDate", checkin).replace(
											"$price", encodeURI(price))
									.replace("$pr", pr);
							save_new_history(jump1, "hotels", left, right);
						} else if (index_type == "vacations") {
							var toCity = strEncode($("#vcity_from").val());
							var fromFlightCity = $("#vcity_from").attr("cid");
							if(!isPass(fromFlightCity)){
								if ($("#vcity_from").val() != "北京"){
									alert("出发城市为空或填写错误——请输入正确的出发城市!");
									return;
								}
							}
							var checkin = $("#checkIndate").val();
							var checkout = $("#checkOutdate").val();
							var key = strEncode($("#hotelkey").val());
							var href = "http://vacations.oyesgo.com/vacation.jsp?isInit=true&vcity=$toCity&checkin=$fromDate&checkout=$toDate&vkey=$key";
							jump = href.replace("$toCity", toCity).replace(
									"$toDate", checkout).replace("$fromDate",
									checkin).replace("$key", key);

							left = $("#vcity_from").val() + "-"
									+ $("#hotelkey").val();
							right = checkin;
							save_new_history(jump, "vacations", left, right);
						} else if (index_type == "trains") {
							var fromCity = $("#depcity").val();
							var toCity = $("#arrcity").val();
							var date = $("#t_dep_date").val();
							var tran_city = $("#transfer_city").val();
							if (fromCity == null || toCity == null
									|| fromCity == "" || toCity == "") {
								return;
							}
							if($.trim(fromCity) == $.trim(toCity)){
								alert("出发城市和目的地城市不能相同");
								return false;
							}
							var href = "";
							if ($("#train_type1").attr("checked") == true) {
								href = "http://trains.oyesgo.com/train_results.jsp?cbc=$fromCity&cec=$toCity&type=0&bc=$fromCity&ec=$toCity&date=$date";
								left = "时刻表：" + $("#depcity").val() + "-"
										+ $("#arrcity").val();
							} else if($("#train_type3").attr("checked") == true){
								href = "http://trains.oyesgo.com/train_resellInfo.jsp?type=2&bc=$fromCity&ec=$toCity&cbc=$fromCity&cec=$toCity";
								left = "转让信息：" + $("#depcity").val() + "-"
										+ $("#arrcity").val();
							}else if($("#train_type2").attr("checked") == true){
								if($.trim(toCity) == $.trim(tran_city)){
									alert("到达城市和中转城市不能相同");
									return false;
								}
								if($.trim(fromCity) == $.trim(tran_city)){
									alert("出发城市和中转城市不能相同");
									return false;
								}
								href="http://trains.oyesgo.com/train_Transfer.jsp?tc=$tran_city&type=1&date=$date&bc=$fromCity&ec=$toCity&cbc=$fromCity&cec=$toCity";
								left = "中转换乘：" + $("#depcity").val() + "-"
								+ $("#arrcity").val();
							}
							if(!date)date="";
							if(!tran_city)tran_city="";
							jump = href.replace(/\$fromCity/g, encodeURI(encodeURI(fromCity))).replace(
									/\$toCity/g, encodeURI(encodeURI(toCity))).replace(/\$date/g,date).replace(/\$tran_city/g, encodeURI(encodeURI(tran_city)));
							right = formatDate(new Date());
							var jump1 = href.replace(/\$fromCity/g, encodeURI(fromCity)).replace(
									/\$toCity/g, encodeURI(toCity)).replace(/\$date/g,date);
							save_new_history(jump1, "trains", left, right);
						} else if (index_type == "carrental") {
							var fromStr = $("#car_city_from").val();
							if(!isPass($("#car_city_from").attr("cid"))){
								if(fromStr=="北京"){
									
								}else{
									alert("取车地点为空或填写错误——请输入正确的取车地点!");
									return;
								}
							}
							var href = "http://carrental.oyesgo.com/searchCar.html?mode_type=$mode&city_from=$fromCity&"
									+ "city_from_str=$fromStr&city_to=$toCity&city_to_str=$toStr&bDate=$bDate"
									+ "&seat_num=$seat&keyWordStr=$key"
									+ "&keyWordTyp=2";
							var getCarCity =  !isPass($("#car_city_from").attr("cid"))? "1"
									: $("#car_city_from").attr("cid");
							var retCarCity = !isPass($("#car_city_to").attr("cid"))? ""
									: $("#car_city_to").attr("cid");
							
							var mode = 1;
							if ($("#drive_type2").attr("checked") == true) {
								mode = 2;
							}
							
							var toStr = $("#car_city_to").val();
							var bDate = $("#bDate").val();
							var seat = $("#seat").val();
							var key = $("#car_keyword").val();
							jump = href.replace("$fromCity", getCarCity)
									.replace("$fromStr", encodeURI(fromStr)).replace(
											"$toCity", encodeURI(retCarCity)).replace(
											"$toStr", encodeURI(toStr)).replace("$bDate",
											bDate).replace("$seat", encodeURI(seat))
									.replace("$key", encodeURI(key)).replace("$mode",mode);
							var jump1 = href.replace("$fromCity",
									encodeURI(getCarCity)).replace("$fromStr",
									encodeURI(fromStr)).replace("$toCity",
									retCarCity).replace("$toStr", toStr)
									.replace("$bDate", bDate).replace("$seat",
											encodeURI(seat)).replace("$key",
											encodeURI(key)).replace("$mode",mode);
							left = fromStr + "-" + toStr + "  " + key;
							right = bDate;
							save_new_history(jump1, "carrental", left, right);
						}
						//window.location.href=jump;
						
						var links = jump.split("$");
						if (links.length > 1) {
								window.open(links[1], "_self");
								window.open(links[0], "_blank");
						}else{
							window.open(links[0], "_self");
						}
						
					});

	$("#flight_type1").click(function(e) {
		$("#con1").show();
		$("#con2").hide();
		e.stopPropagation();
	});
	$("#flight_type2").click(function(e) {
		$("#con2").show();
		$("#con1").hide();
		e.stopPropagation();
	});
	//火车票日期POP控制
	$("#t_dep_date").click(function(e){
		var d = generateDate();
		$('<div style="z-index: 99999;" id="begin_date_" class="pop_click_out"></div>').appendTo(document.body);
		var offset = $("#t_dep_date").offset();
		$("#begin_date_").html(d).show().css("left",offset.left-3).css("top",offset.top+$("#t_dep_date").height()+1);
		$("#begin_date_ > ul > li >a").click(function(){
			$("#t_dep_date").val($(this).text());
			$("#begin_date_").remove();
		});
		e.stopPropagation();
	});
	//火车票发布转让信息
	function getNewCookieByLocal(name){
	     var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	     if(arr != null) return decodeURI(arr[2]); return null;
	}

	function releaseTransferentialInfo(){
		var userinfo=getNewCookieByLocal("ticket");
		if(userinfo==null || $.trim(userinfo)==""){
			_header_modal("releaseTrans_callback();");
		}else{
			releaseTrans_callback();
		}
		
	}
	$("#post_trans").click(function(){
		releaseTransferentialInfo();
		return false;
	});
  

	/*專題tab切換*/
	$(".topic h4 li").each(function(i){
		$(this).click(function() {
			if ($(this).attr("class") != "on") {
				$(this).addClass("on");
				$(this).siblings().removeClass("on");
				if(i==0){
					$(".topic_content .topic_insider").show();
					$(".topic_content .hot_list").hide();
				}else{
					$(".topic_content .topic_insider").hide();
					$(".topic_content .hot_list").show();
				}
			}
		});
	});
	
	/*签证tab控制*/
	$(".hot_tabs_visa li").each(function(i) {
		$(this).click(function() {
			if ($(this).attr("class") != "on") {
				$(this).addClass("on");
				$(this).siblings().removeClass("on");
				var box = $(this).parents(".hot_box");
				var ctx = $(".hot_content", box).eq(i).siblings(".hot_content").hide();
				var cnt  = $(".subject_content",ctx).html();
				var nxt = $(".hot_content", box).eq(i);//.show();
				$(".subject_content",nxt).html(cnt);
				nxt.show();
			}
		});
	});
	/*度假tab控制*/
	$(".hot_tabs_vocation li").each(function(i) {
		$(this).click(function(e) {
			if ($(this).attr("class") != "on") {
				$(this).addClass("on");
				$(this).siblings().removeClass("on");
				var box = $(this).parents(".hot_box");
				var ctx = $(".hot_content", box).eq(i).siblings(".hot_content").hide();
				var cnt  = $(".subject_content",ctx).html();
				var nxt = $(".hot_content", box).eq(i);
				$(".subject_content",nxt).html(cnt);
				nxt.show();
			}
			e.stopPropagation();
		});
	});

	$("#pop_hot_city ul a").mousedown(function(oevent) {
		current.val($(this).text());
		current.attr("cid", $(this).attr("id"));
		$("#pop_hot_city").hide();
		oevent.stopPropagation();
	});

	$(".btn_close").click(function(e) {
		$("#pop_hot_city").hide();
		e.stopPropagation();
	});

	$(".more_city").click(function(oevent) {
		$("#pop_hot_city").show();
		var temp = $(this).siblings("input");
		current = temp;
		$("#pop_hot_city").css( {
			left : temp.offset().left - 2,
			top : temp.offset().top + 22
		});
		oevent.stopPropagation();
	});

	$(".more_date").click(function(e) {
		$(this).siblings("input").eq(0).trigger("click");
		e.stopPropagation();
	});
	    $(".other_hotel").click(function(e){
	    	$(this).addClass("on");
	         $("#hot_city_pop_hotel").css("left", $(this).offset().left).css(
						"top", $(this).offset().top + $(this).height()).show();
	         e.stopPropagation();
	    });
	$(".other_flight").click(
			function(e) {
				$(this).addClass("on");
				$("#hot_city_pop_flight").css("left", $(this).offset().left).css(
						"top", $(this).offset().top + $(this).height()).show();
				e.stopPropagation();
			});
	function hide_all(){
		$(".db__date").remove();
		$("#hotcar_pop_d2").hide();
		$("#pop_hot_city").hide();
		$("#pop_price_range").hide();
		$("#flight_pop_date_select").hide();
		$("#pop_seat").hide();
		$("#begin_date_").remove();
	}
	$(".search_nav li").each(
			function(i) {
				$(this).click(function(e) {
					hide_all();
					if ($(this).attr("class") != "on") {
						channel = i;
						index_type = index_map[i];
						var temp = $(".search_nav .on");
						temp.removeClass("on");
						$(".explain", temp).hide();
						$(this).addClass("on");
						$(".explain", this).show();
						var cur = $(".search_conditions").eq(i);
						//cur.show();
						cur.css("display", "");
						cur.siblings().hide();
						if (!flag) {
							var offset = $(".more_history", cur).offset();
							$(".search_clue").css("left", offset.left).css(
									"top", offset.top - 60);
						} else {
							$(".search_clue").hide();
						}
						$(".search_note_pop").hide();
					}
					e.stopPropagation();
				});
			});
	var channel = getParamValue("channel");
	if(channel!=""){
		var i = re_index_map[channel];
		$(".search_nav li").eq(i).trigger("click");
	}
	$(".hotel_sale li").each(function(i) {
		$(this).click(function(e) {
			if ($(this).attr("class") != "on") {
				$(this).addClass("on");
				$(this).siblings().removeClass("on");
				
				var ctx = $(".hotel_sale .index_sale_content:visible").eq(0);
				var cnt = $(".subject_content",ctx).html();
				var temp = $(".hotel_sale .index_sale_content").eq(i);
				
				var nxt = $(".subject_content",temp);
				nxt.html(cnt);
				temp.show();
				temp.siblings(".index_sale_content").hide();
			}

		});
	});

	$(".f_content").each(function() {
		$(this).children("li").eq(0).addClass("on");
	});

	$(".h_title li").each(
			function(i) {
				$(this).click(
						function(e) {
							var temp = $(this).parents(".index_sale_content")
									.children(".h_content");
							var offer = $(this).parent().siblings(".offer").eq(
									i%3);
							offer.show();
							offer.siblings(".offer").hide();
							var t = $(".hleft", temp).eq(i % 3);
							t.siblings(".hleft").hide();
							t.show();
							var f = $(".right", temp).eq(i % 3);
							f.siblings(".right").hide();
							f.show();
						});
			});

	$("#sale_cities li").each(function(i) {
		$(this).click(function(e) {
			if ($(this).attr("class") != "on") {
				$(this).addClass("on");
				$(this).siblings().removeClass("on");
				var ctx = $(".f_content:visible");
				var cnt = $(".subject_content",ctx).html();
				var temp = $(".f_content").eq(i);
				$(".subject_content",temp).html(cnt);
				temp.show();
				temp.siblings(".f_content").hide();
			}
			return false;
		});
	});

	$(".search_clue input").click(function(e) {
		if (this.checked) {
			$(".search_clue").hide();
			setCookie("oyesgo_history_tip", 1);
		}
		e.stopPropagation();
	});
	$("#two_2").click(function(e) {
		$("#two_1").removeClass("on");
		$(this).addClass("on");
		$("#con_two_1").hide();
		$("#con_two_2").show();
		e.stopPropagation();
	});
	$("#two_1").click(function(e) {
		$("#two_2").removeClass("on");
		$(this).addClass("on");
		$("#con_two_1").show();
		$("#con_two_2").hide();
		e.stopPropagation();
	});

	$("#btnClose").click(function() {
		$("#hotcar_pop_d2").hide();
	});
	
	$("input:radio", $(".flight_type")).each(function(i) {
        $(this).click(function() {
        	var ctx = $(".search_conditions:visible");
        	var cds = $(".condition",ctx);
        	switch (i) {
			case 2:
				cds.eq(1).removeClass("tr_getime");
				cds.eq(2).removeClass("tr_getime");
				cds.eq(3).addClass("tr_getime");
				cds.eq(4).addClass("tr_getime");
				break;
			case 3:
				cds.eq(1).addClass("tr_getime");
				cds.eq(2).addClass("tr_getime");
				cds.eq(3).addClass("tr_getime");
				cds.eq(4).addClass("tr_getime");
				break;
			case 4:
				cds.eq(1).removeClass("tr_getime");
				cds.eq(2).removeClass("tr_getime");
				cds.eq(3).removeClass("tr_getime");
				cds.eq(4).removeClass("tr_getime");
				break;
			default:
				break;
			}
        });
	});


	$(document).click(function(e) {
		$(".other_hotel,.other_flight").removeClass("on");
		$("#pop_seat,#hotcar_pop_d2").hide();
		$(".hot_city_pop,.search_note_pop").hide();
		$("#pop_price_range,#flight_pop_date_select,#pop_hot_city").hide();
		$("#begin_date_").remove();
		e.stopPropagation();
	});
	//pop up select div controller
	$("#search_within_days").click(
			function(e) {
				var offset = $(this).offset();
				$("#flight_pop_date_select").css("left", offset.left).css(
						"top", offset.top + 22).show();
				e.stopPropagation();
			});
	$("#flight_pop_date_select a").click(function(e) {
		$("#search_within_days input").val($(this).text());
		day = $(this).attr("val");
	});

	$("#pop_price_range a").click(function(e) {
		pr = $(this).attr("val");
		var label = $(this).text();
		$("#pricerange").val(label);
		$("#pop_price_range").hide();
	});

	$("#pricerange").click(
			function(e) {
				var offset = $(this).offset();
				$("#pop_price_range").css("top", offset.top + 18).css("left",
						offset.left - 5).css(
						"width",
						$("#pricerange").width()
								+ $("#pricerange_flag").width() + 15).show();
				$("#pop_price_range a").eq(0).css("color", "#fff").css(
						"background", "#5E5E5E");
				$("#pop_price_range a").eq(0).hover(function() {
					$(this).css("color", "#fff").css("background", "#5E5E5E");
				}, function() {
					$(this).css("color", "#5E5E5E").css("background", "#fff");
				});
				e.stopPropagation();
			});

	$("#pricerange_flag").click(function(e) {
		$("#pricerange").trigger("click");
		e.stopPropagation();
	});

	$("#aHotKey").click(
			function(e) {
				$("#hotcar_pop_d2").css("left",
						$("#car_keyword").offset().left - 3).css("top",
						$("#car_keyword").offset().top + 19).show();
				e.stopPropagation();
			});
	$(".car_s input").click(
			function(e) {
				$("#pop_seat").css("left", $(this).offset().left).css("top",
						$(this).offset().top + $(this).height()).show();
				e.stopPropagation();
			});
	$("#pop_seat li").hover(function() {
		$(this).addClass("on");
	}, function() {
		$(this).removeClass("on");
	}).click(function() {
		$(".car_s input").val($(this).text());
		$("#pop_seat").hide();
	});
	$("#con_two_1 a").click(function() {
		$("#car_keyword").val($(this).text());
		$("#hotcar_pop_d2").hide();
		//e.stopPropagation();
		});
	$("#con_two_2 a").click(function(e) {
		$("#car_keyword").val($(this).text());
		$("#hotcar_pop_d2").hide();
		//e.stopPropagation();
		});
	//end of pop up

	//    $(".f_content .more").siblings("a").hover(function(){
	//           $(this).addClass("on");
	//           $(this).siblings("a").removeClass("on");
	//    });

	$(".f_content>ul").children("li").hover(function() {
		$(this).addClass("on");
		$(this).siblings("li").removeClass("on");
	});

	function display_cookie(type, target) {
		var cookie = null;
		cookie = getNewCookie("oyesgo_search_history_" + type);
		if (cookie == null)
			return;
		var arr = cookie.split("$");
		vtext = '<ul>';
		for ( var i = 0; i < arr.length; i++) {
			var arrr = arr[i].split("+");
			var link = arrr[0];
			if (type == "train") {
				link = link.replace(/@/g, "%u");
			}
			vtext += '<li><a href="' + link + '" target="_blank"><span>'
					+ arrr[1] + '</span><em>' + arrr[2] + '</em></a></li>';
		}
		vtext += '</ul>';
		if ($(".search_note_pop").length == 0) {
			$("<div class=\"search_note_pop\" style=\"display:none;\"></div>")
					.appendTo(document.body);
		}
		$(".search_note_pop").html("").html(vtext).css("left",
				target.offset().left - 144)
				.css("top", target.offset().top + 36).show();
	}

	$(".more_history").click(function(e) {
		try {
			display_cookie(index_type, $(this));
		} catch (e) {
			alert(e);
		}
		e.stopPropagation();
	});

	$(".index_sale_content .f_content").children("ul").each(function() {
		$(this).children("li").eq(0).addClass("on");
	});

	$(".index_sale_content .h_title ul").each(function() {
		$(this).children("li").eq(0).addClass("on");
	});
  	$(".hot_box .index_title .hot_tabs ul li").hover(function(){
		$(this).addClass("current");
	},function(){
		$(this).removeClass("current");
	});

	$(".search_note_pop").hide();
	var reffer = document.referrer;
	var ourl = "http://extend.oyesgo.com/redirect.jsp?r="+reffer+"&ref=$door&url=http://www.oyesgo.com";
	
	var adid = getParamValue("id");
	if(adid!=null && adid!=""){
		$.getScript(ourl.replace("$door",adid));
	}
});
