$(document).ready(function() {
	//Count down voor chatberichten
	$('#chat_bericht').bind("keyup change", function(){
		if ($(this).val().length > 255 || $(this).val() == ''){
			$(this).val($(this).val().substring(0, 255));
			
			$('#ChatSubmit').css("visibility", "hidden");
			$('#chat_countdown').val("255");
		} else {
			$('#chat_countdown').val(255- $(this).val().length);
			$('#ChatSubmit').css("visibility", "");
		}	
	});
	
	
	/*
	$('#random_photo').live("mouseover", function(){
		$.blockUI({ 
			message: '<img src="'+$(this).attr("src")+'" class="'+$(this).attr("class")+'" id="random_photo_big" />',
			fadeIn: 600, 
			centerY: false,
            fadeOut: 600,
			css: {
				padding: '5px',
				'padding-bottom': '0px',
				top: '10px',
				left: '10px',
				width: $('#random_photo_big').width(),
				cursor: 'pointer'
			}
		});
		
		$('#random_photo_big').attr("src", $('#random_photo_big').attr("src").replace('normal','large'));
	});
	
	$('#random_photo_big').live("mouseout" , function(){
		$.unblockUI({
            fadeOut: 400
		});
	}); */
	
	
	$('#random_photo').live("click", function(){
		window.location.replace("/fotos/"+$(this).attr("class")+"/");
	});


	$('#chat_name,#chat_bericht,#chat_controle_vraag').bind("mouseover", function(){
		$(this).css("background-color", "#FBFBFF");	
		$(this).css("cursor", "default");
	});

	$('#chat_name,#chat_bericht,#chat_controle_vraag').bind("mouseout", function(){
		$(this).css("background-color", "");
	});
});

/*
function reloadWebcamReal(imgID, imageSRC){
	var obj = document.getElementById(imgID);
	if(obj){
		obj.src = imageSRC + '?' + (new Date()).getTime();
	}
}
*/

//window.setInterval("reloadWebcamReal('WebcamCS', 'http://asp01.amsterdam.nl/data/webcam-ijsei/IJsei.jpg')", 60000);
//window.setInterval("reloadWebcamReal('WebcamColumbusplein', 'http://212.83.73.135:8181/columbusplein.jpg')", 5000);
//window.setInterval("reloadWebcamReal('WebcamVU', 'http://130.37.9.12/record/current.jpg?rand=2869813')", 5000);

