// Show or close Mail to friend layer
function Mail_showContainer() {
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
	}

	if ((myWidth - 760)/2 > 0)
	{
		document.getElementById("mailToFriend").style.right = (myWidth - 760)/2 + 20 + 'px';
	}
	else
	{
		document.getElementById("mailToFriend").style.right = 20 + 'px';
	}

	var c = document.getElementById("mailToFriend");
	if (c.style.display == "block")
	{
		c.style.display = "none";
	}
	else
	{
		c.style.display = "block";
	}
}

// Font size changes
function main_font_change_large() {
	var c = document.getElementById("content");
	c.className = "content_l";
	var lfont = document.getElementById("lfont");
	var mfont = document.getElementById("mfont");
	var sfont = document.getElementById("sfont");
	lfont.src = "graphics/textlargeover.gif";
	mfont.src = "graphics/textmedium.gif";
	sfont.src = "graphics/textsmall.gif";
}

function main_font_change_middle() {
	var c = document.getElementById("content");
	c.className = "content_m";
	var lfont = document.getElementById("lfont");
	var mfont = document.getElementById("mfont");
	var sfont = document.getElementById("sfont");
	lfont.src = "graphics/textlarge.gif";
	mfont.src = "graphics/textmediumover.gif";
	sfont.src = "graphics/textsmall.gif";
}

function main_font_change_small() {
	var c = document.getElementById("content");
	c.className = "content_s";
	var lfont = document.getElementById("lfont");
	var mfont = document.getElementById("mfont");
	var sfont = document.getElementById("sfont");
	lfont.src = "graphics/textlarge.gif";
	mfont.src = "graphics/textmedium.gif";
	sfont.src = "graphics/textsmallover.gif";
}

function addfav()
{
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(document.title, window.location.href,"");	
	} 
	else if( window.external ) { // IE Favorite	
		window.external.AddFavorite(window.location.href, document.title); 
	}	
	else if(window.opera && window.print) { // Opera Hotlist
		var elem = document.createElement('a');
		elem.setAttribute('href',window.location.href);
		elem.setAttribute('title',document.title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}
}

function writeSize(){
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
	}

	if ((myWidth - 760)/2 > 0)
	{
		document.getElementById("mailToFriend").style.right = (myWidth - 760)/2 + 20 +'px';
	}
}

window.onresize=writeSize;