var root_http = 'http://www.autoplace.cz/account/';

$(document).ready(function(){
/********** Begin init **********/
	showHide();
	
	$('span.close').click(function(e){		
		$(this).parent().hide();	
	});

	$('.change_picture').click(function(){	
		$('.captcha').attr('src', root_http+'modules/captcha/securimage_show.php?sid='+ Math.random());
		return false;	
	});
	
	$("a[rel^='lightbox']").prettyPhoto();
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$("a[rel^='shadowbox']").prettyPhoto();
	
	$("#objednavka_vozu_form_zakaznik").autocomplete(zakaznici, {
		matchContains: true,
		selectFirst: true,
		cacheLength: 1,
		minChars: 0,
		scrollHeight: 250,
		max: 20
	});
	
	$("#dotaz_na_vuz_form_zakaznik").autocomplete(zakaznici, {
		matchContains: true,
		selectFirst: true,
		cacheLength: 1,
		minChars: 0,
		scrollHeight: 250,
		max: 20
	});
	
	$("#zakaznik").autocomplete(zakaznici, {
		matchContains: true,
		selectFirst: true,
		cacheLength: 1,
		minChars: 0,
		scrollHeight: 250,
		max: 20
	});
/********** End init **********/
	
	
/********** Begin show/hide menu **********/		
	/*$(".menu").hover(function () {
		$(this).find(".podmenu").toggle("fast") //animate({height: ['toggle', 'swing'], duration: '400'})
	})*/
	//		$(this).find(".podmenu").stop().slideUp("fast")
	//$('#menu').jmenu({animation:'slide',duration:230});
/********** End show/hide menu **********/	

	
/********** Begin show/hide boxes **********/	
	$('.showHide').click(
            function(){
            	switch ($show) {
					case "0": {
						$(this).parent().parent().find('.showContent').slideToggle("normal");
						//$(this).find('.showButton').html("+");
						$show = "1";
						break;
					}
					case "1": {
						$(this).parent().parent().find('.showContent').slideToggle("normal");
						//$(this).find('.showButton').html("-");
						$show = "0";
						break;
					}	
				}
            }
    );	
	
	$('.showHide2').click(
            function(){
            	switch ($show) {
					case "0": {
						$(this).parent().parent().find('.showContent2').slideToggle("normal");
						//$(this).find('.showButton').html("+");
						$show = "1";
						break;
					}
					case "1": {
						$(this).parent().parent().find('.showContent2').slideToggle("normal");
						//$(this).find('.showButton').html("-");
						$show = "0";
						break;
					}	
				}
            }
    );
		 
	function showHide(){
		//$('.showDiv').find('.showContent').hide();
		//$('.showDiv').find('.showButton').html("+");
		$show = "1";
	};
/********** End Show/Hide boxes  **********/
});

