$(window).load(function() {
				$('#sliderLoader').fadeOut(function(){
					$('#slider').fadeIn().nivoSlider({
						effect:'sliceDown', //Specify sets like: 'fold,fade,sliceDown'
						slices:15,
						animSpeed:500,
						pauseTime:3000,
						startSlide:0, //Set starting Slide (0 index)
						directionNav:false, //Next & Prev
						directionNavHide:true, //Only show on hover
						controlNav:false, //1,2,3...
						controlNavThumbs:false, //Use thumbnails for Control Nav
						controlNavThumbsFromRel:false, //Use image rel for thumbs
						controlNavThumbsSearch: '.jpg', //Replace this with...
						controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
						keyboardNav:true, //Use left & right arrows
						pauseOnHover:true, //Stop animation while hovering
						manualAdvance:false, //Force manual transitions
						captionOpacity:0.8, //Universal caption opacity
						beforeChange: function(){},
						afterChange: function(){},
						slideshowEnd: function(){} //Triggers after all slides have been shown
					});

				});
				$('#logosLoader').hide();
					$("div#logoParade").fadeIn().bind("mouseover", function() {
						$(this).smoothDivScroll("stopAutoScroll");
					}).bind("mouseout", function() {
						$(this).smoothDivScroll("startAutoScroll");
					});

					$('#logoParade img').animate({opacity: 0.7});
					$('#logoParade img').mouseover(function(n){
						$(this).stop().animate({opacity: 1});
					});
					$('#logoParade img').mouseout(function(n){
						$(this).stop().animate({opacity: 0.7});
					});
$('#fsc-submit, .wpcf7-submit').replaceWith('<a href="javascript:void(0);" onclick="$(this).closest(\'form\').submit();" class="white_links top_button" style="position: static; margin-top: 10px;text-indent: 0px; width:72px;height:27px;display:block">'+$('#fsc-submit, .wpcf7-submit').val()+'</a>');
	try{$('.top_button.selected').css('background-image',$('.top_button.selected').css('background-image').replace('_off.png','_on.png'));}catch(ex){}
	try{$(',.side_button.selected').css('color','#fffee9').css('background-image',$('.side_button.selected').css('background-image').replace('_off.png','_on.png'));}catch(ex){}
	try{$('#menu_buttons .selected').attr('src',$('#menu_buttons .selected').attr('src').replace('_off.png','_on.png'));}catch(ex){}
	$("div#logoParade").smoothDivScroll({ autoScroll: "always", autoScrollDirection: "backandforth", autoScrollStep: 1, autoScrollInterval: 20 });
	
	/* menu_buttons */
	
	$('div#menu_buttons ul li img').mouseover(function(){
		if(!$(this).hasClass('selected'))
			$(this).attr('src',$(this).attr('src').replace('_off.png','_on.png'));
	});
	$('div#menu_buttons ul li img').mouseout(function(){
		if(!$(this).hasClass('selected'))
			$(this).attr('src',$(this).attr('src').replace('_on.png','_off.png'));
	});
	
	/* download catalog button */
	$('.onoff, a.onoff, a.top_button, a.top_small_button').mouseover(function(){
			if(!$(this).hasClass('selected'))
				$(this).css('background-image',$(this).css('background-image').replace('_off.','_on.'));
	});
	$('.onoff, a.onoff, a.top_button, a.top_small_button').mouseout(function(){
			if(!$(this).hasClass('selected'))
				$(this).css('background-image',$(this).css('background-image').replace('_on.','_off.'));
	});
	
	$('.onoff').mouseover(function(){
			$(this).attr('src',$(this).attr('src').replace('_off.','_on.'));
	});
	$('.onoff').mouseout(function(){
			$(this).attr('src',$(this).attr('src').replace('_on.','_off.'));
	});
	
	
	$('.side_button').mouseover(function(){
		if(!$(this).hasClass('selected')){
			$(this).css('background-image',$(this).css('background-image').replace('_off.','_on.'));
			$(this).css('color','#fffee9');
		}
	}).mouseout(function(){
		if(!$(this).hasClass('selected')){
			$(this).css('background-image',$(this).css('background-image').replace('_on.','_off.'));
			$(this).css('color','#752184');
		}
	});
	
	
	$('#category_pages li').mouseover(function(){
		$(this).css('background-color','#8c3497');
		$(this).children().css('color','rgb(210, 210, 210)');
	}).mouseout(function(){
		$(this).css('background-color','');
		$(this).children().css('color','');
	});
	
  // Reset Font Size
  $('.top_small_button').click(function(){
	$('#resize_1').css('background-image',$('#resize_1').css('background-image').replace('_on.','_off.'));
	$('#resize_2').css('background-image',$('#resize_2').css('background-image').replace('_on.','_off.'));
	$('#resize_3').css('background-image',$('#resize_3').css('background-image').replace('_on.','_off.'));
	$('.top_small_button').removeClass('selected');
	$(this).addClass('selected');
	$(this).css('background-image',$(this).css('background-image').replace('_off.','_on.'));
  });
  $("#resize_1").click(function(){
	$('body').css('font-size', '100%');
	setCookie("lang_size",1,365);
	return false;
  });
  
  $("#resize_2").click(function(){
	$('body').css('font-size', '115%');
	setCookie("lang_size",2,365);
	return false;
  });
  
  $("#resize_3").click(function(){
	$('body').css('font-size', '130%');
	setCookie("lang_size",3,365);
	return false;
  });
	resetLangSize();
	
	
	
});
function checkSelected(selectors,type){
	switch(type){
		case 'src':
			$(selectors).mouseover(function(){
				if(!$(this).hasClass('selected'))
					$(this).attr('src',$(this).attr('src').replace('_off.png','_on.png'));
			}).mouseout(function(){
				if(!$(this).hasClass('selected'))
					$(this).attr('src',$(this).attr('src').replace('_on.png','_off.png'));
			});
			break;
		default:
			$(selectors).mouseover(function(){
				if(!$(this).hasClass('selected'))
					$(this).css('background-image',$(this).css('background-image').replace('_off.','_on.'));
			}).mouseout(function(){
				if(!$(this).hasClass('selected'))
					$(this).css('background-image',$(this).css('background-image').replace('_on.','_off.'));
			});
			break;
	}
}

function setCookie(c_name,value,exdays)
 {
 var exdate=new Date();
 exdate.setDate(exdate.getDate() + exdays);
 var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()+';path=/');
 document.cookie=c_name + "=" + c_value;
 }
 
 function getCookie(c_name)
 {
 var i,x,y,ARRcookies=document.cookie.split(";");
 for (i=0;i<ARRcookies.length;i++)
 {
   x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
   y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
   x=x.replace(/^\s+|\s+$/g,"");
   if (x==c_name)
     {
     return unescape(y);
     }
   }
 }
function resetLangSize(){
	var lang_size=getCookie("lang_size");
	if (lang_size!=null && lang_size!=""){
		$("#resize_"+lang_size).click();
	}else{
		$("#resize_1").click();
	}
}

function validateEmail(elementValue){  
	var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  
	return emailPattern.test(elementValue);  
}  

