// filename: _curso.js

$(function(){

	$("#links div").hover(function(){
		$(this).addClass("hover");
	}, function(){
		$(this).removeClass("hover");
	});
	
	$("#links div").click(function(){
		goTo($(this).find("a").attr("href"), $(this).find("a").attr("target"));
	});
	
	$("#links div a, #menu_fundo a").click(function(){
		goTo($(this).attr("href"), $(this).attr("target"), $(this).attr("class"));
		return false;
	});
	
	
	// Automatically calculates the editor base path based on the _samples directory.
	// This is usefull only for these samples. A real application should use something like this:
	// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
	$("textarea.fck").each(function(){
		var sBasePath = '../_inc/fckeditor/';
		var oFCKeditor = new FCKeditor( $(this).attr("name") ) ;
		oFCKeditor.BasePath	= sBasePath ;
		oFCKeditor.ToolbarSet = 'Basic' ;
		oFCKeditor.Width = '770px' ;
		oFCKeditor.Height = '560px' ;
		oFCKeditor.ReplaceTextarea() ;
	});

});


function goTo(url, target, objclass) {
	if (url=="#") {
		return false;
	} else if (objclass=="fotos") {
		openAlbum("24");
		return false;
	} else if (target=="_blank") {
		window.open(url);
	} else {
		location.href=url;
	}
}

