//change the opacity for different browsers

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    // Safari 1.2, newer Firefox and Mozilla, CSS3
    object.opacity = (opacity / 100);
    // Older Mozilla and Firefox
    object.MozOpacity = (opacity / 100);
    // Safari<1.2, Konqueror
    object.KhtmlOpacity = (opacity / 100);
    // IE/Win
    object.filter = "alpha(opacity:"+opacity+")";
}

function blendimage(imageid, millisec){
  var speed = Math.round(millisec / 10);
  var timer = 0;

  //fade in image
  for(i = 10; i <= 100; i+=5) {
    setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
    timer++;
  }
}



var t;

function select_banner(id, stop_slideshow){

      n1=banner_id.length;
      if(id==n1) id=0;

      xmlHttp1=GetXmlHttpObject()

      url="banere/slideshow_ajax.php"
      url=url+"?pozitie="+id+'&stop_slideshow='+stop_slideshow;
      //alert(url);

      document.getElementById('id_slideshow1').style.display='none';
      xmlHttp1.onreadystatechange=stateChanged_banere
      xmlHttp1.open("GET",url,true)
      xmlHttp1.send(null)

      id=id+1
      setTimeout("select_banner("+id+","+stop_slideshow+")",2000);


}

function stateChanged_banere()
{

   if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete") {
       document.getElementById("id_slideshow_ajax1").innerHTML=xmlHttp1.responseText
   }
}

///////////////////////stanga///////////////////////////////////

function select_banner_stanga(id, stop_slideshow){
      // alert('s');
      n1=banner_id_stanga.length;
      if(id==n1) id=0;

      xmlHttp2=GetXmlHttpObject()


      url="banere/slideshow_ajax_stanga.php"
      url=url+"?pozitie_stanga="+id+'&stop_slideshow='+stop_slideshow;
      //alert(url);

      document.getElementById('id_slideshow1_stanga').style.display='none';
      xmlHttp2.onreadystatechange=stateChanged_banere_stanga
      xmlHttp2.open("GET",url,true)
      xmlHttp2.send(null)
      //alert('d');
      id=id+1
      setTimeout("select_banner_stanga("+id+","+stop_slideshow+")",2400);

}

function stateChanged_banere_stanga()
{

   if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete") {
       document.getElementById("id_slideshow_ajax1_stanga").innerHTML=xmlHttp2.responseText
   }
}



///////////////////////jos///////////////////////////////////

function select_banner_jos(id, stop_slideshow){
      // alert('s');
      n1=banner_id_jos.length;
      if(id==n1) id=0;

      xmlHttp3=GetXmlHttpObject()


      url="banere/slideshow_ajax_jos.php"
      url=url+"?pozitie_jos="+id+'&stop_slideshow='+stop_slideshow;
      //alert(url);

      document.getElementById('id_slideshow1_jos').style.display='none';
      xmlHttp3.onreadystatechange=stateChanged_banere_jos
      xmlHttp3.open("GET",url,true)
      xmlHttp3.send(null)

      id=id+1

      setTimeout("select_banner_jos("+id+","+stop_slideshow+")",2600);


}

function stateChanged_banere_jos()
{

   if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete") {
       document.getElementById("id_slideshow_ajax1_jos").innerHTML=xmlHttp3.responseText
   }
}


function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
    objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
     objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
