﻿
 var i = 1;
 var a = 1;
 var b = 1;

 function change_header() {
  if(i == 1) {
   b = 1;
   if (a == 3) {
   $("#p2").animate({opacity: "hide"}, "slow"); 
   document.getElementById('p2').src='index/photo2_2.jpg';
   $("#p2").animate({opacity: "show"}, "slow");
   i -= 1;
   setTimeout(change_header2, "3000");
   }

   if (a == 2) {
   $("#p1").animate({opacity: "hide"}, "slow"); 
   document.getElementById('p1').src='index/photo3_2.jpg';
   $("#p1").animate({opacity: "show"}, "slow");
   a++;
   setTimeout(change_header, "3000");
   }

   if (a == 1) {
   $("#p3").animate({opacity: "hide"}, "slow"); 
   document.getElementById('p3').src='index/photo1_2.jpg';
   $("#p3").animate({opacity: "show"}, "slow");
   a++;
   setTimeout(change_header, "3000");
   }
  }
 }

 function change_header2() {
  if(i == 0) {
   a = 1;
   if (b == 3) {
   $("#p2").animate({opacity: "hide"}, "slow"); 
   document.getElementById('p2').src='index/photo2_1.jpg';
   $("#p2").animate({opacity: "show"}, "slow");
   i++;
   setTimeout(change_header, "3000");
   }

   if (b == 2) {
   $("#p1").animate({opacity: "hide"}, "slow"); 
   document.getElementById('p1').src='index/photo3_1.jpg';
   $("#p1").animate({opacity: "show"}, "slow");
   b++;
   setTimeout(change_header2, "3000");
   }

   if (b == 1) {
   $("#p3").animate({opacity: "hide"}, "slow");
   document.getElementById('p3').src='index/photo1_1.jpg';
   $("#p3").animate({opacity: "show"}, "slow");
   b++;
   setTimeout(change_header2, "3000");
   }
  }
 }

 function show_hide(obj,obj2) {
  if (obj.vis == 1) {
   $('#'+obj2).slideUp(1000);
   obj.vis=0;
  }
  else {
   $('#'+obj2).slideDown(1000);
   obj.vis=1;
  }
 }


 function size(id) {
   document.getElementById('main').style.width='840px';
   document.getElementById('left').style.width='27%';
   document.getElementById('right').style.width='72%';
   document.getElementById(id).innerHTML='&laquo;';
 }
