     /* 
     code by PIT @ 2010 www.qf.cz 
     tested on: Safari4,MSIE6,Firefox3,Opera10
     */
     
     var curObj = 2;
     var swapBgPcs = 3;
     var countObj = 7;
     var countObjInc = 8;
     var startTimeInt = 120;
     var startSpeedTimeInt = 60;
     var stopTimeInt = 5000;
     var curOpacity = 11;
     var objInt = 10;
     var nextCall;
     var nextSpeedCall;
     var revertDirection = true;
     var initSlow = true;
     var curBTBObj = 1;
     var curBTBOpacity = 10;
     var opacityClassArr = new Array('opintX','opint0','opint1','opint2','opint3','opint4','opint5','opint6','opint7','opint8','opint9','opint10');
     var pcsJsArr = new Array();
     
     // onload set pcs without css
     document.getElementById('animation-js').style.background="url(animation/bg2.jpg) 50% 0 repeat-x";
     
    // preload
    if (document.images) {
       pcs1 = new Image();      pcs1.src = "animation/bg1.jpg";
       pcsJsArr[1] = "animation/bg1.jpg";
       pcs2 = new Image();      pcs2.src = "animation/bg2.jpg";
       pcsJsArr[2] = "animation/bg2.jpg";
       pcs3 = new Image();      pcs3.src = "animation/bg3.jpg";
       pcsJsArr[3] = "animation/bg3.jpg";
       pcs4 = new Image();      pcs4.src = "animation/bg4.jpg";
       pcsJsArr[4] = "animation/bg4.jpg";
       pcs5 = new Image();      pcs5.src = "animation/bg5.jpg";
       pcsJsArr[5] = "animation/bg5.jpg";
       pcs6 = new Image();      pcs6.src = "animation/bg6.jpg";
       pcsJsArr[6] = "animation/bg6.jpg";
       pcs7 = new Image();      pcs7.src = "animation/bg7.jpg";
       pcsJsArr[7] = "animation/bg7.jpg";
     }
     
     function changeMainPcs(id,type) {
       
       // first stop slideshow
       if (type!=2) {
         clearTimeout(nextCall);
         clearTimeout(startSpeedTimeInt);
         
         // reset vars
         curOpacity = 11;
         curBTBOpacity = 10;
         initSlow = true;
         
         // set actual pos.
         curObj = id;
         if (id==countObj) {
           swapBgPcs = 1;
         } else {
           swapBgPcs = id+1;
         }
         document.getElementById('animation-js').style.background="url("+pcsJsArr[id]+") 50% 0 repeat-x";
       }
       
       // all elms
       for (var i = 1; i < 8; i++) {
         if (i==id) {
           document.getElementById("pcs-info-"+i).className="show";
           //alert (id);
         } else {
           document.getElementById("pcs-info-"+i).className="hide";
         }
       }
       
       // change main pcs
       document.getElementById('page-home').style.background="url("+pcsJsArr[id]+") 50% 0 repeat-x";
     }
     
     function changeOpacity (objInt,sendObj) {
       if (sendObj>0) {
         curObj = sendObj;
       }
       
       if (initSlow==true) {
         initSlow = false;
         nextCall = setTimeout("changeOpacity(curOpacity,curObj)",stopTimeInt);
       } else {
       
       if (document.getElementById) {
         document.getElementById('animation-js').className = opacityClassArr[objInt];
       }
       
       if (curOpacity>0) {
         if (curOpacity>1) {
           curOpacity = curOpacity-1;
           if (curOpacity==9) { // change bg
             document.getElementById('page-home').style.background="url("+pcsJsArr[swapBgPcs]+") 50% 0 repeat-x";
             changeBTBOpacity('init');
           }
           if (curOpacity==4) {
           }
           nextCall = setTimeout("changeOpacity(curOpacity,curObj)",startTimeInt);
         } else {
           curOpacity = 10;
           if (swapBgPcs==countObj) {
             swapBgPcs = 1;
           } else {
             swapBgPcs = swapBgPcs+1;
           }
           if (curObj<countObj) {
             curObj = curObj+1;
           } else {
             curObj = 1;
           }
           document.getElementById('animation-js').style.background="url("+pcsJsArr[curObj]+") 50% 0 repeat-x";
           nextCall = setTimeout("changeOpacity(curOpacity,curObj)",stopTimeInt);
         }
       } else { // walk to next photo
         curOpacity = 11;
         nextCall = setTimeout("changeOpacity(curOpacity,curObj)",stopTimeInt);
       }
       }
       
     }
     
     function changeBTBOpacity (sendInt) {
     
       if (sendInt=='init') {
       
       } else {
         objInt = sendInt;
       }
       
       if (document.getElementById) {
         document.getElementById('animation').className = opacityClassArr[objInt];
       }
       
       if (curBTBOpacity<11) {
         if (revertDirection) {
           curBTBOpacity = curBTBOpacity-1;
           
           if (curBTBOpacity<2) {
             revertDirection = false;
             curBTBObj = curObj;
             if (curBTBObj<countObj) {
               curBTBObj = curBTBObj+1;
             } else {
               curBTBObj = 1;
             }
             changeMainPcs(curBTBObj,2);
             nextSpeedCall = setTimeout("changeBTBOpacity(curBTBOpacity)",startSpeedTimeInt);
           }
         } else {
           curBTBOpacity = curBTBOpacity+1;
         }
         if (curBTBOpacity==10) {
           // swap obj
         } else {
           nextSpeedCall = setTimeout("changeBTBOpacity(curBTBOpacity)",startSpeedTimeInt);
         }
       } else {
         revertDirection = true;
         curBTBOpacity = 10;
       }
       
     }
     
     changeOpacity(1,curObj);
