var HotelInfo = { str_Err : '', HotelDetails :{ items:[ { id:'7786', name:'%u5317%u4EAC%u8FF7%u4F60%u8FDE%u9501%u9152%u5E97%uFF08%u5D07%u6587%u95E8%u5E97%uFF09', price:'99', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200918172974210.jpg' }, { id:'9464', name:'%u5317%u4EAC%u8FF7%u4F60%u8FDE%u9501%u897F%u56DB%u5E97%uFF08%u91D1%u699C%u7F18%u5BBE%u9986%uFF09', price:'99', picture:'http://www.zhuna.cn/Hotel_Images/160x120_201042613194478995.jpg' }, { id:'5832', name:'%u5317%u4EAC%u5357%u83DC%u56ED%u5BBE%u9986', price:'108', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200712289474027433.jpg' }, { id:'6046', name:'%u5317%u4EAC%u7164%u79D1%u5BBE%u9986', price:'110', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200874902595883.jpg' }, { id:'6140', name:'%u5317%u4EAC%u91D1%u6CF0%u4E4B%u5BB6%u8FDE%u9501%u9152%u5E97%uFF08%u52B2%u677E%u5E97%uFF09', price:'110', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200882810212594792.jpg' }, { id:'8385', name:'%u5317%u4EAC%u7231%u4E50%u56ED%u5546%u52A1%u5BBE%u9986', price:'110', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20101221512450651.jpg' }, { id:'5189', name:'%u5317%u4EAC%u4E1C%u5916%u5BBE%u9986', price:'118', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200781710102879501.jpg' }, { id:'5864', name:'%u5317%u4EAC%u5F97%u99A8%u805A%u5BBE%u9986', price:'118', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20081914275611400.jpg' }, { id:'8248', name:'%u5317%u4EAC%u5FB7%u5947%u5BBE%u9986', price:'118', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20097114475850212.jpg' }, { id:'9627', name:'%u5317%u4EAC%u9F99%u798F%u5BAB%uFF08%u805A%u798F%u5BBE%u9986%u5E97%uFF09', price:'118', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200912282243412393.jpg' }, { id:'5366', name:'%u5317%u4EAC%u83CA%u4E50%u6E90%u5BBE%u9986', price:'120', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20089111473462609.jpg' }, { id:'5847', name:'%u5317%u4EAC%u4E1C%u56DB%u798F%u82D1%u5BBE%u9986', price:'120', picture:'http://www.zhuna.cn/Hotel_Images/160x120_2007122910195656894.jpg' }, { id:'8011', name:'%u5317%u4EAC161%u5BA2%u6808', price:'120', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20094301793147031.jpg' }, { id:'8111', name:'%u5317%u4EAC%u7F8E%u6797%u5BBE%u9986', price:'120', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20096915112119964.jpg' }, { id:'13353', name:'%u5317%u4EAC%u4EAC%u7855%u5BBE%u9986', price:'120', picture:'http://www.zhuna.cn/Hotel_Images/160x120_2010618170835866.jpg' }, { id:'6139', name:'%u5317%u4EAC%u91D1%u6CF0%u4E4B%u5BB6%u8FDE%u9501%u9152%u5E97%uFF08%u897F%u76F4%u95E8%u5E97%uFF09', price:'125', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200882810274396926.jpg' }, { id:'6138', name:'%u5317%u4EAC%u91D1%u6CF0%u4E4B%u5BB6%u8FDE%u9501%u9152%u5E97%uFF08%u56DB%u5B63%u9752%u5E97%uFF09', price:'128', picture:'http://www.zhuna.cn/Hotel_Images/160x120_200882810294696602.jpg' }, { id:'7340', name:'%u5317%u4EAC%u8F7B%u8054%u5BCC%u6DA6%u8FDE%u9501%u9152%u5E97%uFF08%u5409%u5174%u5E97%uFF09', price:'128', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20094916531115198.jpg' }, { id:'8920', name:'%u5317%u4EAC%u5B9D%u949E%u5BBE%u9986', price:'128', picture:'http://www.zhuna.cn/Hotel_Images/160x120_20099169221469041.jpg' }, { id:'9330', name:'%u5317%u4EAC%u4E1C%u56DB%u4E2D%u822A%u5FEB%u6377%u9152%u5E97', price:'128', picture:'http://www.zhuna.cn/Hotel_Images/160x120_2009113017362397627.jpg' } ] } } //住哪酒店推广自定义模块类,Code.Wister, var zhuna_ad_cls = function (){ this.init.apply(this, arguments); } zhuna_ad_cls.prototype = { init:function(){ this.cid = _cid; document.write ("
"); }, GetHtml:function(){ var s = 0; var obj = $(this.cid); if (HotelInfo.str_Err != ''){ alert(HotelInfo.str_Err); }else{ var int_tmpCnt = (_r > 20?20:_r) > HotelInfo.HotelDetails.items.length ? HotelInfo.HotelDetails.items.length:_r; var rownum = int_tmpCnt % _d == 0 ? int_tmpCnt / _d : parseInt( int_tmpCnt / _d)+1; var rn = int_tmpCnt % _d == 0 ? int_tmpCnt : int_tmpCnt * 1 + _d * 1 - (int_tmpCnt % _d) * 1; for ( var i = 1; i <= rn; i++){ try{ var HotelName = unescape(HotelInfo.HotelDetails.items[i-1].name); var HotelPicture = HotelInfo.HotelDetails.items[i-1].picture; var HotelPrice = HotelInfo.HotelDetails.items[i-1].price; var HotelId = HotelInfo.HotelDetails.items[i-1].id; TargetUrl = '/hotel//hotelinfo.asp?hotelid=' + HotelId + '&cityid='+_l; }catch(e){ } if ( i % _d == 1 || _d == 1 ){ if ( _t ==0 ) { var PicRow = obj.insertRow(-1); } var NameRow = obj.insertRow(-1); s++; } if ( _t ==0 ) { var PicCell = PicRow.insertCell((i % _d)-1); } var NameCell = NameRow.insertCell((i % _d)-1); if ( _t ==0 ) { PicCell.bgColor = _tdBg; } NameCell.bgColor = _tdBg; if ( _t ==0 ) { PicCell.align ='center'; } if (_t ==0) NameCell.align ='center'; NameCell.setAttribute('style','font-size:12px;'); if ( i <= int_tmpCnt){ if ( _t ==0 ) { PicCell.innerHTML = "" + HotelName + "(" + HotelPrice + ")" + ""; } NameCell.innerHTML = ""+ns(HotelName,cutNum*1+2)+" ¥"+HotelPrice+""; }else{ PicCell.innerHTML = " "; NameCell.innerHTML = " "; } } } } } function RandomId(n) { var str = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var r = ""; for(var i = 0; i < n ; i ++) { var rn = Math.ceil(Math.random()*35); r += str.charAt(rn - 1); } return r; } function $() { var elements = new Array(); for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } function ns(str,len){ if(str.length*2 <= len){return str;} var strlen = 0; var s = ""; for(var i = 0;i < str.length; i++){ if(str.charCodeAt(i) > 128){ strlen = strlen + 2; if(strlen > len){ return s.substring(0,s.length-1); } }else{ strlen = strlen + 1; if(strlen > len){ return s.substring(0,s.length-2); } } s = s + str.charAt(i); } return s; }