        function changeText(txt){
          document.getElementById('textarea').innerHTML = txt;
        }
          
  function changecolor (i){
  var anchor = document.getElementsByTagName("p");
  var count = anchor.length;
  for(var j =0; j < count; j++){
  document.getElementsByTagName("p")[j].style.color = "Blue";
}

if(document.getElementById(i)!=null){
document.getElementById(i).style.color = "Red";
}
}

        function changeGallery(id){
        
          document.getElementById('wrapper').innerHTML = nTx[id];
          document.getElementById('textarea').innerHTML = nT[id];
         
         
         
          var anchor = document.getElementsByTagName("p");
          var count = anchor.length;
          var anch = document.getElementsByTagName("a");
          var ct = anch.length;
          for (var j=0;j<ct;j++){
          document.getElementsByTagName("a")[j].style.color = "silver";
          document.getElementById("vyprodej").style.color = "red";
          //document.getElementsById("vyprodej").style.color = "red";
         
          }
          for(var j =0; j < count; j++){
          document.getElementsByTagName("p")[j].style.color = "silver";
          //document.getElementsById("vyprodej").style.color = "red";
          }

        if(document.getElementById(id)!=null){
        document.getElementById(id).style.color = "white";
        
        }
          
        }
 
        function changeGallery2(id,idNadrazena){
          document.getElementById('wrapper').innerHTML = nTx[id];
          document.getElementById('textarea').innerHTML = nT[id];
         
     
        }


        function LoadGallery(pictureName,imageFile,id){
          var picture = document.getElementById(pictureName);
  
          if (picture.filters){	
            picture.style.filter="blendTrans(duration=1)";
            picture.filters.blendTrans.Apply();
          }
          picture.src = imageFile;
          if (picture.filters){
            picture.filters.blendTrans.Play();
          }	
        }
      
        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 + ")";
        } 
        
    function changeText(txt){
      document.getElementById('textarea').innerHTML = txt;
    }

    function LoadGallery(pictureName,imageFile,id){
      var picture = document.getElementById(pictureName);
      if (picture.filters){
        picture.style.filter="blendTrans(duration=1)";
		    picture.filters.blendTrans.Apply();
      }
      picture.src = imageFile;
      if (picture.filters){
        picture.filters.blendTrans.Play();
      }	
    }
    
    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 + ")";
    }         
