$(document).ready(function() {
	subMenu();						 
});

function sfeerFade() {
	$('#cycle').cycle({
		fx: 'fade',
		prev: '#prev',
		next: '#next',
		cleartypeNoBg: true,
		after: function(curr,next,opts) {
			initSifr();	
		}
	});
}

function initSifr(){
	sIFR.replace(sifr,{selector:'h3',css:['.sIFR-root{color:#ffffff;font-style:normal;font-size:30px}'],wmode:'transparent'});
}

function customSelect(){
	$("select").each(function(){
		$(this).wrap("<div class='selector'></div>");
		// Store the value of title in the variable spanText
		var spanText = $(this).attr('title');
		// Use the variable span text as the default for the select field
		var span = "<span class='select'>" + spanText + "</span>";
		$(this).before(span)
		.fadeTo(1, 0)
		.focus(function(){
			$(this).parents(".selector").addClass("focus");
		})
		.change(function(){
			$(this).siblings("span").text($(this).children(":selected").text());
		}).click ( function (){
			$(this).siblings("span").text($(this).children(":selected").text());		
		}) 
		.blur(function(){
			$(this).parents(".selector").removeClass("focus");
		});	
	});
	$('select').trigger("change");
}

function subMenu() {
	$('ul#menu li').hover(function(){
		if($(this).children().size() > 1 ) {
			$(this).addClass('subhover');
		}
	}, function() {
		if($(this).children().size() > 1 ) {
			$(this).removeClass('subhover');
		}
	});
}
