function playSound() {
 if(navigator.appName=="Microsoft Internet Explorer"){
 Melody.innerHTML = "<img dynsrc='img/song.mid' width=1 height=1 autostart=true loop='infinite'>";}else{
 Melody.innerHTML = "<embed src='img/song.mid' width=0 height=0 autostart=true loop=false></embed>"};
}
function effect(img_name) {
 document.getElementById(img_name).style.borderColor='#005500';
 document.getElementById(img_name).src='img/'+img_name+'_anim.gif';
 document.getElementById("t"+img_name).bgColor='#A5DDA2';
}
function effect_out(img_name) {
 document.getElementById(img_name).style.borderColor='white';
 document.getElementById(img_name).src='img/'+img_name+'.gif';
 document.getElementById("t"+img_name).bgColor='#D3F1DC'
}
function funClock() {
//if (!document.layers && !document.all)
//return;
var runTime = new Date();
var hours = runTime.getHours();
var minutes = runTime.getMinutes();
var seconds = runTime.getSeconds();
if (minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds <= 9) {
seconds = "0" + seconds;
}
movingtime = "<b>"+ hours + ":" + minutes + ":" + seconds + "</b>";
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
document.getElementById("clock").innerHTML = movingtime;
}else{document.getElementById("clock").innerHTML = movingtime;};
setTimeout("funClock()", 1000)
}
var day=true;
function Start() {
var runTime = new Date();
var time_hour=runTime.getHours();
if((time_hour >= 0)&&(time_hour < 6)){document.getElementById("logo").src='img/logo_night.gif';day=false;}
  //else{document.getElementById("logo").src='img/logo.gif';day=true;};
funClock();
}

function LoadImg(id){
 switch(id){
  case '1':id_d='2';break;
  case '2':id_d='1';break;
  case '_1':id_d='_2';break;
  case '_2':id_d='_1';break;
 };
 DisplayImg(id);
 setTimeout("GetImg('"+id_d+"')",5000);
}

function DisplayImg(id){
 switch(id){
  case '1':id_d='2';break;
  case '2':id_d='1';break;
  case '_1':id_d='_2';break;
  case '_2':id_d='_1';break;
 };
document.getElementById("img"+id+"_div").style.opacity=document.getElementById("img"+id+"_div").style.opacity*1+0.1;
if(navigator.appName == "Microsoft Internet Explorer"){
temp_filter=document.getElementById("img"+id+"_div").style.filter;
temp_val=temp_filter.substring(temp_filter.indexOf('=')+1,temp_filter.indexOf(')'))*1+10;
document.getElementById("img"+id+"_div").style.filter='alpha(opacity='+temp_val+')';};

if(document.getElementById("img"+id_d+"_div").style.opacity>0){document.getElementById("img"+id_d+"_div").style.opacity=document.getElementById("img"+id_d+"_div").style.opacity*1-0.1;
if(navigator.appName == "Microsoft Internet Explorer"){
temp_filter=document.getElementById("img"+id_d+"_div").style.filter;
temp_val=temp_filter.substring(temp_filter.indexOf('=')+1,temp_filter.indexOf(')'))*1-10;
document.getElementById("img"+id_d+"_div").style.filter='alpha(opacity='+temp_val+')';};
};

if(document.getElementById("img"+id+"_div").style.opacity<1){setTimeout("DisplayImg('"+id+"')",100);};
};

function GetImg(id){
var req=new JsHttpRequest();
req.onreadystatechange=function(){
 if(req.readyState==4){id=req.responseText.substring(req.responseText.indexOf('<id>')+4,req.responseText.indexOf('</id>'))
                       document.getElementById("img"+id+"_div").src=req.responseText.substring(req.responseText.indexOf('<src>')+5,req.responseText.indexOf('</src>'))}}
req.open(null,"getimg.php?set=truegetimg",true);
req.send({'val':id});
}