
//Copyright (c), 2001, Innovagency

NS=(document.layers && !document.all)?1:0
NS6=(document.getElementById && !document.all)?1:0


function ChangeImage(obj, ImageUrl)
{
	obj.src = ImageUrl;
}

function ChangeHiLoImage(obj)
{
	//obj.style.cursor = "hand";
	var ImgFile = obj.src;
	var ImgResol = ImgFile.substring(ImgFile.length -7, ImgFile.length -4)
	var ImgType = ImgFile.substring(ImgFile.length -3, ImgFile.length)
	var NewImgFile = "";
	//alert(ImgResol);
	if (ImgResol == "_hi")
		NewImgFile = ImgFile.substring(0, ImgFile.length -7) + "_lo." + ImgType;// + ImgFile.substring(ImgFile.length -4, ImgFile.length);
	else
		NewImgFile = ImgFile.substring(0, ImgFile.length -7) + "_hi." + ImgType;// + ImgFile.substring(ImgFile.length -4, ImgFile.length);
	
	obj.src = NewImgFile;
}

//******************************
// Popups normais
//******************************
function popupFlash() {
	var popWin;

	popWin = window.open( 'http://ecological.innovagency.com/presentationlayer/resourcesuser/swf/main_GB.html', 'PopUp','top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=800,height=500,');
}

function SimplePopUp( sUrl_IN ) {
	var popWin;

	popWin = window.open( sUrl_IN, 'PopUp','top=50,left=50,resizable=1,scrollbars=1,toolbar=0,menubar=0,width=620,height=450,');
}


function PopUpwithDimensions( sUrl_IN, iWidth_IN, iHeight_IN ) {
	var popWin;
//	var winleft = (screen.width - 300) / 2;
//	var wintop = (screen.height - 150) / 2;

//	popWin = window.open( sUrl_IN, 'PopUpNavigator','left=' + winleft + ',top=' + wintop + ',resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
// 2003-05-08 TN
	//popWin = window.open( sUrl_IN, 'PopUpNavigator','top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
	popWin = window.open( sUrl_IN, '','top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
}

function PopUpwithDimensionsScroll( sUrl_IN, iWidth_IN, iHeight_IN ) {
	var popWin;
//	var winleft = (screen.width - 300) / 2;
//	var wintop = (screen.height - 150) / 2;

//	popWin = window.open( sUrl_IN, 'PopUpNavigator','left=' + winleft + ',top=' + wintop + ',resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
// 2003-05-08 TN
	//popWin = window.open( sUrl_IN, 'PopUpNavigator','top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
	popWin = window.open( sUrl_IN, '','top=50,left=50,resizable=0,scrollbars=1,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
}

function PopUpSamewithDimensions( sName_IN, sUrl_IN, iWidth_IN, iHeight_IN ) {
	var popWin;
//	var winleft = (screen.width - 300) / 2;
//	var wintop = (screen.height - 150) / 2;

//	popWin = window.open( sUrl_IN, 'PopUpNavigator','left=' + winleft + ',top=' + wintop + ',resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
// 2003-05-08 TN
	//popWin = window.open( sUrl_IN, 'PopUpNavigator','top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
	popWin = window.open( sUrl_IN, sName_IN,'top=50,left=50,resizable=1,scrollbars=0,toolbar=0,menubar=0,width=' + iWidth_IN + ',height=' + iHeight_IN + ',');
}

function PopUpAndPrint( sUrl_IN ) {
	var popWin;
	popWin = window.open( sUrl_IN, 'Print','resizable=1,scrollbars=1,toolbar=0,menubar=0,width=813,');
	popWin.print();
}

function ChangeTextColor(obj, pColor)
{
	obj.style.color = pColor;
}

function HiddeMenuFilho()
{
	objDiv = document.getElementById("divsubmenu");
	objDiv.style.visibility = "hidden";
}

function SelectLanguage(iLinguaID)
{
	var sURL = window.document.location.href;
	if (iLinguaID != '' || iLinguaID != '0')
	{
		if (sURL.indexOf('?piLinguaID=') != -1)
		{
			sURL = sURL.substr(0, sURL.indexOf('?piLinguaID='));
			window.document.location.href = sURL + "?piLinguaID=" + iLinguaID;
		}
		else if (sURL.indexOf('&piLinguaID=') != -1)
		{
			sURL = sURL.substr(0, sURL.indexOf('&piLinguaID='));
			window.document.location.href = sURL + "&piLinguaID=" + iLinguaID;
		}
		else
		{
			if (sURL.indexOf('?') != -1)
				window.document.location.href = sURL + "&piLinguaID=" + iLinguaID;
			else
				window.document.location.href = sURL + "?piLinguaID=" + iLinguaID;
		}
			
	}
}

