

function ajaxFunction(to,extra)

{

var xmlHttp;

try

  {

  // Firefox, Opera 8.0+, Safari

  xmlHttp=new XMLHttpRequest();

  }

catch (e)

  {

  // Internet Explorer

  try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

  catch (e)

    {

    try

      {

      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

      }

    catch (e)

      {

      alert("Your browser does not support AJAX!");

      return false;

      }

    }

  }

  xmlHttp.onreadystatechange=function()

    {

    if(xmlHttp.readyState==4)

      {

 var where_is_mytool=xmlHttp.responseText;

var mytool_array=where_is_mytool.split("|||");



if(to!="comments"){

	  if(to!="image0"){

	  document.getElementById("image"+to).src=mytool_array[0]+extra;

	  document.getElementById("link"+to).href=mytool_array[1];



	   //shiftOpacity(to, '1000');

	   }else {document.getElementById("image0").style.backgroundImage="url('"+mytool_array[0]+extra+"')";

	   document.getElementById("image0").alt=mytool_array[1];

	   }

	   

	   }else{

	   document.getElementById("user").innerHTML=mytool_array[0];

	   document.getElementById("data").innerHTML=mytool_array[1];

	   document.getElementById("text").innerHTML=mytool_array[2];

	   //document.write(mytool_array[0]+" "+mytool_array[1]+" "+mytool_array[2]);

	   }

	   

	   

	   

      }

    }



  if(to!="comments"){xmlHttp.open("GET","test.php",true);}else{xmlHttp.open("GET","comments.php",true);}

  xmlHttp.send(null);

  }

  

  function control(){

pic1= new Image(); pic1.src="phpThumb/phpThumb.php?src=../fotografii/mari/20_raluk.jpg&w=410&h=300&zc=1&q=50"; 

pic2= new Image(); pic2.src="phpThumb/phpThumb.php?src=../fotografii/mari/1_raluk.jpg&w=410&h=300&zc=1&q=50"; 

pic3= new Image(); pic3.src="phpThumb/phpThumb.php?src=../fotografii/mari//piatra_10.jpg&w=410&h=300&zc=1&q=50"; 



pic4= new Image(); pic4.src="phpThumb/phpThumb.php?src=../fotografii/mari/beleaa_1.jpg&w=410&h=300&zc=1&q=50"; 

pic5= new Image(); pic5.src="phpThumb/phpThumb.php?src=../fotografii/mari/beleaa_2.jpg&w=410&h=300&zc=1&q=50"; 

pic6= new Image(); pic6.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0135.jpg&w=410&h=300&zc=1&q=50"; 



pic7= new Image(); pic7.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0248.jpg&w=410&h=300&zc=1&q=50"; 

pic8= new Image(); pic8.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0253.jpg&w=410&h=300&zc=1&q=50"; 

pic9= new Image(); pic9.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0314.jpg&w=410&h=300&zc=1&q=50"; 



pic10= new Image(); pic10.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0357.jpg&w=410&h=300&zc=1&q=50"; 

pic11= new Image(); pic11.src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0158.jpg&w=410&h=300&zc=1&q=50"; 

pic12= new Image(); pic12.src="phpThumb/phpThumb.php?src=../fotografii/mari/mireasa_3.jpg&w=410&h=300&zc=1&q=50"; 



pic13= new Image(); pic13.src="phpThumb/phpThumb.php?src=../fotografii/mari/love_islaz.jpg&w=410&h=300&zc=1&q=50"; 

pic14= new Image(); pic14.src="phpThumb/phpThumb.php?src=../fotografii/mari/pure.jpg&w=410&h=300&zc=1&q=50"; 

pic15= new Image(); pic15.src="phpThumb/phpThumb.php?src=../fotografii/mari/islaz_galben.jpg&w=410&h=300&zc=1&q=50"; 





pic16= new Image(); pic16.src="phpThumb/phpThumb.php?src=../fotografii/mari/19.jpg&w=410&h=300&zc=1&q=50"; 

pic17= new Image(); pic17.src="phpThumb/phpThumb.php?src=../fotografii/mari/1.jpg&w=410&h=300&zc=1&q=50"; 

pic18= new Image(); pic18.src="phpThumb/phpThumb.php?src=../fotografii/mari/bun_mare.jpg&w=410&h=300&zc=1&q=50"; 





var t=setTimeout("ten()",3000);



  }

  

  function ten(){

var speed=3000;

 var q=80;

 step=500;

 

 x=0;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/1_raluk.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);



 

 

  x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/piatra_10.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/beleaa_1.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/beleaa_2.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0135.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0248.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0253.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0314.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

  x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0357.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/dsc_0158.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);





   x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/mireasa_3.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/love_islaz.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/pure.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/islaz_galben.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/19.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/1.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 

 

    x=x+speed;

  var t=setTimeout("end('image1')",x);

   x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/bun_mare.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);

 

 x=x+speed;

 var t=setTimeout("end('image1')",x);

  x=x+500;

 var t=setTimeout('document.getElementById("image1").src="phpThumb/phpThumb.php?src=../fotografii/mari/20_raluk.jpg&w=410&h=300&zc=1&q=50";',x);

 x=x+500;

 var t=setTimeout("end2('image1')",x);



var t=setTimeout("ten()",x+3000);

  }

 

 

 

  

  

  function loadImage(q){

 ajaxFunction('comments','');

 

 ajaxFunction('1','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('2','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('3','&w=201&h=133&zc=1&q='+q);

 

 ajaxFunction('4','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('5','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('6','&w=201&h=133&zc=1&q='+q);

 

 ajaxFunction('7','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('8','&w=201&h=133&zc=1&q='+q);

 ajaxFunction('9','&w=201&h=133&zc=1&q='+q);

  }

  

  

  function end(to){



  //document.getElementById(to).src='images/null.gif';

  //var t=shiftOpacity(to, '1000');

  opacity(to, 100, 0, 500);

  //shiftOpacity('image1', '1000');

  }

  

    function end2(to){

  //document.getElementById(to).src='images/null.gif';

  //var t=shiftOpacity(to, '1000');

  opacity(to, 0, 100, 500);

  //shiftOpacity('image1', '1000');

  }

  



function shiftOpacity(id, millisec) {

    //if an element is invisible, make it visible, else make it ivisible

    if(document.getElementById(id).style.opacity == 0) {

        opacity(id, 0, 100, millisec);

    } else {

        opacity(id, 100, 0, millisec);

    }

} 





function opacity(id, opacStart, opacEnd, millisec) {

    //speed for each frame

    var speed = Math.round(millisec / 100);

    var timer = 0;



    //determine the direction for the blending, if start and end are the same nothing happens

    if(opacStart > opacEnd) {

        for(i = opacStart; i >= opacEnd; i--) {

            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

            timer++;

        }

    } else if(opacStart < opacEnd) {

        for(i = opacStart; i <= opacEnd; i++)

            {

            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

            timer++;

        }

    }

}



//change the opacity for different browsers

function changeOpac(opacity, id) {

    var object = document.getElementById(id).style;

    object.opacity = (opacity / 100);

    object.MozOpacity = (opacity / 100);

    object.KhtmlOpacity = (opacity / 100);

    object.filter = "alpha(opacity=" + opacity + ")";

} 






