﻿function getNodeValue(o){try {return o.item(0).firstChild.nodeValue;} catch(err){return '';}}
function showvideo(idvideo){var pxml = '/info/xml/video.xml'; AjaxRequest.get({'url':pxml,'onSuccess':function(req){for (var i=0;i<req.responseXML.getElementsByTagName('v').length;i++) {if (i==idvideo-1){with(req.responseXML.getElementsByTagName('v').item(i)){document.getElementById('lvideo' + idvideo).className="on"; showvideodetail(getNodeValue(getElementsByTagName('tit')),getNodeValue(getElementsByTagName('img')),getNodeValue(getElementsByTagName('w')),getNodeValue(getElementsByTagName('h')),getNodeValue(getElementsByTagName('avat')));}}else{document.getElementById('lvideo' + (i+1)).className="off"}}},'onError':function(req){document.getElementById("controlv").innerHTML=req.statusText;}})}
function showvideodetail(tit,img,w,h,avat) {document.getElementById('iddesvideo').innerHTML = tit; var so = new SWFObject('/img/player.swf','mpl',w,h,'9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('wmode','transparent'); so.addVariable('width',w); so.addVariable('height',h); so.addVariable('file', img); so.addVariable('stretching','exactfit');if(avat != ''){so.addVariable('image',avat);} so.write('videoclip');}
function showanh(idanh) {var pxml = '/info/xml/anh.xml'; AjaxRequest.get({'url':pxml,'onSuccess':function(req){for (var i=0;i<req.responseXML.getElementsByTagName('v').length;i++) {if (i==idanh-1){with(req.responseXML.getElementsByTagName('v').item(i)){document.getElementById('limg' + idanh).className="on"; showanhdetail(getNodeValue(getElementsByTagName('tit')),getNodeValue(getElementsByTagName('img')),getNodeValue(getElementsByTagName('w')),getNodeValue(getElementsByTagName('h')),getNodeValue(getElementsByTagName('link')));}}else{document.getElementById('limg' + (i+1)).className="off"}}}})}
function showanhdetail(tit,img,w,h,link){document.getElementById('iddesimg').innerHTML = tit;document.getElementById('idimg').innerHTML ='<a href="' + link + '"><img src="' + img + '" width="' + w + '" height="' + h + '" alt="' + tit + '"></a>'}
