function imageRotator()
{
	var randomnumber=Math.floor(Math.random()*11);
	
	if(randomnumber > 5){
		//blue
		$("#left").css("background","url(/assets/img/left_images_one.png) no-repeat");
		$("body").css("background","url(/assets/img/bkg_bar_blue.jpg) repeat-y left #FAFAFA");
	} else {
		$("#left").css("background","url(/assets/img/left_images_two.png) no-repeat");
		$("body").css("background","url(/assets/img/bkg_bar_purple.jpg) repeat-y left #FAFAFA");
	}
}

function messageFade()
{
	$(".error").fadeOut(2000);
}



$(function(){
	
	//clear messages	
	//setInterval('messageFade()',5000);
	$(".error").fadeOut(2000);
	
	$("ul.sf-menu").superfish({ 
        animation: {height:'show'},   // slide-down effect without fade-in 
        delay:     400               // 1.2 second delay on mouseout 
    });
    
    //image rotator
    imageRotator();
    
    //input form
    $("input").each(function(){
    	title = $(this).attr('title');
		value = $(this).val();
		if((title) && (!value)){
			$(this).addClass('input_title_value').css('color','#999').val(title);
		}
    });
    
    $(".input_title_value").focus(function(){
		title = $(this).attr('title');
		value = $(this).val();
		if(value == title){
			$(this).css('color','#333').val("");
		}
    });
    
    $(".input_title_value").blur(function(){
	    title = $(this).attr('title');
		value = $(this).val();
		if((title) && (!value)){
			$(this).css('color','#999').val(title);
		} else {
			$(this).removeClass('input_title_value');
		}
	});
	
	$(".title_check").click(function(){
		$("input").each(function(){
	    	title = $(this).attr('title');
			value = $(this).val();
			if(value == title) $(this).val("");
		});
	});
	
	$(".validate").validate();

});
