$().ready(function() {
	$(".postalCode").keyup(function(event){
		if (this.value.length == 4) {
			$('.city').load('/ajax/postalCode2city?pc='+this.value,'',function (e, r, t) {
				$('.city').attr('value',e);
			})
		}
	});
	$('input:not(.noExample,[type*=file],[title=]),textarea:not(.noExample,[title=])').example(function() {
		return $(this).attr('title'); 
	});
});
function editComment( id ) {
	$('#comment-'+id+' .text').html('<form method="post"><input type="hidden" name="ThreadChildEdit[id]" value="'+id+'" /><textarea name="ThreadChildEdit[text]"></textarea></form>');
	$.get('/threadChild/getContent?id='+id, function(data) {
		$('#comment-'+id+' .text textarea').val(data).tinymce({
			script_url : 'http://cm.youthportals.dk/js/tiny_mce_3_3_8/tiny_mce.js',
	
			theme : "advanced",
			plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	
			theme_advanced_buttons1 : "save,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect,code",
			theme_advanced_buttons2 : "bullist,numlist,|,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,|,preview,|,forecolor,backcolor,sub,sup,|,charmap",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
					
			content_css : "/themes/default/css/style.css",
			
			width : "530",
			height : "200",
		});
	});
}
