// Elektroncek

var ActivePage;

function showFirst(x)
{
	ActivePage = x;
	show(x);	
}



function show(x)
{
 $("div.state"+x).fadeIn("fast");
}
function hide(x)
{
 $("div.state"+x).fadeOut("fast");
}


$(document).ready(function(){


$("div.enterleave").bind("mouseleave",function(){
      
	  
	  for (i=1;i<7;i++)
	  {
	 		$("div.state"+i).fadeOut("fast");
		}
	  
    })


  });


/*
$(document).ready(function(){

var timeout;

$("div.enterleave").bind("mouseleave",function(){
      
	  timeout = setTimeout(function() {
	  
	  for (i=1;i<7;i++)
	  {
		if (i == ActivePage) 
		{
	 		$("div.state"+i).fadeIn("slow");
		} 
		else
		{
	 		$("div.state"+i).fadeOut("slow");
		}
	  }

	}, 2000);
	  
    })

	.bind("mouseenter",function() { 
			  clearTimeout(timeout);
			  });

  });
*/

function theRotator() {
	//Set the opacity of all images to 0
	$('div#rotator span').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator span:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('rotate()',6000);
	
}

function rotate() {	
	//Get the first image
	var current = ($('div#rotator span.show')?  $('div#rotator span.show') : $('div#rotator span:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator span:first') :current.next()) : $('div#rotator span:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 3000);

	//Hide the current image
	current.animate({opacity: 0.0}, 3000)
	.removeClass('show');
	
};
$(document).ready(function(){
	theRotator();
});


// tab switch

function tabSelect(x)
{
	
	var SelTab;
	var tmpStr;
	var Tab = new Array();
	Tab[0] = "tab06";
	Tab[1] = "tab07";
	Tab[2] = "tab08";
	Tab[3] = "tab10";
	Tab[4] = "tab12";
	Tab[5] = "tab14";
	Tab[6] = "tab16";
	Tab[7] = "tab05";
	Tab[8] = "tab33";
	Tab[9] = "tab44";
	Tab[10] = "tab09";
	Tab[11] = "tab11";

	for (SelTab in Tab) {
		tmpStr = Tab[SelTab];
		try {
		if (tmpStr.indexOf(x)>-1) {
			document.getElementById(Tab[SelTab]).className='subpage_tab_selected'
		    $('#content'+Tab[SelTab]).css("display", "block");
			document.getElementById('#content'+Tab[SelTab]).className='subpage_tab_selected'
		} else {
			document.getElementById(Tab[SelTab]).className='subpage_tab animateTab'
	    	$('#content'+Tab[SelTab]).css("display", "none");
		}
		} catch(err) {
		}

	}

	}

// left menu animation

$(function() {  
          $('.animate a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF", paddingLeft:"25px"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#999999", paddingLeft:"20px"}, "slow" );  
          });
       }); 


// left menu with background animation

$(function() {  
          $('.subpage_button a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#999999"}, "slow" );  
          });
       }); 

// contact e-mail animation

$(function() {  
          $('.contact_link a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#999999"}, "slow" );  
          });
       }); 

// tab animation

$(function() {  
          $('#tab div a').mouseover(function() {  
             $(this).stop().animate( { marginTop:"5px"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { marginTop:"0px"}, "slow" );  
          });
       });  

// featured title link

$(function() {  
          $('.featured_title_box_g4 a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#82CF1B"}, "slow" );  
          });
          $('.featured_title_box_g3 a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#BF0005"}, "slow" );  
          });
          $('.featured_title_box_g3eb2 a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#BF0005"}, "slow" );  
          });
          $('.featured_title_box_eb2 a').mouseover(function() {  
             $(this).stop().animate( { color:"#FFFFFF"}, "fast" );  
          }).mouseout(function() {  
             $(this).stop().animate( { color:"#d2b489"}, "slow" );  
          });
       }); 


// featured animation

$(function() {  
          $('#featured_G4_1 a').mouseover(function() {  
             $('#G4_first').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G4_first').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
          $('#featured_G4_2 a').mouseover(function() {  
             $('#G4_second').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G4_second').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
          $('#featured_G4_3 a').mouseover(function() {  
             $('#G4_last').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G4_last').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
          $('#featured_G3_1 a').mouseover(function() {  
             $('#G3_first').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G3_first').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
          $('#featured_G3_2 a').mouseover(function() {  
             $('#G3_second').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G3_second').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
          $('#featured_G3_3 a').mouseover(function() {  
             $('#G3_last').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#G3_last').stop().animate( { color:"#999999", backgroundColor:"#242424"}, "slow" );  
          });
       });  


// g4 product line

$(function() {  
          $('#line_G4_1 a').mouseover(function() {  
             $('#line_title_G4_1').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_1').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_2 a').mouseover(function() {  
             $('#line_title_G4_2').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_2').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_3 a').mouseover(function() {  
             $('#line_title_G4_3').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_3').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_4 a').mouseover(function() {  
             $('#line_title_G4_4').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_4').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_5 a').mouseover(function() {  
             $('#line_title_G4_5').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_5').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_6 a').mouseover(function() {  
             $('#line_title_G4_6').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_6').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_7 a').mouseover(function() {  
             $('#line_title_G4_7').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_7').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_8 a').mouseover(function() {  
             $('#line_title_G4_8').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_8').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G4_9 a').mouseover(function() {  
             $('#line_title_G4_9').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G4_9').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
       });  

// g3 product line

$(function() {  
          $('#line_G3_1 a').mouseover(function() {  
             $('#line_title_G3_1').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_1').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_2 a').mouseover(function() {  
             $('#line_title_G3_2').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_2').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_3 a').mouseover(function() {  
             $('#line_title_G3_3').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_3').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_4 a').mouseover(function() {  
             $('#line_title_G3_4').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_4').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_5 a').mouseover(function() {  
             $('#line_title_G3_5').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_5').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_6 a').mouseover(function() {  
             $('#line_title_G3_6').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_6').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_7 a').mouseover(function() {  
             $('#line_title_G3_7').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_7').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_8 a').mouseover(function() {  
             $('#line_title_G3_8').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_8').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
          $('#line_G3_9 a').mouseover(function() {  
             $('#line_title_G3_9').stop().animate( { color:"#000000", backgroundColor:"#999999"}, "fast" );  
          }).mouseout(function() {  
             $('#line_title_G3_9').stop().animate( { color:"#999999", backgroundColor:"#353535"}, "slow" );  
          });
       });  

//product gallery

$(document).ready(function() {


	$("#img_thumb a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer").attr({ src: largePath });
		
		return false;
		
	});

	$("#img_thumb2 a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer2").attr({ src: largePath });
		
		return false;
		
	});

	$("#img_thumb3 a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer3").attr({ src: largePath });
		
		return false;
		
	});

	$("#img_thumb4 a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer4").attr({ src: largePath });
		
		return false;
		
	});

	$("#img_thumb5 a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer5").attr({ src: largePath });
		
		return false;
		
	});

	$("#img_thumb6 a").click(function(){
	
		var largePath = $(this).attr("href");
		
		$("#img_placer6").attr({ src: largePath });
		
		return false;
		
	});


});

    function launchwin()
    {
          newwin = window.open("/products/G4/G4_catalog/","WindowName","fullscreen=0, scrollbars=0, width=1024, height=768")
          newwin.resizeBy(15,0)
    }
	
	
	
	
	
