var Site={
	init:function(){
		$('.general-nav>ul>li').hover(function(){
			$(this).addClass('current');
			var temp = $(this).children().children().attr('src');
			$(this).children().children().attr('src', $(this).children().children().attr('alt'));
			$(this).children().children().attr('alt', temp);
		},
		function(){
			$(this).removeClass('current');
			var temp = $(this).children().children().attr('alt');
			$(this).children().children().attr('alt', $(this).children().children().attr('src'));
			$(this).children().children().attr('src', temp);
		});
		$('.SearchIcon').hover(function() {
			$('#SearchChoice').slideDown('fast');
		}, function() {
			$('#SearchChoice').slideUp('fast');
		});
		$('#SearchChoice li').hover(function() {
			$(this).addClass('hover');
		}, function() {
			$(this).removeClass('hover');
		});
		$('#SearchChoice li').click(function() {
			$('#SearchChoice').slideUp('fast');
			if($(this).attr('id') == 'site') {
				$('.SearchIcon').css({backgroundImage: 'url(/wp-content/themes/default/image/radioone-icon.gif)'});
				$('#search').attr({action: '/', target: '_self'});
			} else {
				$('.SearchIcon').css({backgroundImage: 'url(/wp-content/themes/default/image/google-icon.gif)'});
				$('#search').attr({action: 'http://www.google.com/search', target: '_blank'});
			}
		});
		$('#search').bind('submit', function() {
			this.q.value = this.s.value;
			if(this.s.value == '' || this.s.value == 'Search here...') {
				this.s.focus();
				return(false);
			}
			return(true);
		});
		$('.mute a').click(function(){
			if(!$.cookie('mute')){		
			alert("rakesh");
			$(this).parent().addClass("play");
			$(this).siblings('embed').attr('volume','0');
			
			$.cookie('mute', 1, {path:'/', expires:30});
			}else{
			alert("sunil");
			$.cookie('mute', 0, {path:'/', expires:-1});
			$(this).parent().removeClass("play");
			$(this).siblings('embed').attr('volume','100%');	
			}
				   
		});
		$('.alignleft,.alignright').each(function() {
			if($(this).parent('a').length) {
				$(this).parent('a').fancybox();
			}
		});
	},
	roll_over:function(img_name, img_src){
		alert(img_name);
		document[img_name].src = img_src;
	}
};

$(function() {
	Site.init();
});