function getObj(sName){
	if (document.getElementById)
		return document.getElementById(sName);
	else if (document.all)
		return document.all[sName];
	else if (document.layers)
		return document.layers[sName];
	else
		return false;
}


var Request = {
	QueryString: function (sVariavel){
		var aQueryString = new Array();
		var sQueryString = location.search.replace(/\x3F/,'').replace(/\x2B/g,' ').split('&');
	
		if (sQueryString != ''){
			for (var iCount=0; iCount<sQueryString.length; iCount++){
				var iVars = sQueryString[iCount].split('=')
				aQueryString[iVars[0]] = unescape(iVars[1])
	
				if (aQueryString[iVars[0]] == sVariavel)
					break;
			}
		}
		return aQueryString[sVariavel]
	}
};


function achaResolucao(){
	if (document.getElementById('swf_site') != null){
		var iWidth = document.documentElement.scrollWidth;
		var iHeight = document.documentElement.scrollHeight;

		// FIREFOX
		if (navigator.userAgent.indexOf('MSIE') == -1){
			iWidth = document.body.scrollWidth;
			iHeight = document.body.scrollHeight;
		}

		if (iWidth <= 778)
			document.getElementById('swf_site').width = '778';
		else
			document.getElementById('swf_site').width = '100%';

		if (iHeight <= 430)
			document.getElementById('swf_site').height = '430';
		else
			document.getElementById('swf_site').height = '100%';
	}
}


function redimencionaPop(){
	var iPosX, iPosY;
	var iWidth = parseInt(document.all.imgDetalhe.width);
	var iHeight = parseInt(document.all.imgDetalhe.height);

	if (iWidth >= window.screen.width || iHeight >= window.screen.height){
		iWidth = window.screen.width - 100;
		iHeight = window.screen.height - 150;
	}

	iWidth += 30 + 20;
	iHeight += 30 + 50;

	iPosX = (window.screen.width - iWidth - 16) / 2;
	iPosY = (window.screen.height - iHeight) / 2;

	window.moveTo(iPosX,iPosY);
	window.resizeTo(iWidth, iHeight);
}


function abrePopWallpaper(sWall,iIdioma){
	if ((typeof(iIdioma)).indexOf('undefined') > -1)
		iIdioma = 0;

	var iLargura = 684;
	var iAltura = 526;
	var iPosX = (window.screen.width - iLargura - 16) / 2;
	var iPosY = (window.screen.height - iAltura) / 2;

	var wPop = window.open('popWallpaper.htm?ARQUIVO=' + sWall + '&IDIOMA=' + parseInt(iIdioma),'DumondWallpaper','width=' + iLargura + ',height=' + iAltura + ',top=' + iPosY + ',left=' + iPosX + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=no');
		wPop.focus();
}


function mostraIdioma(iIdioma){
	if (iIdioma == 0)
		getObj('tdDescritivo').innerHTML = '1- Clique na imagem abaixo com o bot&atilde;o direito do mouse e selecione<br/>&quot;Definir como plano de fundo&quot; ou &quot;Set as Wallpaper&quot;.<br/><br/>2- Pronto, seu wallpaper j&aacute; est&aacute; exposto na sua &aacute;rea de trabalho.';
	else if (iIdioma == 1)
		getObj('tdDescritivo').innerHTML = '- Right-click the image and choose &quot;Set as Wallpaper&quot; or &quot;Set as Background&quot;.<br/><br/>';
	else
		getObj('tdDescritivo').innerHTML = '- Haga Clic en la imagen para bajar un papel de pared DUMOND para su área de trabajo.<br/><br/>';

}


function abrePopClipping(sImagem){
	var iLargura = 500;
	var iAltura = 500;
	var iPosX = (window.screen.width - iLargura - 16) / 2;
	var iPosY = (window.screen.height - iAltura) / 2;

	var wPop = window.open('popClipping.htm?ARQUIVO=' + sImagem,'DumondClipping','width=' + iLargura + ',height=' + iAltura + ',top=' + iPosY + ',left=' + iPosX + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');
		wPop.focus();
}


function abrePopColecao(sImagem){
	var iLargura = 500;
	var iAltura = 500;
	var iPosX = (window.screen.width - iLargura - 16) / 2;
	var iPosY = (window.screen.height - iAltura) / 2;

	var wPop = window.open('popColecao.htm?ARQUIVO=' + sImagem,'DumondColecao','width=' + iLargura + ',height=' + iAltura + ',top=' + iPosY + ',left=' + iPosX + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');
		wPop.focus();
}

function abrePopLojas(){
	var iLargura = 400;
	var iAltura = 300;
	var iPosX = (window.screen.width - iLargura - 16) / 2;
	var iPosY = (window.screen.height - iAltura) / 2;

	var wPop = window.open('popLojas.htm','DumondLojas','width=' + iLargura + ',height=' + iAltura + ',top=' + iPosY + ',left=' + iPosX + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=no');
		wPop.focus();
}


function geraStat(sStats){
	if (!((typeof(_gat)).indexOf('undefined') > -1) && (typeof(_gat)).indexOf('object') > -1){
		var pageTracker = _gat._getTracker('UA-1734234-8');
			pageTracker._initData();	
			pageTracker._trackPageview(sStats);
	}
}





function abrePopVerao(){
	var iLargura = 610;
	var iAltura = 728;
	var iPosX = (window.screen.width - iLargura - 16) / 2;
	var iPosY = (window.screen.height - iAltura) / 2;

	var wPop = window.open('popAltoVerao.htm','DumondLojas','width=' + iLargura + ',height=' + iAltura + ',top=' + iPosY + ',left=' + iPosX + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');
		wPop.focus();
}





