// Called from the all latino feed articles
// to place the editorial image into the 
// the article above the more links
// if the article image is not present
function showArticleImage()
{
	try
	{
		if ( (document == null) || (document.getElementById == null) ) 
		{
			return;
		}

		var prvFlag; // preview flag
		var edtImg; // editorial image
		var artImg; // article image
		var artImgTag; // article image tag
		var imgBase; // image base url
		var imgBaseUrl;//

		edtImg = document.getElementById('editorialimage');
		artImg = document.getElementById('articleimage');
		imgBase 	= document.getElementById('imagebase');
		imgBaseUrl = "";

		if (imgBase != null)
		{
			imgBaseUrl = imgBase.value;
		}

	
		if (edtImg == null)
		{
			return;
		}
		edtImg.style.display = "none";

		if (artImg != null)
		{
			artImgTag = artImg.getElementsByTagName("IMG");

			// if no article image
			if (artImg.innerHTML == "")
			{
				artImg.innerHTML = edtImg.innerHTML;
			}

			// if image src has only base url
			if (artImgTag[0] != null)
			{
				if (artImgTag[0].src == imgBaseUrl )		
				{
					artImg.innerHTML = edtImg.innerHTML;
				}	
			}
			
			artImg.style.display = "block";
			
		}
	}
	catch(e)
	{
	}


}


function main()
{

	H_URL_BASE="http://help.msn.com/es_us";
	H_APP="MSN.com";
	H_CONFIG="msn_msncomv9.ini";
	H_BURL="http://latino.msn.com/fs.htm";
	H_TOPIC="";
	L_H_APP=H_APP;
	bSearch=false;

}


function logoImg(s)
{
	document.write("<img border=\"0\" width=\"118\" height=\"35\" src=\""+s+"/global/c/lg/latino-msn-com.gif\" alt=\"Ir a Latino.msn.com\" title=\"Ir a Latino.msn.com\"/>");
}

main()

//Pup Under Ad for Homepage
function PopupHomeLbaAd()
{
document.writeln('<'+'script Language="JavaScript" src="http://popup.msn.com/lbpopupad.asp?PG=ESUAB5&MSID='+getMSID()+'"></'+'script'+'>');
}


//Pup Under Ad for Autos/Web UI
function PopupAutosLbaAd()
{
document.writeln('<'+'script Language="JavaScript" src="http://popup.msn.com/lbpopupad.asp?PG=ESUL30&MSID='+getMSID()+'"></'+'script'+'>');
}

//Pup Under Ad for Entertainment
function PopupEntLbaAd()
{
document.writeln('<'+'script Language="JavaScript" src="http://popup.msn.com/lbpopupad.asp?PG=ESUL32&MSID='+getMSID()+'"></'+'script'+'>');
}

//Sets the users homepage
function MakeHomePage(sUrl)
{	
	// For Tracking clicks
	var gImg;
	gImg = new Image();
	gImg.src = "http://g.msn.com/US3/1?http://sc.msn.com/c/latino/clearpixel.gif&&DI=2585&PI=70709&PS=10274&CM=Make_this_my_home_page&HL=Make_this_my_home_page"
	
	if (window.external)
	{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(sUrl);
	}
	else
	{
		DoHelp();
	}
}

// Code from zone.com to launch games
function launch_cubis_es()
{
	OpenWindow(g_HttpMode + g_ZoneServer + "/en/cubis/es_game.htm", "spg", "cubis_es", "", "");
}

function launch_bejeweled_es()
{
	OpenWindow(g_HttpMode + g_ZoneServer + "/en/bejeweled/es_game.htm", "spg", "bejeweled_es", "", "");
}

function launch_solitaire_es()
{
	OpenWindow(g_HttpMode + g_ZoneServer + "/en/solitaire/es_game.htm", "spg", "solitaire_es", "", "");
}
function launch_zuma_es()
{
	OpenWindow(g_HttpMode + g_ZoneServer + "/en/zuma/es_game.htm", "spg", "zuma_es", "", "");
}

var g_HttpMode = "http://";var g_HttpSecureMode = "http://";var g_CookieDomain = "zone.msn.com";var g_ZoneServer = "zone.msn.com";var g_ZoneClassicServer = "classic.zone.msn.com";var g_ZonePlayerPop = "182,539";var g_AccountName = "";var g_IsGuest = false;var g_ShowBig7 = true;var g_WebTV = false;var g_ZHCurrentTab =1;var g_TestNoFlash=false;

function OpenWindow(strURL,winType,winName,winWidth,winHeight)
{
	var objWindow,blnlongcall=false,winHeightBrowserShell=0;
	switch(winType)
	{
		case "customsize":
			blnlongcall=true;
			winHeightBrowseShell=50;
			break;
		case "spg":
			winWidth=800,winHeight=510,blnlongcall=true;
			winHeightBrowserShell=50;
			break;
		case "sweeps":
			winWidth=550,winHeight=500,blnlongcall=true;
			winHeightBrowserShell=50;
			break;
		default:
			objWindow=window.open(strURL);
			return;
	}

	//center window
	var screenMarginL=0;
	var screenMarginTop=0;
	if(winWidth>0 && winHeight>0)
	{
		screenMarginL=(screen.width - winWidth)/2;
		screenMarginTop=(screen.height - winHeight - winHeightBrowserShell)/2;
	}

	if(blnlongcall==true)
		window.open(strURL,winName,'width='+winWidth+',height='+winHeight+',left=' + screenMarginL + ',top=' + screenMarginTop + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no');
	else
		objWindow=window.open(strURL,winName,'scrollbars,resizable,width='+winWidth+',height='+winHeight+',left=' + screenMarginL + ',top=' + screenMarginTop);
}

function TestForOpener()
{

}

function ManageWindows(strURL, useWinParent, closeWinCurrent)
{
	if(useWinParent=="true")
	{
		var navDone=false;
		if(typeof(window.opener)=="object")
		{
			try
			{
			  window.opener.TestForOpener();
			  window.opener.location.href=strURL;
			  navDone=true;
			}
			catch(e)
			{
			  // .TestForOpener failed so must launch new window	
			}
		}
		if(!navDone)
		{
			OpenWindow(strURL, "", "", "", "");
		}
	}
	else
	{
		this.location.href=strURL;
	}


	if(closeWinCurrent=="true")
	{
		window.close();
	}
}

