document.write(''); var initSite = { start: function() { if ($('promo-power-centre')) { initSite.powerCentre(); } initSite.siteFooter(); }, powerCentre: function() { pcSliders = $$('#pc-links li.deck'); pcTogglers = $$('#pc-links img.toggle'); sliders = []; pcTogglers.each(function(toggler, x) { pcSliders[x].setStyle('display','inline'); sliders[x] = new Fx.Slide(pcSliders[x], {duration:100}).hide(); $(pcTogglers[x]).addEvent('click', function() { sliders[x].toggle(); if (pcTogglers[x].getProperty('alt') == 'Expand') { pcTogglers[x].setProperties({src:'/i/ads/powercentre-collapse.gif', alt:'Collapse'}); } else { pcTogglers[x].setProperties({src:'/i/ads/powercentre-expand.gif', alt:'Expand'}); } }); }); }, siteFooter: function() { if($('page-scroll')){ var scrollToTop = new Fx.Scroll(window, {duration:800}); $('page-scroll').addEvent('click', function() { scrollToTop.toElement(document.body); }); }; var mySlider = new Fx.Slide('external-links',{duration:800}).hide(); $('toggle-footer').addEvent('click', function() { if (!mySlider.isVisible()) { $('toggle-footer').setHTML('Hide links'); var footerHeight = $('external-links').getStyle('height').toInt() + 30; $('footer').setStyle('height',footerHeight+'px'); var scrollToBottom = new Fx.Scroll(window, {duration:400}); scrollToBottom.toElement('footer'); (function(){mySlider.toggle()}).delay(400); } else { $('toggle-footer').setHTML('Around ZDNet Australia'); $('footer').setStyle('height','auto'); mySlider.hide(); } }); } }; //window.addEvent('domready', initSite.start); /*------------------------------------------------------------------- Replicate :hover pseudo class on any element for IE ------------------------------------------------------------------- */ function initStoryTools(){ if ($('story-tools')) { suckerfish(sfHover, 'LI', 'story-tools'); } } function suckerfish(type, tag, parentId) { if (window.attachEvent) { window.attachEvent('onload', function() { var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag); type(sfEls); }); } } var sfHover = function(sfEls) { for (var i=0; i document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac yScroll = document.body.scrollHeight; xScroll = document.body.scrollWidth; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight; xScroll = document.body.offsetWidth; } //alert("height: "+yScroll+", width: "+xScroll); $('TB_overlay').height=yScroll+'px'; $('TB_overlay').width=xScroll+'px'; } function TB_windowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } var arrayWindowSize = new Array(myWidth,myHeight) return arrayWindowSize; } function lightBoxPopup(v,w,h,msg) { TB_overlaySize(); var windowSize = TB_windowSize(); $('TB_overlay').setStyle('display','block'); $('TB_window').innerHTML='
'+v+'

'+msg+'

'; //$('TB_window').left=Math.round((windowSize[0]-w)/2)+'px'; //$('TB_window').top=Math.round((windowSize[1]-h)/2)+'px'; var popupLeft = Math.round((windowSize[0]-w)/2); var popupTop = Math.round((windowSize[1]-h)/2); $('TB_window').setStyles({ 'left': popupLeft+'px', 'top': popupTop+'px', 'width': w+'px', 'height': h+'px', 'display': 'block' }); } /*------------------------------------------------------------------- Miscellaneous site functions ------------------------------------------------------------------- */ function visibilite(thingId) { var targetElement = document.getElementById(thingId) ; if (targetElement.style.display == "none") { targetElement.style.display = "" ; } else { targetElement.style.display = "none" ; } } function switchTabs(tabNum, parentId) { var tabs = document.getElementById(parentId.id).getElementsByTagName('li'); var boxId = parentId.parentNode.id; for (var i = 0; i < tabs.length; i++) { var thisTab = tabs[i]; if ((thisTab.id != '')) { document.getElementById(boxId+'-content'+i).style.display = 'none'; if (i == tabNum) { if (i == 0) { thisTab.className = 'active first'; } else { thisTab.className = 'active'; } document.getElementById(boxId+'-content'+i).style.display = 'block'; } else { thisTab.className = ''; } } } } function snapshot(theObject){ var snapshot_tab1 = document.getElementById('snapshot_tab1'); var snapshot_1 = document.getElementById('snapshot_1'); var snapshot_tab2 = document.getElementById('snapshot_tab2'); var snapshot_2 = document.getElementById('snapshot_2'); var snapshot_tab3 = document.getElementById('snapshot_tab3'); var snapshot_3 = document.getElementById('snapshot_3'); var snapshot_tab4 = document.getElementById('snapshot_tab4'); var snapshot_4 = document.getElementById('snapshot_4'); switch(theObject.id){ case 'snapshot_tab1': snapshot_tab2.className = ''; snapshot_tab3.className = ''; snapshot_tab4.className = ''; snapshot_1.style.display = 'block'; snapshot_2.style.display = 'none'; snapshot_3.style.display = 'none'; snapshot_4.style.display = 'none'; break; case 'snapshot_tab2': snapshot_tab1.className = ''; snapshot_tab3.className = ''; snapshot_tab4.className = ''; snapshot_1.style.display = 'none'; snapshot_2.style.display = 'block'; snapshot_3.style.display = 'none'; snapshot_4.style.display = 'none'; break; case 'snapshot_tab3': snapshot_tab1.className = ''; snapshot_tab2.className = ''; snapshot_tab4.className = ''; snapshot_1.style.display = 'none'; snapshot_2.style.display = 'none'; snapshot_3.style.display = 'block'; snapshot_4.style.display = 'none'; break; case 'snapshot_tab4': snapshot_tab1.className = ''; snapshot_tab2.className = ''; snapshot_tab3.className = ''; snapshot_1.style.display = 'none'; snapshot_2.style.display = 'none'; snapshot_3.style.display = 'none'; snapshot_4.style.display = 'block'; break; } theObject.className = 'snapshot_selected' } function showBlogBio(bioToShow) { var el = $(bioToShow); if (el.getStyle('display') == 'none') { el.setStyle('display','block'); $('expand-link').setHTML('[-] Hide bio'); } else { el.setStyle('display','none'); $('expand-link').setHTML('[+] Read bio'); } } function videoThumbText(msg){ var targetElement = document.getElementById('video-thumb-display') ; if(msg){ targetElement.innerHTML = ''+msg+''; }else{ targetElement.innerHTML = '更多精彩在线足球视频请访问【足球下载】'; } }