function o(id){ return document.getElementById(id); } function pos(id){ var obj = o(id); var ret=Array(); ret['w'] = obj.offsetWidth; ret['h'] = obj.offsetHeight; ret['t'] = obj.offsetTop; ret['l'] = obj.offsetLeft; while((obj=obj.offsetParent)!=null){ ret['t'] += obj.offsetTop; ret['l'] += obj.offsetLeft; } return ret; } function w253(){ $("#danh_sach_sp").addClass("w253"); $("#danh_sach_sp").removeClass("w507"); $(".item_alt").removeClass("alt_bg"); $(".item_alt").addClass("w253_alt"); $(".item_normal").addClass("w253_normal"); $(".ban_re_vn_list_item P").hide(); $(".gia").hide(); $(".gia2").css('font-size','11px'); $(".tensp").css('font-size','13px'); $.get('?url=isShop/session/ghi/view_mode/253'); } function w507(){ $("#danh_sach_sp").addClass("w507"); $("#danh_sach_sp").removeClass("w253"); $("#item_alt").addClass("item_alt"); $(".item_alt").addClass("alt_bg"); $(".item_alt").removeClass("w253_alt"); $(".item_normal").removeClass("w253_normal"); $(".ban_re_vn_list_item P").show(); $(".gia").show(); $(".gia2").css('font-size','12px'); $(".tensp").css('font-size','12px'); $.get('?url=isShop/session/ghi/view_mode/500'); } $(document).ready(function() { if(navigator.appVersion.indexOf('MSIE 6') != -1){ // ie6 //document.getElementById('web').style.marginLeft=((screen.width-1001)/2)-100+'px'; //document.getElementById('footer_trai').style.marginLeft=((screen.width-1001)/2)-100+'px'; }else{ document.getElementById('web').style.marginLeft=((screen.width-1001)/2)+'px'; document.getElementById('footer_trai').style.marginLeft=((screen.width-1001)/2)+'px'; } if(list_page){ $.get('?url=isShop/session/doc/view_mode', function(view_mode) { if(view_mode == '253'){ w253(); }else{ w507(); } }); }else{ try{ document.getElementById('disabled').style.height = document.getElementById('web').clientHeight+'px'; //che_noi_dung('tabs-1'); }catch(e){} } //alert(document.location) }); function che_noi_dung(id){ $("#tabs-1 img").each(function() { if($(this).width() > 450) { h=$(this).height()/$(this).width()*450; $(this).attr({height : h }); $(this).attr({width : "450"}); } }); var nd__pos = pos(id); o('che').style.top = (nd__pos['t']-12)+'px'; o('che').style.left = (nd__pos['l']+12)+'px'; o('che').style.width = nd__pos['w']+'px'; o('che').style.height = nd__pos['h']+'px'; } var omitformtags=["input", "textarea", "select"] omitformtags=omitformtags.join("|") function disableselect(e){ if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) return false } function reEnable(){ return true } if (typeof document.onselectstart!="undefined") document.onselectstart=new Function ("return false") else{ document.onmousedown=disableselect document.onmouseup=reEnable } document.oncontextmenu=function(){return false}