// JavaScript Document
var i;
var xxx;
var opacity;
var cross;
var y;
var s;
var period;
var width;
var running;
var slide_img = new Array();

function jcont() {
		   j=i-1;
		   if (j < 0) {j=(carray-1)}
		   if (y==2) {slide1.src = slide_img[j].src;}
		   if (y==1) {slide2.src = slide_img[j].src;}


}
function icont() {
		   i++;
   		   if (i >= carray) {i=0;}
		   if (i < 0) {i=(carray-1)}

}


function movercont() {
	         if(countmover<=0) {countmover = countmover + width;}
	   	     if(countmover>width) {countmover = countmover - width;}
	         
			 if ((position-countmover)>(width/2)) {mover = -((width-position+countmover)/(cross/2))}
      	     else if ((countmover-position)>(width/2)) {mover = ((width-countmover+position)/(cross/2))}
	         else {mover = ((position-countmover)/(cross/2));}
	       //if ((mover>0) && (mover<0.5)) {mover=1}
	       //if ((mover<0) && (mover>-0.5)) {mover=-1}
}
function rolling() {
       position = parseInt(wwarray[j]) - startroll;
       if (position<0) {position=position+width}
   	   countmover = countmover + mover;
	   cmover = Math.round(-countmover);
	   id1.style.left = parseInt(cmover) + 'px';
	   id2.style.left = parseInt(cmover+width) + 'px';
}
function cslide() {
	   if (y==2) {slide1.src = slide_img[i].src;}
	   else {slide2.src = slide_img[i].src;}

}
function crossdiss() {
   if (document.all) {
      if (opacity<100) {
   	  opacity=opacity + Math.ceil(100/cross);
         if (y==1) {
            slide2.style.filter='alpha(opacity='+opacity+')';
	        slide1.style.filter='alpha(opacity='+(100-opacity)+')'; 			  
		 }
         else {
            slide1.style.filter='alpha(opacity='+opacity+')';
	        slide2.style.filter='alpha(opacity='+(100-opacity)+')'; 
		 }
	  }
   }
   else {  	
      if (opacity<1) {
      opacity=opacity + (Math.ceil(100/cross)/100);
         if (y==1) {
	        slide2.style.opacity=opacity;
	        slide1.style.opacity=(1-opacity);
         }
         else {
	        slide1.style.opacity=opacity;
	        slide2.style.opacity=(1-opacity);
	     }
      }
   }
}
