

$(document).ready(function() {


	/* Init Mouse Over */ 
    $('.hover').each(function() {
        if ($(this).attr("src").match(/_on\.(.+)$/i)) {
            $(this).removeClass("hover");
        }
    });
    $('.hover').hover(function() {
        s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
        $(this).attr("src", s);
    }, function() {
        s = $(this).attr("src").replace(/_on\.(.+)$/i, ".$1");
        $(this).attr("src", s);
    });


});


/*  Preload Mouse Over images */
$(window).bind('load', function() {
    var preload = new Array();
    $('.hover').each(function() {
        s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
        preload.push(s)
    });
    var img = document.createElement('img');
    $(img).bind('load', function() {
        if(preload[0]) {
            this.src = preload.shift();
        }
    }).trigger('load');
});




// Validate Form
(function($) { 
$.fn.validate = function(){
	$(this).submit( function() {
		var msg = '';
		var err_count = 0;
		$('.required', this).each(function(){
			var name = $(this).attr('name');
			var val = $(this).val();
			var err = false;
			if (val=='') {
				err = true;
				err_count++;
			}
			if (err){
				$(this).addClass('input-error');
			} else {
				$(this).removeClass('input-error');
			}
		});
		if (err_count){
			$('#form-messages').html('*All fields are required');
			$('#form-messages').fadeIn('fast');
			return false;
		}
	});
};
})(jQuery);








function live_radio(){
	w = window.open('player/index.html', 'liveradio', ',width=350,height=450,resizable=no,scrollbars=no,menubar=no');
	w.focus();
}
