//created by adhitya.rp@gmail.com for kadin on 20-10-2010 at 00:30
$(document).ready(function(){
	jQuery('ul.sf-menu').superfish();
	$('#content .headbg').fadeTo(0,'.5');
	if(!$.browser.msie){
		$('#agendapreview').fadeTo(0,'.85');
	}
	var agenda=0;
	var xpause=3000;
	$('#agendapreview .box').each(function(){agenda++})
	if(agenda<=3){xpause=9999999}
	$('#agendapreview .acontent').vTicker({
	   speed: 500,
	   pause: xpause,
	   showItems: 3,
	   animation: 'fade',
	   mousePause: true,
	   height: 0,
	   direction: 'up'
	});
	/*
	var info=0;
	var xpause2=3000;
	$('#infopreview .box').each(function(){info++})
	if(info<=2){xpause2=9999999}
	$('#infopreview .acontent').vTicker({
	   speed: 500,
	   pause: xpause2,
	   showItems: 4,
	   animation: 'fade',
	   mousePause: true,
	   height: 0,
	   direction: 'up'
	});*/
	$("#photopreview .pcontent img[title]").tooltip({delay:5,tipClass:'phototooltip'});
	var searchToggle=false;
	$("#search").each(function(){
		var defText="Penelusuran...";				   
		$(this).attr({value:defText});
		$(this).focus(function(){$(this).attr({value:""});searchToggle=true;})
			$(this).blur(function(){
				if($(this).attr("value")==""){
					$(this).attr({value:defText});
					searchToggle=false;
				}
			})
	});
	$("#submitSearch").click(function(){
		if(!searchToggle){
			$("#search").attr("value")="";
		}
		$("#cse-search-box").submit();
	})
});
