// New tour detail page var SelectBox; SelectBox = (function() { this.down = ""; this.up = ""; this.data = []; function SelectBox() {} SelectBox.prototype.display = function() { for(var i = 0; i < this.data.length; i++) { $("." + this.data[i].display_class).html(""); $("." + this.data[i].display_class).html(this.makeParser(i)); } //return this.makeParser(); }; SelectBox.prototype.makeParser = function(o) { var tmp_template = "", tmp_inlayer = "", tmp_inlayer_for = "", sizeof = 0; sizeof = this.data[o].hotel_list.length; tmp_template += "
{hotel_name}<\/td>\n"; tmp_inlayer += " | {hotel_star}<\/td>\n";
tmp_inlayer += " <\/tr>\n";
for(var i = 0; i< sizeof; i++){
if(0 == i && sizeof > 0) {
tmp_inlayer_for += tmp_inlayer.replace("{hotel_name}", this.data[o].hotel_list[i].hotel_name);
tmp_inlayer_for = tmp_inlayer_for.replace("{hotel_star}", "" + this.data[o].hotel_list[i].hotel_star + ' ' + this.down + "");
tmp_inlayer_for = tmp_inlayer_for.replace("{style}", "");
}else if(i == (sizeof-1) && sizeof > 0){
tmp_inlayer_for += tmp_inlayer.replace("{hotel_name}", this.data[o].hotel_list[i].hotel_name);
tmp_inlayer_for = tmp_inlayer_for.replace("{hotel_star}", "" + this.data[o].hotel_list[i].hotel_star + ' ' + this.up + "");
tmp_inlayer_for = tmp_inlayer_for.replace("{style}", "style=\"display:none\"");
}else{
tmp_inlayer_for += tmp_inlayer.replace("{hotel_name}", this.data[o].hotel_list[i].hotel_name);
tmp_inlayer_for = tmp_inlayer_for.replace("{hotel_star}", this.data[o].hotel_list[i].hotel_star);
tmp_inlayer_for = tmp_inlayer_for.replace("{style}", "style=\"display:none\"");
}
}
tmp_template = tmp_template.replace("{inlayer}", tmp_inlayer_for);
tmp_template = tmp_template.replace("{inlayer}", "");
return tmp_template;
};
return SelectBox;
})();
selectS = function(o) {
var obj = $(o).parent("td").parent("tr").parent("tbody").parent("table").parent("div").parent("div");
$(obj).find(".selectedHotels table").addClass("allHotels");
$(obj).find(".selectedHotels table").find("tr").show();
$(obj).find(".selectedHotels tr:eq(0) img").hide();
}
selectH = function(o) {
var obj = $(o).parent("td").parent("tr").parent("tbody").parent("table").parent("div").parent("div");
$(obj).find(".selectedHotels table").removeClass("allHotels");
$(obj).find(".selectedHotels table").find("tr").hide();
$(obj).find(".selectedHotels table").find("tr").eq(0).find("img").show();
$(obj).find(".selectedHotels table").find("tr").eq(0).show();
}
$(function(){
function preloadImages(json) {
for(var i=0;i![]() ![]() /g, "\n"), {path: "/"}); }); $(".priceincluding ").html(""); $(".priceincluding ").html($.trim($(".pricetable table:eq(0) tr:eq(2) td:eq(3)").text()+"p/p")); } ); }); |