//////////////////////////////////////////////////////////////////////
// Direitos Autorais sobre: mwe_02.js
//
// Este banco de funções é protegido pela lei de direitos autorais
// e marcas internacionais. A reprodução ou distribuição não autorizada,
// ou qualquer parte dele, resultará na imposição de rigorosas penas
// civis e criminais e os infratores serão objeto de ação judicial
// promovida na máxima extensão possível nos termos da lei.
//
// © Copyright 2005, MWE Systems Ltda.
// Todos os direitos reservados. (All rights reserved.)
//////////////////////////////////////////////////////////////////////
//
// AVISO
//
// Este arquivo é monitorado.
// Qualquer tentativa de cópia ou acesso externo será rastreada.
// O infrator será objeto de ação judicial com base na lei de direitos
// autorais.
//
//////////////////////////////////////////////////////////////////////

var nredicaoatual=750;
var dataedicaoatual="22 junho";

function startcolorbar()
{
	scrollBar("#444444","#000000");
/*	if(document.all)
	{
		scrollBar("#333333","#000000");
		document.onmousemove=onscreen;
	}

	document.onmouseout=offscreen;*/
}

/*function onscreen()
{
	colorBar("#f26f2f","#000000","#333333","#000000");
}

function offscreen()
{
	scrollBar("#333333","#000000");
}*/

function MM_preloadImages()
{
	var d=document;

	if(d.images)
	{
		if(!d.MM_p)
			d.MM_p=new Array();

		var i, j=d.MM_p.length, a=MM_preloadImages.arguments;

		for(var i=0; i < a.length; i++)
			if(a[i].indexOf("#") != 0)
			{
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

function edicaoatual()
{
	document.writeln("Ano XV - Edi&ccedil;&atilde;o "+String(nredicaoatual)+" - "+dataedicaoatual);
}

function copyright()
{
	document.writeln("&copy; Copyright 2006-"+Date_Get_Year()+" &Eacute;DICA Editora Cachoeirinha Ltda. Todos os direitos reservados.");
}

function hoje()
{
	document.writeln("<b>Cachoeirinha</b>, "+Date_Get_DayOfWeek().toLowerCase()+", "+Date_Get_Day()+" de "+Date_Get_Month()+" de "+Date_Get_Year());
}

function getlang()
{
	var lang=window.location.pathname;
	lang=lang.substring(1,3);
	return ((window.location.protocol=="http:") ? lang : "pt");
}


//////////////////////////////////////////////////////////////////////
// Menus

function menu(path, id_ative)
{
	var menu_total=0;
	menu=new StringArray(menu_total);

	// Item: Capa
	var menu_item=0;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="Capa";
	menu[menu_item][1]="Voltar &agrave; capa";
	menu[menu_item][2]=path+"capa.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;
	// Item: Empresa
	menu_item=1;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="O Jornal";
	menu[menu_item][1]="Conhe&ccedil;a um pouco mais o jornal";
	menu[menu_item][2]=path+"jornal/index.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;
	// Item: Contato
	menu_item=2;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="Fale Conosco";
	menu[menu_item][1]="Entre em contato conosco";
	menu[menu_item][2]=path+"contato/index.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;

	// Montagem do menu
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"19\" background=\""+path+"images/menu_bg.gif\">");
	document.writeln("<tr>");
	document.writeln("<td width=\"1\"><img border=\"0\" src=\""+path+"images/menu_sep.gif\" width=\"1\" height=\"19\"></td>");

	var size=((778-(menu_total+1))-(100*menu_total)) / 2;
	document.writeln("<td width=\""+size+"\"></td>");
	document.writeln("<td width=\"1\"><img border=\"0\" src=\""+path+"images/menu_sep.gif\" width=\"1\" height=\"19\"></td>");

	var menu_width=1;
	for(var i=0; i < menu_total; i++)
	{
		document.writeln("<td valign=\"middle\" align=\"center\" width=\"100\">");
		menu_width+=90;

		if(menu[i][3])
			document.writeln("<font class=\"menutopoff\">"+menu[i][0]+"<br></font>");
		else
		{
			document.writeln("<a id=\"menu"+i+"\" href=\""+menu[i][2]+"\"");
			document.writeln(" onmouseover=\"showlink('menu"+i+"','#ffffff',false);return setstatus('"+menu[i][1]+"')\"");
			document.writeln(" onmouseout=\"showlink('menu"+i+"','#ffffff',false);clearstatus()\"");
			document.writeln("><font class=\"menutopon\">"+menu[i][0]+"<br></font></a>");
			showlink("menu"+i,"#ffffff",false);
		}

		document.writeln("</td>");
		document.writeln("<td width=\"1\"><img border=\"0\" src=\""+path+"images/menu_sep.gif\" width=\"1\" height=\"19\"></td>");
		menu_width+=1;
	}

	document.writeln("<td width=\""+size+"\"></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
}

function menusuperioresquerdo(path, id_ative)
{
	var menu_total=0;
	menu=new StringArray(menu_total);

	// Item: Edições anteriores
	var menu_item=0;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="Edi&ccedil;&otilde;es anteriores";
	menu[menu_item][1]="Ver edi&ccedil;&otilde;es anteriores";
	menu[menu_item][2]=path+"edicoes/index.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;
	// Item: Links
	menu_item=1;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="Links";
	menu[menu_item][1]="Links";
	menu[menu_item][2]=path+"links/index.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;

	// Montagem do menu
	document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"135\">");

	for(var i=0; i < menu_total; i++)
	{
		if(menu[i][3])
		{
			document.writeln("<tr style=\"cursor='default'\">");
			document.writeln("<td width=\"10%\" height=\"19\" align=\"center\" bgcolor=\"#E7E7E7\"><img src=\""+path+"images/arrow_right.gif\"></td>");
			document.writeln("<td width=\"90%\" height=\"19\" bgcolor=\"#E7E7E7\">");
			document.writeln("<font class=\"menusuperioresquerdo\">"+menu[i][0]+"<br></font>");
			document.writeln("</td></tr>");
		}
		else
		{
			document.writeln("<tr onmouseover=\"this.style.cursor='hand';setstatus('"+menu[i][1]+"')\" onmouseout=\"this.style.cursor='default';clearstatus()\" onclick=\"window.location='"+menu[i][2]+"'\">");
			document.writeln("<td width=\"10%\" height=\"19\" align=\"center\" bgcolor=\"#E7E7E7\"><img src=\""+path+"images/arrow_right.gif\"></td>");
			document.writeln("<td width=\"90%\" height=\"19\" bgcolor=\"#E7E7E7\">");
			document.writeln("<font class=\"menusuperioresquerdo\">"+menu[i][0]+"<br></font>");
			document.writeln("</td></tr>");
		}

		document.writeln("<tr><td bgcolor=\"#D4D4D4\" width=\"100%\" height=\"1\" colspan=\"2\"></td></tr>");
	}

	document.writeln("</table>");
}

function menusuperiordireito(path, id_ative)
{
	var menu_total=0;
	menu=new StringArray(menu_total);

	// Item: Outras capas
	var menu_item=0;
	menu[menu_item]=new Array(4);
	menu[menu_item][0]="Outras capas";
	menu[menu_item][1]="Ver outras capas";
	menu[menu_item][2]=path+"capas/index.htm";
	menu[menu_item][3]=(id_ative==menu_item);
	menu_total++;

	// Montagem do menu
	document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"145\">");
	document.writeln("<tr><td bgcolor=\"#D4D4D4\" width=\"100%\" height=\"1\" colspan=\"2\"></td></tr>");

	for(var i=0; i < menu_total; i++)
	{
		if(menu[i][3])
		{
			document.writeln("<tr style=\"cursor='default'\">");
			document.writeln("<td width=\"10%\" height=\"19\" align=\"center\" bgcolor=\"#E7E7E7\"><img src=\""+path+"images/arrow_right.gif\"></td>");
			document.writeln("<td width=\"90%\" height=\"19\" bgcolor=\"#E7E7E7\">");
			document.writeln("<font class=\"menusuperiordireito\">"+menu[i][0]+"<br></font>");
			document.writeln("</td></tr>");
		}
		else
		{
			document.writeln("<tr onmouseover=\"this.style.cursor='hand';setstatus('"+menu[i][1]+"')\" onmouseout=\"this.style.cursor='default';clearstatus()\" onclick=\"window.location='"+menu[i][2]+"'\">");
			document.writeln("<td width=\"10%\" height=\"19\" align=\"center\" bgcolor=\"#E7E7E7\"><img src=\""+path+"images/arrow_right.gif\"></td>");
			document.writeln("<td width=\"90%\" height=\"19\" bgcolor=\"#E7E7E7\">");
			document.writeln("<font class=\"menusuperiordireito\">"+menu[i][0]+"<br></font>");
			document.writeln("</td></tr>");
		}

		document.writeln("<tr><td bgcolor=\"#D4D4D4\" width=\"100%\" height=\"1\" colspan=\"2\"></td></tr>");
	}

	document.writeln("</table>");
}


//////////////////////////////////////////////////////////////////////
// Imagem apliada

function openview()
{
	var passed=window.location.search;
	passed=passed.substring(1,passed.length);

	var id=passed.substring(3,passed.indexOf("&",-1));
	passed=passed.substring(passed.indexOf("&",-1)+1,passed.length);

	var lg=ReplaceString(passed.substring(3,passed.length), "%20", " ");

	document.writeln("<center>");
	document.writeln("<table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">");
	document.writeln("<tr><td width=\"100%\" align=\"center\">");
	document.writeln("<img src=\"images/edicoes/"+id+".jpg\">");
	document.writeln("</td></tr>");
	if(lg!="")
	{
		document.writeln("<tr><td width=\"100%\" align=\"center\">");
		document.writeln("<font class=\"corpo\">");
		document.writeln(lg);
		document.writeln("</font>");
		document.writeln("</td></tr>");
	}
	document.writeln("</table>");
	document.writeln("</center>");
}

