$(document).ready(function() {
	
	//$(".side-main-menu-list li").hover(function() {
//    $(this).addClass("hover");
//	}, 
//	  function () {
//		$(this).removeClass("hover");
//	});
	

	var options = {
	newsList: "#news-ticker-list",
	startDelay: 1,
	placeHolder1: " _",
	controls: false,
	stopOnHover: false
	}
	$().newsTicker(options);

	$(function() {
		if($(".newsticker-jcarousellite li").length > 1) {
			$(".newsticker-jcarousellite").jCarouselLite({  
				vertical: true,  
				visible: 1,  
				auto:6000,  
				speed:2500
			});
		}
	});
	

	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'54px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'77px'},{queue:false,duration:160});
	});
	
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.caption-scroll').hover(function(){
		$(".cover", this).stop().animate({top:'75px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'100px'},{queue:false,duration:160});
	});

	// Form Input
	$('.change').focus(function() {
	if (this.value == this.defaultValue) {
	this.value = ''; }});
	$('.change').blur(function() {
	if (this.value == '') {
	this.value = this.defaultValue; }});
	
	// Fancybox
	$(".fancybox").fancybox({ titleShow: false });

	// Table coloring
	$('.sector-offer tbody tr:odd').addClass('colored');
	$('.apartman-specs tbody tr:even').addClass('colored');
	$('.rich-txt table tbody tr:even').addClass('colored');
	
	// Class on Hover
	$(".sector-offer tbody tr").hover(
		function() { $(this).addClass("hover"); }, 
		function() { $(this).removeClass("hover"); }
	);
	
	$(".side-main-menu-list").treeview({
 		//persist: "location",
 		collapsed: true,
 		unique: true,
 		animated: true,
 		speed: 1
 	});

	$('.treeview').parent().show().parent().removeClass('expandable').addClass('collapsable');

	$('.treeview .selected').removeClass('expandable').addClass('collapsable').find('ul').show();
});

$(window).load(function() {
	$('a.a-flash-wrapper').each(function(i, element) {
		$(element).css({ width: $(element).next().width(), height: $(element).next().height() })
	});
});

