﻿function mostrar(objeto)
    {
    var obj=document.getElementById(objeto)
    if (obj.style.display=="none")
        obj.style.display="inline"
    else    
        obj.style.display="none"
    }
    
    
function modalDialogShow_IE(url,width,height) //IE
		{
			return window.showModalDialog(url,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
		}
function modalDialogShow_Moz(url,width,height) //Moz
		{
			var left = screen.availWidth/2 - width/2;
			var top = screen.availHeight/2 - height/2;
			activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
			window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
		}
var sActiveAssetInput;
		
function setAssetValue(v) //required by the asset manager
		{
		    document.getElementById(sActiveAssetInput).value = v;
		}
		
function openAsset(s)
		{
			sActiveAssetInput = s
			if(navigator.appName.indexOf('Microsoft')!=-1)
				document.getElementById(sActiveAssetInput).value=modalDialogShow_IE("../Editor/assetmanager/assetmanager.aspx",640,465); //IE	
			else
				modalDialogShow_Moz("../Editor/assetmanager/assetmanager.aspx",640,465); //Moz	
		}		

function isEmail (s)
{
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@"))
{ i++
}

if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;

while ((i < sLength) && (s.charAt(i) != "."))
{ i++
}

if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}    