var message="Copyright © Choral Phydellius"

function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;}}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all)
		if (e.which==2||e.which==3){
			alert(message);
			return false;}}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;}

document.oncontextmenu=new Function("alert(message);return false")

function mouseOver(bname){
	if (bname=="favo") 
		document.favo.src ="img/bot_adc_fav_on.png"
	if (bname=="home") 
		document.home.src ="img/bot_home_on.png"
	if (bname=="PT") 
		document.PT.src ="img/bot_portug_on.png"
	if (bname=="EN") 
		document.EN.src ="img/bot_english_on.png"
	if (bname=="b_home"){
		document.b_home.src ="img/home_on.png"
		document.b_home.width = 27;document.b_home.height = 27;document.b_home.vspace = 0;document.b_home.hspace = 0}
	if (bname=="b_noticias"){
		document.b_noticias.src ="img/noticias_on.png"
		document.b_noticias.width = 27;document.b_noticias.height = 27;document.b_noticias.vspace = 0;document.b_noticias.hspace = 0}
	if (bname=="b_cadult"){
		document.b_cadult.src ="img/cadult_on.png"
		document.b_cadult.width = 27;document.b_cadult.height = 27;document.b_cadult.vspace = 0;document.b_cadult.hspace = 0}
	if (bname=="b_cjuven"){
		document.b_cjuven.src ="img/cjuven_on.png"
		document.b_cjuven.width = 27;document.b_cjuven.height = 27;document.b_cjuven.vspace = 0;document.b_cjuven.hspace = 0}
	if (bname=="b_conser"){
		document.b_conser.src ="img/conser_on.png"
		document.b_conser.width = 27;document.b_conser.height = 27;document.b_conser.vspace = 0;document.b_conser.hspace = 0}
	if (bname=="b_sede"){
		document.b_sede.src ="img/sede_on.png"
		document.b_sede.width = 27;document.b_sede.height = 27;document.b_sede.vspace = 0;document.b_sede.hspace = 0}
	if (bname=="b_orgaos"){
		document.b_orgaos.src ="img/orgaos_on.png"
		document.b_orgaos.width = 27;document.b_orgaos.height = 27;document.b_orgaos.vspace = 0;document.b_orgaos.hspace = 0}
	if (bname=="b_multi"){
		document.b_multi.src ="img/multi_on.png"
		document.b_multi.width = 27;document.b_multi.height = 27;document.b_multi.vspace = 0;document.b_multi.hspace = 0}
	if (bname=="b_links"){
		document.b_links.src ="img/links_on.png"
		document.b_links.width = 27;document.b_links.height = 27;document.b_links.vspace = 0;document.b_links.hspace = 0}
	if (bname=="b_contact"){
		document.b_contact.src ="img/contact_on.png"
		document.b_contact.width = 27;document.b_contact.height = 27;document.b_contact.vspace = 0;document.b_contact.hspace = 0}
	if (bname=="b_livro"){
		document.b_livro.src ="img/livro_on.png"
		document.b_livro.width = 27;document.b_livro.height = 27;document.b_livro.vspace = 0;document.b_livro.hspace = 0}
	if (bname=="b_mapa"){
		document.b_mapa.src ="img/mapa_on.png"
		document.b_mapa.width = 27;document.b_mapa.height = 27;document.b_mapa.vspace = 0;document.b_mapa.hspace = 0}
	if (bname=="bot1"){
		document.bot1.src ="img/bot2.png"
		document.bot1.width = 10;document.bot1.height = 10;document.bot1.vspace = 4;document.bot1.hspace = 4}
	if (bname=="bot2"){
		document.bot2.src ="img/bot2.png"
		document.bot2.width = 10;document.bot2.height = 10;document.bot2.vspace = 4;document.bot2.hspace = 4}
	if (bname=="bot3"){
		document.bot3.src ="img/bot2.png"
		document.bot3.width = 10;document.bot3.height = 10;document.bot3.vspace = 4;document.bot3.hspace = 4}
	if (bname=="bot4"){
		document.bot4.src ="img/bot2.png"
		document.bot4.width = 10;document.bot4.height = 10;document.bot4.vspace = 4;document.bot4.hspace = 4}
	if (bname=="bot5"){
		document.bot5.src ="img/bot2.png"
		document.bot5.width = 10;document.bot5.height = 10;document.bot5.vspace = 4;document.bot5.hspace = 4}
	if (bname=="bot6"){
		document.bot6.src ="img/bot2.png"
		document.bot6.width = 10;document.bot6.height = 10;document.bot6.vspace = 4;document.bot6.hspace = 4}}

function mouseOut(bname){
	if (bname=="favo") 
		document.favo.src ="img/bot_adc_fav.png"
	if (bname=="home") 
		document.home.src ="img/bot_home.png"
	if (bname=="PT") 
		document.PT.src ="img/bot_portug.png"
	if (bname=="EN") 
		document.EN.src ="img/bot_english.png"
	if (bname=="b_home"){
		document.b_home.src ="img/home.png"
		document.b_home.width = 25;document.b_home.height = 25;document.b_home.vspace = 1;document.b_home.hspace = 1}
	if (bname=="b_noticias"){
		document.b_noticias.src ="img/noticias.png"
		document.b_noticias.width = 25;document.b_noticias.height = 25;document.b_noticias.vspace = 1;document.b_noticias.hspace = 1}
	if (bname=="b_cadult"){
		document.b_cadult.src ="img/cadult.png"
		document.b_cadult.width = 25;document.b_cadult.height = 25;document.b_cadult.vspace = 1;document.b_cadult.hspace = 1}
	if (bname=="b_cjuven"){
		document.b_cjuven.src ="img/cjuven.png"
		document.b_cjuven.width = 25;document.b_cjuven.height = 25;document.b_cjuven.vspace = 1;document.b_cjuven.hspace = 1}
	if (bname=="b_conser"){
		document.b_conser.src ="img/conser.png"
		document.b_conser.width = 25;document.b_conser.height = 25;document.b_conser.vspace = 1;document.b_conser.hspace = 1}
	if (bname=="b_sede"){
		document.b_sede.src ="img/sede.png"
		document.b_sede.width = 25;document.b_sede.height = 25;document.b_sede.vspace = 1;document.b_sede.hspace = 1}
	if (bname=="b_orgaos"){
		document.b_orgaos.src ="img/orgaos.png"
		document.b_orgaos.width = 25;document.b_orgaos.height = 25;document.b_orgaos.vspace = 1;document.b_orgaos.hspace = 1}
	if (bname=="b_multi"){
		document.b_multi.src ="img/multi.png"
		document.b_multi.width = 25;document.b_multi.height = 25;document.b_multi.vspace = 1;document.b_multi.hspace = 1}
	if (bname=="b_links"){
		document.b_links.src ="img/links.png"
		document.b_links.width = 25;document.b_links.height = 25;document.b_links.vspace = 1;document.b_links.hspace = 1}
	if (bname=="b_contact"){
		document.b_contact.src ="img/contact.png"
		document.b_contact.width = 25;document.b_contact.height = 25;document.b_contact.vspace = 1;document.b_contact.hspace = 1}
	if (bname=="b_livro"){
		document.b_livro.src ="img/livro.png"
		document.b_livro.width = 25;document.b_livro.height = 25;document.b_livro.vspace = 1;document.b_livro.hspace = 1}
	if (bname=="b_mapa"){
		document.b_mapa.src ="img/mapa.png"
		document.b_mapa.width = 25;document.b_mapa.height = 25;document.b_mapa.vspace = 1;document.b_mapa.hspace = 1}
	if (bname=="bot1"){
		document.bot1.src ="img/bot1.png"
		document.bot1.width = 8;document.bot1.height = 8;document.bot1.vspace = 5;document.bot1.hspace = 5}
	if (bname=="bot2"){
		document.bot2.src ="img/bot1.png"
		document.bot2.width = 8;document.bot2.height = 8;document.bot2.vspace = 5;document.bot2.hspace = 5}
	if (bname=="bot3"){
		document.bot3.src ="img/bot1.png"
		document.bot3.width = 8;document.bot3.height = 8;document.bot3.vspace = 5;document.bot3.hspace = 5}
	if (bname=="bot4"){
		document.bot4.src ="img/bot1.png"
		document.bot4.width = 8;document.bot4.height = 8;document.bot4.vspace = 5;document.bot4.hspace = 5}
	if (bname=="bot5"){
		document.bot5.src ="img/bot1.png"
		document.bot5.width = 8;document.bot5.height = 8;document.bot5.vspace = 5;document.bot5.hspace = 5}
	if (bname=="bot6"){
		document.bot6.src ="img/bot1.png"
		document.bot6.width = 8;document.bot6.height = 8;document.bot6.vspace = 5;document.bot6.hspace = 5}}

function loadText(text,wid){
	document.textF.height=20
	document.textF.width=wid
	document.textF.src="img/"+text+".png"}

function unloadText(){
	document.textF.height=4
	document.textF.width=4
	document.textF.src="img/back.png"}


function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }}

this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 200;
		yOffset = 20;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});
