
function adultContent()
{
	if((document.location.href.toString().toLowerCase().indexOf("adulto") > 1) || (document.location.href.toString().toLowerCase().indexOf("sexo") > 1) || (document.location.href.toString().toLowerCase().indexOf("playboy") > 1) || (document.location.href.toString().toLowerCase().indexOf("hustler") > 1) || (document.location.href.toString().toLowerCase().indexOf("sexzone") > 1) || (document.location.href.toString().toLowerCase().indexOf("sexy") > 1) || (document.location.href.toString().toLowerCase().indexOf("sexhot") > 1) || (document.location.href.toString().toLowerCase().indexOf("forman") > 1) || (document.location.href.toString().toLowerCase().indexOf("hentai") > 1))
	{
		WU.showAdultDisclamer();
		clearInterval(_iadultContent);
	}
}

var _iadultContent = setInterval(adultContent,999);


function submitLogin()
{
	if(document.getElementById('hLogin') != null && document.forms["Form_Login"].action != null)
	{
		document.getElementById('hLogin').value = 'true';
		document.forms["Form_Login"].action = document.location.href.split('http://').join('https://');
	}
	
	var objdLoginLoad = document.getElementById('dLoginLoad');
	if(objdLoginLoad != null)
	{
		objdLoginLoad.style.display = '';
		document.forms["Form_Login"].style.display = 'none';
	}	
}



function setDefaultAccount()
{
	if(document.forms["Form_Login"] != null)
	{
		var objSelect = document.forms["Form_Login"].getElementsByTagName("select");
		if(objSelect.length > 0)
		{
			objSelect = objSelect[0];
			
			if(objSelect.length > 1)
			{
				var objCookies = document.cookie.split('&');
				var iAccount = 0;
				for(var i = 0; i < objCookies.length; i++)
				{
					if(objCookies[i].toLowerCase().indexOf("accountselected=") > -1)
					{
						iAccount = parseInt(objCookies[i].toLowerCase().replace("accountselected=",''));
						break;
					}
				}
				

				if(iAccount > 0)
				{
					if(objSelect[objSelect.selectedIndex].text != iAccount)
					{
					    try
					    {
					        document.getElementById('dLogin').style.display = 'none';
					    }
					    catch(E)
					    {
					    }
						document.location = document.location;
					}
				}
			}
		}
	}
	
}

function addBreakMenu()
{
	var objSideMenu = document.getElementById('dSideMenu');
	if(objSideMenu != null)
	{
		if(objSideMenu.innerHTML.toLowerCase().indexOf('<li>') > -1 && document.body.innerHTML.toLowerCase().indexOf('cboxred') > -1 && document.location.href.toString().toLowerCase().indexOf('vivasky/') <= -1)
		{
			var iMenuSize = objSideMenu.offsetHeight + 200;
			var objSubContent = document.getElementById('dSubContent');
			if(objSubContent != null )
			{
				if(objSubContent.innerHTML.indexOf('contentextra') <= -1)
				{
					if(objSubContent.offsetHeight > iMenuSize)
					{
						var objDivList = objSideMenu.getElementsByTagName('div');
						if(objDivList.length >= 3)
						{
							for(var i = 0; i < objDivList.length; i++)
							{
								if(objDivList[i].className == 'top')
								{
									objDivList[i].style.background = 'url(../../template/images/bg-menu-top-quebra.gif) no-repeat';
								}
								else
								if(objDivList[i].className == 'down')
								{
									objDivList[i].style.background = 'url(../../template/images/bg-menu-down-quebra.gif) no-repeat';
								}
								else
								if(objDivList[i].className == 'menu')
								{
									objDivList[i].style.background = 'url(../../template/images/bg-menu-linha.gif) repeat-y';
								}
							}
						}
					}
				}
			}
		}
	}
}


function removeBreakMenu()
{
	var objSideMenu = document.getElementById('dSideMenu');
	if(objSideMenu != null)
	{
		if(objSideMenu.innerHTML.toLowerCase().indexOf('<li>') > -1 && document.body.innerHTML.toLowerCase().indexOf('cboxred') > -1)
		{
			var iMenuSize = objSideMenu.offsetHeight + 200;
			var objSubContent = document.getElementById('dSubContent');
			if(objSubContent != null )
			{
				if(objSubContent.innerHTML.indexOf('contentextra') <= -1)
				{
					if(objSubContent.offsetHeight > iMenuSize)
					{
						var objDivList = objSideMenu.getElementsByTagName('div');
						if(objDivList.length >= 3)
						{
							for(var i = 0; i < objDivList.length; i++)
							{
								if(objDivList[i].className == 'top')
								{
									objDivList[i].style.background = '';
								}
								else
								if(objDivList[i].className == 'down')
								{
									objDivList[i].style.background = '';
								}
								else
								if(objDivList[i].className == 'menu')
								{
									objDivList[i].style.background = '';
								}
							}
						}
					}
				}
			}
		}
	}
}

function showWMV(objTarget, wmv, iWidth, iHeight)
{
	objTarget.innerHTML = '<object type="video/x-ms-wmv" data="'+wmv+'" style="display: block; width:'+iWidth+'px; height:'+iHeight+'px;"><param name="src" value="'+wmv+'" /><param name="autostart" value="1" /><param name="controller" value="1" /><param name="ShowControls" value="true" /></object>';
}

function disableForm(){if(document.forms["aspnetForm"] != null){if(document.forms["aspnetForm"].innerHTML.indexOf('__doPostBack',0)>0){PostBackFunction=__doPostBack}__doPostBack=function(a,b){PostBackFunction(a,b);MostrarCarregando()};document.forms["aspnetForm"].onsubmit=function(){iTimer=setInterval(MostrarCarregando,100)}}function MostrarCarregando(){clearInterval(iTimer);for(i=0;i<document.forms["aspnetForm"].elements.length;i++){if(document.forms["aspnetForm"].elements[i]=="[object]"){document.forms["aspnetForm"].elements[i].disabled=true;document.forms["aspnetForm"].elements[i].onfocus=function(){document.body.focus()}}}}}
WU.addListener(window,'load',disableForm);
WU.addListener(window,'load',addBreakMenu);

function cacheBackgroundImages(){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}}WU.addListener(window,'load',cacheBackgroundImages);


function trailer(sTrailerUrl)
{
    WU.showModalContent(document,'trailer','#000000',90,'', 720, 448, false);
    showWMV(document.getElementById('trailermodalContent'),sTrailerUrl,720,448);
}
//var _isetDefaultAccount = setInterval(setDefaultAccount,100);



function sitemap()
{
    var objResize = document.getElementById('dSubContent');
    if(objResize != null)
    {
        if( document.getElementById('dSubContent').onresize== null)
        {
            document.getElementById('dSubContent').onresize = sitemap;
        }
    }
}

function closeCM8()
{
    objDiv = document.getElementById('dCheckM8');
    if(objDiv != null)
    {
        objDiv.parentNode.removeChild(objDiv);
    }
}

function AdicionarBreadCrumb(nome, link) {
    var breadDiv = document.getElementById('dBreadCrumbServer');

    if (breadDiv != null) {
        if ($.trim(breadDiv.innerHTML) != '')
            breadDiv.innerHTML = breadDiv.innerHTML + ' / ';    
            
        breadDiv.innerHTML = breadDiv.innerHTML + '<a href="' + link + '">'+nome+'<a/>';
    }
}
