

	$(document).ready(function(){
					if ($('#box').length){
						$('#box').freeSlider({
							rows: 1,
							width: 490,
							height: 154,
							click : { 
								next : '#next',
								previous : '#previous',
							},
							slide : 5,
							marginRight: 0,
							marginBottom: 0,
							slideSpeed:200
						});
					}

					$('#subscribe').bind('click', function() {
					
						$.ajax({						  

							url: 'newsletter.php?email=' + document.getElementById("mail").value,						  

							success: function(data) {
								if(data == "valid"){						    		
									$('#subscribe_text').text("Thank you for registing");		
									reloadImg("captcha_img");					
								}else if(data == "invalid"){								
									alert("This mail is not valid");
								}
					}
						
				});					 											
		});
								
	}); 

/* live search */
$(document).ready(function(){
	var input = $('#header_search');
	$(input).attr('autocomplete', 'off');

	var liveSearch = $('.live-search-1');
	$(liveSearch).css('z-index', '100000');
		
	input.keyup(function() {
		if(this.value.length > 1 && this.value != this.lastValue) {
			//console.log("opening autocomplete");
			liveSearch.slideDown(200);
		}
		else {
			//console.log("closing autocomplete");
			liveSearch.slideUp(200);
		}
		this.lastValue = this.value;
	});
	
	
	/*$("body").click(function(event) {
		//alert("clicked!");
		//console.log(event);
		if(!$(event.target).parents('.live-search-1').length) {
		//	console.log(liveSearchOpen);
		//if (liveSearchOpen){
			console.log($(event.target).parents('.live-search-1'));
			console.log(liveSearchOpen);
			console.log("closing autocomplete");
			//$('.live-search-1').slideUp(200);
		}
	});*/
	
	$("#header_search").focusout(function(){
		//console.log("dada");
		liveSearch.slideUp(200);
		
	});
	
	liveSearch.hide();
	//console.log("doc initialized");
	
});

/*$("body").click(function(event) {
		//alert("clicked!");
		console.log(event);
		if(!$(event.target).parents('.live-search-1').length) {
			$('.live-search-1').slideUp(200);
		}
	});*/

/* Ad List BEGIN */

	$(document).ready(function(){
		$(".resultrow").hover(
        function() {
        $(this).animate({ backgroundColor: "#D2DBEE"}, 200);
        },
        function() {
        $(this).animate({ backgroundColor: "#F9FBFD" }, 200);
     });  
		 
		$(".sponsored-resultrow").hover(
        function() {
        $(this).animate({ backgroundColor: "#DAE1F1"}, 200);
				//$(this).addClass("sponsored-resultrow-active", 0);
        },
        function() {
        $(this).animate({ backgroundColor: "#EFEFEF"}, 200);
				//$(this).removeClass("sponsored-resultrow-active", 0);
     }); 
	});
	
/* Ad List BEGIN */

