
var SEARCH_CONTENT = "Ketikkan Nama Barang..";

$(document).ready(function() {
	/*
	 $(function () {
		$("input[type='text']").focus(function () {
			$(this).addClass("txt-normal");	
			if($(this).val() == $(this).attr("title")){
				$(this).val("");
			}
			
		});
		
			
		$("input[type='password']").focus(function () {
			$(this).addClass("txt-normal");	
			if($(this).val() == $(this).attr("title")){
				$(this).val("");
			}
			
		});
		
		$("input[type='text']").blur(function () {
			$(this).removeClass("txt-focus");	
			if(($(this).val() == "") || ($(this).val() == $(this).attr("title"))){
				$(this).val($(this).attr("title"));
			} else {
			}
		});
		
		
		$("input[type='password']").blur(function () {
			$(this).removeClass("txt-focus");	
			if(($(this).val() == "") || ($(this).val() == $(this).attr("title"))){
				$(this).val($(this).attr("title"));
			} else {				
			}
		});
	 });
	
	$("input[type='text']").each( function(n,element){
		});     
	$("input[type='password']").each( function(n,element){$(this).val($(this).attr("title")); } );     
	*/
	 
	$('#slider').nivoSlider({
		effect:'fold',
		keyboardNav:true,
		pauseTime:7000,
		animSpeed:200 
	});
	
	$(function() {
		$("#sidebar").jCarouselLite({
			vertical: true,
			hoverPause:true,
			visible: 4,
			btnNext: ".browse-stores-next",
			btnPrev: ".browse-stores-prev",
			auto:5000,
			speed:5000,			
		});
	});
	
	$(function() {
		$("#cuaca").jCarouselLite({
			vertical: true,
			hoverPause:true,
			visible: 4,
			btnNext: ".browse-stores-next",
			btnPrev: ".browse-stores-prev",
			auto:5000,
			speed:5000,			
		});
	});
	
	$(".tip_trigger").hover(function(){
		tip = $(this).find('.tip');
		tip.show(); 
	}, function() {
		tip.hide(); 
	}).mousemove(function(e) {
		var mousex = e.pageX + 20; 
		var mousey = e.pageY + 20; 
		var tipWidth = tip.width(); 
		var tipHeight = tip.height(); 
		
		var tipVisX = $(window).width() - (mousex + tipWidth);
		var tipVisY = $(window).height() - (mousey + tipHeight);
		  
		if ( tipVisX < 20 ) { 
			mousex = e.pageX - tipWidth - 20;
		} if ( tipVisY < 20 ) { 
			mousey = e.pageY - tipHeight - 20;
		} 
		tip.css({  top: mousey, left: mousex });
	});
	
	
	$("ul.thumb li").hover(function() {
		$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
		$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
			.animate({
				marginTop: '-110px', /* The next 4 lines will vertically align this image */ 
				marginLeft: '-110px',
				top: '50%',
				left: '50%',
				width: '174px', /* Set new width */
				height: '174px', /* Set new height */
				padding: '20px'
			}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

		} , function() {
		$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
		$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
			.animate({
				marginTop: '0', /* Set alignment back to default */
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '90px', /* Set width back to default */
				height: '90px', /* Set height back to default */
				padding: '5px'
			}, 400);
	});

});

function zoomImage(){
	window.open($(".image-detail").attr("src") + "&ok=1", "_blank");
}

function swapImage(id){
	$(".image-detail").attr("src", $("#" + id).attr("src"));
}

