$(document).ready(function(){ 
	if ($.cookie("il_def_loc") != null) {
		$("#wherebox").css('color', '#666');
		$("#wherebox").css('font-style', 'italic');
		$("#wherebox").val($.cookie("il_def_loc"));
		$("#wherebox").focus(function() {
			if ($("#wherebox").val() == $.cookie("il_def_loc")) {
				$("#wherebox").val("");
			}
			$("#wherebox").css('color', '#333');
			$("#wherebox").css('font-style', 'normal');
		});
	}
	
	$(".mainsearchtermcloud").click(function() {
		ilLog("popularsearchterm", 0, '-1',-1,-1,-1,'');
		$("#whatbox").val($(this).html());
	});
	
	$(".mainsearchlocationcloud").click(function() {
		ilLog("popularlocation", 0, '-1',-1,-1,-1,'');
		$("#wherebox").val($(this).html());
	});	
	
	$("#whatbox").focus(function(){
		if($(this).attr("value") == $("#whatboxvalue").val()){
			$(this).attr("value", "");
			$(this).css("font-style","normal");
		}
	});
	
	$("#whatbox").val($("#whatboxvalue").val());

	$("#wherebox").focus(function(){
		if($(this).attr("value") == $("#whereboxvalue").val() || $(this).css("font-style") == "italic"){
			$(this).attr("value", "");
		}
		$(this).css("font-style","normal");
	});

	if ($("#wherebox").val() == "") {
		$("#wherebox").val($("#whereboxvalue").val());
	}
	
	$("div.mask").scrollable({
		size: 3,
		items: '#thumbs',  
		hoverClass: 'hover',
		next: 'div.next', 
	    prev: 'div.prev' 
	});	
	
	var ajt = $('a.jt').cluetip({
			cluetipClass: 'locationtip', 
		    arrows: true, 
		    dropShadow: false,
		    sticky: true,
		    mouseOutClose: false,
		    closePosition: 'title',
		    closeText: '<img src="/images/dc/btn-close.gif" alt="close" />',
			ajaxCache: false,
			positionBy: 'mouse',
			hideLocal: false,
			showTitle: false,
			leftOffset: -170,
			width: 350
	});
});