	
	slide_check 		= 0;
	check_ie    		= 0;
	show_davis_invite 	= 0;
	
	function brands_rotator(){
		
		slide_speed = 15000;
		slide_easy  = "linear";
		
		// get UL height
		content_height = $("DIV#jq_rotator UL").height();
		
		// duplicate UL ( append on end )
		$("DIV#jq_rotator UL").after("<ul>" + $("DIV#jq_rotator UL").html() + "</ul>");
		
		
		$("DIV#jq_rotator UL").eq(0).animate({ 
			marginTop: "-" + content_height + "px"
		}, slide_speed , slide_easy , function(){
			
			$("DIV#jq_rotator UL").eq(0).remove();
			
			brands_rotator();
			
		});
		
	}
	
	
	function site_contact_check(){
		
		prazno = "";
		
		if (document.forms['site_contact'].cf_broj.value == "") prazno = prazno + "\n- Vaše broj telefona";
		if (prazno != "") {
		  alert("Molimo popunite sljedeće podatke: \n" + prazno)
		  return false;
		}
		else document.forms['site_contact'].submit(); 
		
	}
	
	
	function site_contact_check_en(){
		
		prazno = "";
		
		if (document.forms['site_contact'].cf_broj.value == "") prazno = prazno + "\n- Your phone";
		if (prazno != "") {
		  alert("Please fill in: \n" + prazno)
		  return false;
		}
		else document.forms['site_contact'].submit(); 
		
	}
	
	
	
	function show_davis_cup_invitation_window(){

		$("BODY").append('<div id="invite_davis_cup"><div id="in_invite"><a href="/hr/kontakt/" class="wide_link"></a><a href="#" class="close_link"></a><img src="/images/invite_davis.jpg" width="350" height="200" alt="" title=""></div></div>');
		
		// $("#invite_davis_cup").css('width', '350px');
		// $("#invite_davis_cup").css('height', '200px');
		// $("#invite_davis_cup").css('margin', '0px auto');	
		// $("#invite_davis_cup").css('positon', 'absolute');
		
		// $("#invite_davis_cup").css({ 'width' : '350px' , 'height' : '200px' , 'position' : 'absolute' , 'top' : '350px', 'left' : '0px' /*, 'display' : 'none'*/ });
		
		new_left = parseInt(($(window).width() - $("#invite_davis_cup").width()) / 2 );
		
		$("#invite_davis_cup").css({ 'left' : new_left + 'px' });
		
		//$("#invite_davis_cup").fadeIn( 500 );
		
		$("A.close_link").click(function(){
			
			$("#invite_davis_cup").remove();
			
			return false;
			
		});
		
	}
	
	
	
	function slide_site2(){
		
		slide_speed = 3500;
			
		$("DIV#site").animate({ 
			marginTop: "0px"
		}, slide_speed , "swing", function(){
			
			so.write("flash_content");
			
			/*-------------- video -------------------*/
			if( document.getElementById("player") ){
				
				$f("player", { src: "/videoplayer/flowplayer-3.0.5.swf" , wmode: 'transparent'} , { 
						
						plugins: {
						   controls: {
								backgroundGradient: 'none',
						      	backgroundColor: '#ffffff',
						      	bufferColor: '#d4d4d4',
						      	progressColor: '#d4d4d4',
						      	buttonColor: '#d4d4d4',
						      	buttonOverColor: '#b9b9b9',
			 			        volume:false,
						        mute:false,
						        fullscreen:false,
						        time:false
						   }
						}
						
						
						
				} );			
				
			}
			/*-------------- video -------------------*/
			
			if( check_ie == 0 ) var t=setTimeout("fade_color();",5000);
			
			// if( show_davis_invite ){ show_davis_cup_invitation_window(); }
			
		});
		
	}
	
	
	function slide_site(){	
		
		$("DIV#site").css('visibility', 'visible');
		
		slide_speed = 3500;
		
		if( slide_check == 1 ){
			
			// get site height
			site_height = $("DIV#site").height();
			
			$("DIV#site").css('margin-top', -site_height*1.2);
			
			var t2 = setTimeout("slide_site2();",2000);
			
		}
		else {
			
			var t=setTimeout("fade_color();",5000);
			
		}
		
	}
	
	function fade_color(){
		
		// $("DIV#bg_sub").css('opacity', 0.2);
		$("DIV#bg_sub").fadeTo(5000, 1, function(){
			$("DIV#bg_sub").fadeTo(3000, 0.2, function(){
				fade_color();
			});
		});
		
	}
	
	
	function fade_bg(){
		
		$("DIV#bg_sub").css('opacity', 0);
		
		if( slide_check == 1 ){
			$("DIV#bg , DIV#bg_sub").css('opacity', 0);
			$("DIV#bg").fadeTo(2000, 1);			
		}

		// if( check_ie == 0 ) var t=setTimeout("fade_color();",5000);
	
		
	}
	
	
	function center_content(){
		
		window_width = $(window).width();
		
		$("DIV#site").css('left', (window_width - $("DIV#site").width()) / 2);
		
	}
