$(function()
{
	$('#search_options div.e-1 h3').click(function()	{	$('div#search_options div.e-1 ul').toggle();	});
	
	setInterval("slideSwitch()", 3000);
	sleepsInfo();	

	$('body.template-property div#global div#content div.information').append('<p id="more-info">Important info</p>');
	$('body.template-property div#global div#content div.information p#more-info').hover(function()	{	$('body.template-property div.last').toggle();	}	);
	
	$('body.template-property div#global div#functions #functions_blocks #availability_and_price').append('<p id="currency"><a href="http://widget.currency-converter.com/widget/ccwidget.html?from=GBP&to=USD" title="Currency converter" target="_blank">Currency converter</a></p>');

	setInterval("forms()",50);

	// $('body#search #search_guests_name').parent().append('<p>Minimum Stay 3 nights</p>');
});


function slideSwitch()
{
		var $active=$('#slideshow li.active');
 
		if($active.length==0)
		{	$active = $('#slideshow li:last');	}
 
		var $next=$active.next().length?$active.next():$('#slideshow li:first');
		$active.addClass('last-active');
		$next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 600, function() {$active.removeClass('active last-active');});
}


function sleepsInfo()
{
	$('body.template-property div#global div#content div.information').append('<dl id="sleeps-info"></dl>');
	
	$('body.template-property div#global div#content div.information dl dt.e-6, body.template-property div#global div#content div.information dl dd.e-6,body.template-property div#global div#content div.information dl dt.e-7,body.template-property div#global div#content div.information dl dd.e-7,body.template-property div#global div#content div.information dl dt.e-8,body.template-property div#global div#content div.information dl dd.e-8,body.template-property div#global div#content div.information dl dt.e-9,body.template-property div#global div#content div.information dl dd.e-9').clone().appendTo('#sleeps-info');
	
	$('body.template-property div#global div#content div.information dl dd.e-5').hover(function()	{$('#sleeps-info').toggle()});
}




function forms()
{
	$('form textarea').each(	
														function()	
														{
															if(!$(this).closest('p.input_element').hasClass('textarea'))	{	$(this).closest('p.input_element').addClass('textarea');	}
														}
													);
													
	$('form .boxfield').each(	
														function()	
														{
															if(!$(this).closest('p.input_element').hasClass('multiplec'))	{	$(this).closest('p.input_element').addClass('multiplec');	}
														}
													);
}

