// JScript File

//Error Handling
onerror=handleErr;
function handleErr(msg,url,l)
{
    return true;
}

function Nav(obj)
{
    var isNav = (window.navigator.appName.toLowerCase().indexOf("netscape")>=0);   
    if (isNav)
    {
        var main = parent.top.document.getElementById("frmCenter");    
    } else {
        var main = window.parent.top.document.getElementById("frmCenter");    
    }                    
    main.src = obj;          
}    
     
function resizeCenter()
{	
    //resize frmCenter
	var browser = navigator.appVersion;
	if (browser.search(/safari/i)==-1)  //all browsers but safari
	{
        var divheight = document.body.scrollHeight;
        if (divheight==0) { return false; }
        parent.document.getElementById('frmCenter').style.height = divheight + 20 + "px";	
	}  
	else
	{
	    var docHt = 0, sh, oh;
	    if (document.body.scrollHeight) docHt = sh = document.body.scrollHeight;
        if (document.body.offsetHeight) docHt = oh = document.body.offsetHeight;
        if (sh && oh) docHt = Math.min(sh, oh);
        if (docHt==0) { return false; }
        parent.document.getElementById('frmCenter').style.height = docHt + 20 + "px";
    }
}

function animImages()
{
	//animate images - não está a ser usado
	$(function() {
		$('.imgright').hover(function(){
			$(this).animate({width: 200, height: 155},{duration:100});
		}, function(){
			$(this).animate({width: 100, height: 75},{duration:100});
		});
	});
}

function resizediv(divheight)
{
    if (divheight==0) { return false; }
	parent.document.getElementById('frmCenter').style.height = divheight + 80 + "px"; 
}

function changefoto(src)
{
    document.getElementById('stickyimg').src = src;
}

function toggletext()
{
	$('.lermais').click(function() {
	    if (this.innerHTML=="...[+]")	    
	        { this.innerHTML = "...[-]"; this.title = "ler menos"; $(this).parent('.article2').animate({height: "100%"}); }
	        else { this.innerHTML = "...[+]"; this.title = "ler mais"; $(this).parent('.article2').animate({height: "100px"}); }
	        resizeCenter();
            return false;
        });
}
