var rotator_time;
var rotator_current = 1;
var rotator_max;
var back = 0;


var rotator2_time;
var rotator2_current = 1;
var rotator2_max;

$(document).ready(function(){

	if(rotator2_max > 1){
	rotator2_time = setTimeout('rotator2()', 4000);	
	}	
	
	$('a').live('mousedown', function() {
$(this).blur();
return false;
}).live('click', function() {
$(this).blur();
}).live('focus', function() {
if ( $.browser.msie ) {
$(this).blur();
}
}); 
	
	$('#item_text a img').parent().css('padding-right', '0px');;
		
});	


function rotator2(){
	
	$('.rotator2_tab').css('display', 'none');
	$('#rotator2_'+rotator2_current).show();
	$('#rotator2_'+rotator2_current).css('z-index', '999');


		if(rotator2_current != rotator2_max){
			$('#rotator2_'+(rotator2_current+1)).css('z-index', '1000');
			$('#rotator2_'+rotator2_current).fadeOut('slow');
			$('#rotator2_'+(rotator2_current+1)).fadeIn('slow');
		}else{
			$('#rotator2_1').css('z-index', '1000');
			$('#rotator2_'+rotator2_current).fadeOut('slow');
			$('#rotator2_1').fadeIn('slow');
		}
	
	
	rotator2_current = rotator2_current +1;

		//for(l=1;l<=rotator2_max;l++){
			//$('.rotator2_'+l).css('z-index','1');
		//}

		if(rotator2_current > rotator2_max){
			rotator2_current = 1;
	
			$('#rotator2_'+rotator2_current).css('z-index', '1000');
			$('#rotator2_1').css('z-index', '999');
		}else{
	
			$('#rotator2_'+rotator2_current).css('z-index', '1000');
			$('#rotator2_'+(rotator2_current+1)).css('z-index', '999');
		}
	
		$('.rotator2_page').css('color', '#727272');
		//$('.rotator2_page').css('font-weight', 'normal');
		$('#rotator2_page_'+rotator2_current).css('color', '#F77817');
		//$('#rotator2_page_'+rotator2_current).css('font-weight', 'bold');
		back = 0;
		
		
		
		rotator2_time = setTimeout('rotator2()', 4000);
}



function rotator(){
	
	$('.rotator_tab').css('display', 'none');
	$('#rotator_'+rotator_current).show();
	$('#rotator_'+rotator_current).css('z-index', '999');


		if(rotator_current != rotator_max){
			$('#rotator_'+(rotator_current+1)).css('z-index', '1000');
			$('#rotator_'+rotator_current).fadeOut('slow');
			$('#rotator_'+(rotator_current+1)).fadeIn('slow');
		}else{
			$('#rotator_1').css('z-index', '1000');
			$('#rotator_'+rotator_current).fadeOut('slow');
			$('#rotator_1').fadeIn('slow');
		}
	
	
	rotator_current = rotator_current +1;

		//for(l=1;l<=rotator_max;l++){
			//$('.rotator_'+l).css('z-index','1');
		//}

		if(rotator_current > rotator_max){
			rotator_current = 1;
	
			$('#rotator_'+rotator_current).css('z-index', '1000');
			$('#rotator_1').css('z-index', '999');
		}else{
	
			$('#rotator_'+rotator_current).css('z-index', '1000');
			$('#rotator_'+(rotator_current+1)).css('z-index', '999');
		}
	
		$('.rotator_page').css('color', '#434343');
		$('.rotator_page').css('background-position', 'top');
		//$('.rotator_page').css('font-weight', 'normal');
		$('#rotator_page_'+rotator_current).css('color', '#FEFEFE');
		//$('#rotator_page_'+rotator_current).css('font-weight', 'bold');
		$('#rotator_page_'+rotator_current).css('background-position', 'bottom');
		back = 0;
		
		
		
		rotator_time = setTimeout('rotator()', 7000);
}






function rotator_set(id){
  	
  	clearTimeout(rotator_time);
  
  //	if(id > rotator_current){
     		$('.rotator_tab').css('display', 'none');
     		
		//$('#rotator_'+id).show();
		$('#rotator_'+rotator_current).show();
		$('#rotator_'+id).css('z-index', '999');	
		$('#rotator_'+rotator_current).css('z-index', '1000');
		$('#rotator_'+rotator_current).fadeOut('slow');
		$('#rotator_'+id).fadeIn('slow');
   	
		rotator_current = id;
	
	
		$('.rotator_page').css('color', '#434343');
		$('.rotator_page').css('background-position', 'top');
		//$('.rotator_page').css('font-weight', 'normal');
		$('#rotator_page_'+rotator_current).css('color', '#FEFEFE');
		//$('#rotator_page_'+rotator_current).css('font-weight', 'bold');
		$('#rotator_page_'+rotator_current).css('background-position', 'bottom');
		back = 0;
		
		
		
		rotator_time = setTimeout('rotator()', 7000);
		   
	   
	   
  	//}
  	
  	
  
}



var tmp;
var tmp_width2;
var tmp_integer = 1;
var current_int = 1;

function next(){


	if($('.realization').css ('left') == 'auto'){
		tmp = 0;
	}else{
		tmp = parseInt($('.realization').css ('left'));
	}
	
	tmp = tmp -618;
	tmp_width2 = tmp * (-1);
	tmp = tmp 
	tmp_width = $('.realization').width();
	if(current_int < tmp_integer){

		 $('.realization').animate({
    left: tmp
  }, 1500, function() {
  });


	
		current_int++;
	}
	
}

function prev(){

	if($('.realization').css ('left') == 'auto'){
		tmp = 0;
	}else{
		tmp = parseInt($('.realization').css ('left'));
	}
	tmp = tmp +618;
	tmp_width2 = tmp * (-1);
	tmp = tmp +'px'
		
	
	tmp_width = $('.realization').width();

	if(current_int > 1){
		//$('.content_logo').css ('left', tmp);
		
			 $('.realization').animate({ 
   			 left: tmp
  		}, 1500 );
		
		current_int--;
	}
	
}


function roll(img_name1, img_src1)
   {
   document[img_name1].src = img_src1;

   }



