Cufon.replace('h1', { fontFamily: 'eur' });
jQuery(document).ready(function(){
	jQuery('ul li:first-child').addClass("firstItem");
	jQuery('ul li:last-child').addClass("lastItem");
	jQuery('.thumbs li').hover(function(){
		$(this).addClass('hover');
		},function(){
			$(this).removeClass('hover');
		});
	$('.subnav ul li').each(function(){
		if($(this).hasClass('gray')){
					$(this).css({backgroundPosition: "-171px 0"});					
				} else if($(this).hasClass('orange')){
					$(this).css({backgroundPosition: "-171px -17px"});	
				}
				 else if($(this).hasClass('red')){
					 $(this).css({backgroundPosition: "-171px -34px"});		
				}
				 else if($(this).hasClass('green')){
					$(this).css({backgroundPosition: "-171px -51px"});				
				}
				 else if($(this).hasClass('blue')){
					$(this).css({backgroundPosition: "-171px -68px"});					
				} else if($(this).hasClass('yellow')){
					$(this).css({backgroundPosition: "-171px -85px"});				
				} else if($(this).hasClass('orange2')){
					$(this).css({backgroundPosition: "-171px -102px"});				
				} else{
					$(this).css( {backgroundPosition: "-171px 0"});
					}
	});
	
		$('.subnav ul li')
		//.css( {backgroundPosition: "-171px 0"} )
		.mouseover(function(){
			if($(this).hasClass('gray')){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:200});			
			} else if($(this).hasClass('orange')){
			$(this).stop().animate({backgroundPosition:"(0 -17px)"}, {duration:200});			
			}else if($(this).hasClass('red')){
			$(this).stop().animate({backgroundPosition:"(0 -34px)"}, {duration:200});			
			}else if($(this).hasClass('green')){
			$(this).stop().animate({backgroundPosition:"(0 -51px)"}, {duration:200});			
			}else if($(this).hasClass('blue')){
			$(this).stop().animate({backgroundPosition:"(0 -68px)"}, {duration:200});			
			}else if($(this).hasClass('yellow')){
			$(this).stop().animate({backgroundPosition:"(0 -85px)"}, {duration:200});			
			}else if($(this).hasClass('orange2')){
			$(this).stop().animate({backgroundPosition:"(0 -102px)"}, {duration:200});			
			}			
		})
		.mouseout(function(){
				if($(this).hasClass('gray')){
					$(this).stop().animate({backgroundPosition:"(-171px 0)"}, {duration:200});					
				} else if($(this).hasClass('orange')){
					$(this).stop().animate({backgroundPosition:"(-171px -17px)"}, {duration:200});					
				}
				 else if($(this).hasClass('red')){
					$(this).stop().animate({backgroundPosition:"(-171px -34px)"}, {duration:200});					
				}
				 else if($(this).hasClass('green')){
					$(this).stop().animate({backgroundPosition:"(-171px -51px)"}, {duration:200});					
				}
				 else if($(this).hasClass('blue')){
					$(this).stop().animate({backgroundPosition:"(-171px -68px)"}, {duration:200});					
				} else if($(this).hasClass('yellow')){
					$(this).stop().animate({backgroundPosition:"(-171px -85px)"}, {duration:200});					
				} else if($(this).hasClass('orange2')){
					$(this).stop().animate({backgroundPosition:"(-171px -102px)"}, {duration:200});					
				}			
		});
		/*.click(function(){
			if($(this).hasClass('gray')){
					$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:0});		
				} else if($(this).hasClass('orange')){
					$(this).stop().animate({backgroundPosition:"(-171px -17px)"}, {duration:200});					
				}
				 else if($(this).hasClass('red')){
					$(this).stop().animate({backgroundPosition:"(-171px -34px)"}, {duration:200});					
				}
				 else if($(this).hasClass('green')){
					$(this).stop().animate({backgroundPosition:"(-171px -51px)"}, {duration:200});					
				}
				 else if($(this).hasClass('blue')){
					$(this).stop().animate({backgroundPosition:"(-171px -68px)"}, {duration:200});					
				} else if($(this).hasClass('yellow')){
					$(this).stop().animate({backgroundPosition:"(-171px -85px)"}, {duration:200});					
				} else if($(this).hasClass('orange2')){
					$(this).stop().animate({backgroundPosition:"(-171px -102px)"}, {duration:200});					
				}	
			})*/
	$('#menu').animate({"top": "0"}, "slow");
	shades();
	$('#menu > ul > li').hover(function(){
			$(this).animate({"padding-top":"24px"}, {duration: 200, queue: false});
			
		}, function(){
			if (!$(this).hasClass("current_page_item")){				
				if (!$(this).hasClass("current_page_parent")){
					$(this).animate({"padding-top":"0"}, {duration: 200, queue: false});
					}
				}
			
	});
	/*.bind('click',function(){ 		
		$(this)
		.addClass('active')
		.children('ul')
		.slideDown('slow') 
		.end()
		.siblings('li')
		.removeClass('active')
		.children('ul')
		.slideUp('slow')
		.end()
		.delay(1000)
		.animate({"padding-top":"0"}, {duration: 200, queue: true});
		//hidePopup();
		//hideTxt();
		
	});*/
	/*$('#menu > ul > li > ul > li > a').click(function(){		
		$(this).addClass('current').parent().siblings().children().removeClass('current');
		var _loc = $(this).attr("rel");
		$('#page > div').hide().animate({'opacity': 0}, {duration: 500, queue: false});
		$("#"+_loc).show().animate({'opacity': 1}, {duration: 500, queue: false});
	});*/
	jQuery('a[rel="external"]').click(function(){
	    this.target = "_blank";
	});
	$('input[type="password"], input[type="text"], textarea').each(function() {
	var default_value = this.value;	
	$(this).focus(function() {
	if(this.value == default_value) {
	this.value = '';
	}
	});
	$(this).blur(function() {
	if(this.value == '') {
	this.value = default_value;
	}
	});
	});	
	jQuery(".sideNav li").click(function(e){ 
		e.preventDefault();
		jQuery(this).addClass('active').siblings('li').removeClass('active');				
		var _index =  jQuery(this).index(); 		
		jQuery('.tabContent').hide().animate({'opacity': 0}, {duration: 200, queue: false}).eq(_index).show().animate({'opacity': 1}, {duration: 200, queue: false				    }); 
	}).eq(0).click();
	$("#retail > li, #commercial > li").click(function(){
     window.location=$(this).find("a").attr("href");
     return false;
});
	$('.playVideoHome, .playVideo').click(function(e){
		e.preventDefault();		
		showVidPlayer();
	});
});
$(window).resize(function(){
	shades();
});
function shades(){
	var _ww = $(window).width();
	var _sw = (_ww - 1024)/2;
	$('.leftShade, .rightShade').css("width",_sw+"px");
}


var videoURL = 'intro.f4v';
var flashObj = '<object height="400" width="670" type="application/x-shockwave-flash" id="videoPlayer" name="videoPlayer" data="/swf/videoPlayer.swf"><param name="wmode" value="transparent"><param name="allowFullScreen" value="true"><param name="flashvars" value="vidSrc='+videoURL+'"></object>';
var ieFlashObj = '<embed src="/swf/videoPlayer.swf" width="670" height="400" flashVars="vidSrc='+videoURL+'" allowFullScreen="true" wmode="transparent"></embed>';

function getFlashMovieObject(movieName){
	if (window.document[movieName]){
		return window.document[movieName];
	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}
	else{
		return document.getElementById(movieName);
	}
}
function playVideo(){ 
	flashMovie=getFlashMovieObject("videoPlayer");
	flashMovie.playVid();
}

function showVidPlayer(){ 
		$('#videoContr').show();
		if($.browser.msie){
		$('#videoContr').html(ieFlashObj) ;
	}else{
		$('#videoContr').html(flashObj); 
	}
}
function hideVidPlayer(){ 

	$('#videoContr').html("");
	$('#videoContr').hide();
}




