// Callback function. Called when an AJAX-request results in an error.    
function ajaxError(jqXHR, status, error) {
	alert("AJAX error\n\n" + error);
}


$(document).ready(function(){
	$("._search-frame").click(function(){
		window.location.href = $(this).attr("title");
	});
	
	$("a[rel='sale_module']").colorbox({
		width:"50%", 
		opacity: 0.65,
		speed: 450,
	});
	
	
	tinyMCE.init({
        remove_script_host : false,
        convert_urls : false,
		language : "nl",
		mode : "textareas",
		editor_selector : "onlineEditor",
		theme : "advanced",
		skin : "default",
		plugins : "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,wordcount,advlist,autosave",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "center",
		theme_advanced_resizing : true,

		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,|,cut,copy,paste,|,bullist,numlist",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : ""
	});
});


function initAmbiente()
{
	var type = $(".ambiente-box").attr("id");
	var root = $(".ambiente-box").attr("alt");
	
	if(type != "dynamic-ambiente")
	{
		$(".ambiente-box").css("background-image", "url("+root+")");
	}
}
