varAction = 0;

var ImageActive;


function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer") {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();

var DivOut;


function ActionSoundPlayer(mySong, myTitle){

document.getElementById("boxPlayerAction").style.borderColor ="#FFFFFF";


     DivOut = "boxPlayerAction";
     http.open('POST','ajax/action.php');
     http.onreadystatechange = handleResponse;
     http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     http.send('AjVal=jdfeiUU56e3reww&AjSong='+mySong+'&AjTitle='+myTitle);

}



function  handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
//alert(http.getAllResponseHeaders()  )  
      
        var update = new Array();
         
       if(response.indexOf('|' != -1)) {
            update = response.split('|');


//alert(DivOut)
//alert(response)

}
document.getElementById(DivOut).innerHTML = response; 
}
}




function ActionPlayer(myId,myImage,myNumber){
varAction = myId;


document.getElementById("boxPlayerAction").innerHTML  = "<img src=\"img/content/image"+myId+"_"+myImage+".jpg\" alt=\"\" border=\"0\" />";
if(myNumber>0){
if(myImage < myNumber){
myImage++;
} else {

myImage=0;
}
setTimeout("ActionPlayer("+myId+","+myImage+","+myNumber+")",4000)
}}



function ActionTooltip(myId, myTitle, myPos,myStatus,mySize) {

if(myStatus != 1){
document.getElementById(["cAction"+myId]).style.height=mySize+"px";
document.getElementById(["cAction"+myId]).style.backgroundColor="#433C44";
}else {
document.getElementById(["cAction"+myId]).style.backgroundColor="#433C44";


}
document.getElementById("boxTooltip").innerHTML = myTitle;
document.getElementById("boxTooltip").style.left = myPos+"px";

        document.getElementById("boxTooltip").style.visibility = "visible";

}

function ActionTooltipOut(myId, myStatus,myColor) {
document.getElementById("boxTooltip").innerHTML = "";
       document.getElementById("boxTooltip").style.visibility = "hidden";


if(myId != varAction){
if(myStatus != 1){
document.getElementById(["cAction"+myId]).style.height=35+"px";

document.getElementById(["cAction"+myId]).style.backgroundColor="#FC7813";
}else{
document.getElementById(["cAction"+myId]).style.backgroundColor=myColor;


}
}



}


function ActionChgImage(myPage, myImage) {
document.getElementById("boxPlayerAction").style.borderColor = "#FB7813";
ImageActive = "<img src=\"img/content/image"+myPage+"_"+myImage+".jpg\" alt=\"\" border=\"0\" />";
document.getElementById("boxPlayerAction").innerHTML = ImageActive;


}

