home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 May
/
PCWorld_2008-05_cd.bin
/
komunikace
/
maxthon
/
mx_2.0.9.1640.exe
/
template
/
cny2008
/
app.js
next >
Wrap
Text File
|
2008-01-29
|
1KB
|
48 lines
var defSkin = null;
var curSkin = null;
var newSkin = null;
function checkSkin(){
var arr = maxConfig.res.load('skin');
for(var i=0;i<arr.length;i++)
{
if(arr[i].enabled) curSkin = arr[i];
if(arr[i].path == "$Internal") defSkin = arr[i];
if(arr[i].path.indexOf("N_year2008")>-1) newSkin = arr[i];
}
if(!curSkin) curSkin = defSkin;
// ui
if(curSkin.preview){
$id("sk_org").innerHTML = '<img src="file:///' + curSkin.preview + '" />';
$id("sk_org_name").innerHTML = curSkin.title.$encodeHTML();
}
if(newSkin){
if(newSkin.preview){
$id("sk_new").innerHTML = '<img src="file:///' + newSkin.preview + '" />';
}
}
}
function setSkin(id){
if(id == 1){
//new skin
if(!newSkin) return;
external.max_doResItem('skin', 'enable', newSkin.path);
$id("sk_new").className = "active";
$id("sk_org").className = "";
}else{
//old skin
if(!curSkin) return;
external.max_doResItem('skin', 'enable', curSkin.path);
$id("sk_new").className = "";
$id("sk_org").className = "active";
}
}