	// JavaScript Document
	
/*function fotos()
{
window.open('fotoscentral/fotos.asp?cat=<%=fotos("cat")%>&imagem=<%=fotos("imagem")%>&cont=1','pop','width=720,height=510,top=0, left=0, scrollbars=yes');
}
*/
function popup(popupURL, popupWidth, popupHeight, popupLeft, popupTop)
{
window.open('home.htm','site','toolbars=no,scrollbars=yes,resizable=no,directories=no,statusbar=yes , height=560, width= 800 , fullscreen=no,top='+(window.screen.height/2-600/2)+',left='+(window.screen.width/2-800/2)+', ');
}
function agenda(popupURL, popupWidth, popupHeight, popupLeft, popupTop)
{
window.open('aniversario/agenda/popup.html','agenda','toolbars=no,scrollbars=yes,resizable=no,directories=no,statusbar=no , height=484, width=775, fullscreen=no,top='+(window.screen.height/2-600/2)+',left='+(window.screen.width/2-800/2)+', ');
}
function alignMenu()
{
	var isNetscape = navigator.appName=="Netscape";
	if (isNetscape) { w = window.innerWidth } 
	else { w = document.body.clientWidth }

	menu = document.getElementById('menusuperior');
	
	menu.style.left = 168+((w-200)/2)
	menu.style.visibility = 'visible'
}
onresize=alignMenu

function change() 
{ 
	if(!document.all) 
		return 
	if (event.srcElement.className=="expandable")
	{
		var x=event.srcElement.parentElement
		if (x.all[2].style.display=="none")
		{ 
			x.all[2].style.display=""; 
		} 
		else 
		{ 
			x.all[2].style.display="none" 
		} 
	} 
} 
document.onclick=change

window.defaultStatus = "Central Surf";

function ampliar(url)
{
	w = 200
	h = 200
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('includes/ampliar.asp?src=../'+url, 'ampliar', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function ampliarFromThumb(url)
{
	w = 200
	h = 200
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('ampliar.asp?src=../'+url, 'ampliar', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function banner() 
{
	w = 300
	h = 300
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('banner_1.html', 'banner', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function tabloide() 
{
	w = 767
	h = 500
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('banners/tabloide.html', 'tabloide', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function aulas() 
{
	w = 617
	h = 354
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('banners/liquidacao/index.html', 'aulas', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function cadastro() 
{
	w = 250
	h = 250
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('http://www.centralsurfnews.com.br/t/form.php', 'cadastro', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function cam(url) 
{
	w = 385
	h = 402
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open(url, 'cam', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

function novo() 
{
	w = 500
	h = 318
	centerX = (screen.height/2)-h/2;
	centerY = (screen.width/2)-w/2;
	window.open('splay.htm', 'cadastro', 'width='+w+', height='+h+',top='+centerX+', left='+centerY+'');
}

// ******************************************************************

function resizeThumb()
{
	// Checka o browser e calcula o tamanho da tela
	var isNetscape = navigator.appName=="Netscape";
	if (isNetscape) 
	{
		w = window.innerWidth
		h = window.innerHeight
	} 
	else 
	{
		w = document.body.clientWidth
		h = document.body.clientHeight
	}
	
	img = document.getElementById('imagem')
	// Faz o calculo de resize da imagem
	indexWidth = Math.round((100*w)/document.images[0].width)
	indexHeight = Math.round((100*h)/document.images[0].height)
	// indexa a referencia
	ref = indexWidth < indexHeight ? "Width" : "Height"
	
	// Não faiz o resize qnd a referencia é menor que o tamanho da tela
	if(this["index"+ref] < 100)
	{
		img[ref.toLowerCase()] = Math.round((img[ref.toLowerCase()]*this["index"+ref])/100)-1
	}
}

// ******************************************************************

// ******************************************************************

function redimencionar()
{

var largura=opener.screen.width;
var altura=opener.screen.height;

	if (navigator.appName == 'Netscape') {
		adjWidth = document.images[0].width;
		adjHeight = document.images[0].height;
	} 
	else 
	{
		adjWidth = document.images[0].width;
		adjHeight = document.images[0].height;
	}

	if(adjHeight>altura-20)
	{
		adjHeight=altura-50;
	}

    self.resizeTo(adjWidth, adjHeight);

	if(window.screen)
	{
		per_ancho=(adjWidth/screen.width)*100;
		per_alto=(adjHeight/adjWidth)*100;
		win_ancho=(screen.width*per_ancho)/100;
		win_alto=(win_ancho*per_alto)/100;
		x=(screen.width-win_ancho)/2;
		y=(screen.height-win_alto)/2;
	}
	else
	{
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	 return	
	}
	
 	self.moveTo(x,y);
	window.focus()
}
