/* 
	SPHE JS General
	© 2010 IntelyGenZ - www.intelygenz.com 
    version 1.04 [16.06.2010]
    
    [VER] 	 sphe_js.txt
*/

oIGZ.f_require ("i_marray");

var oSWF = new SWFObject("pix/swf/menu_sup.swf","menusup","814","28","8","#FFFFFF");
var sAlternateFlashText = "<B>No tienes instalada la última versión del player de flash.</B><BR />Para ver el contenido de esta página, te recomendamos que actualices dicha versión en el siguiente sitio:<BR /><A href=https://www.macromedia.com/go/getflash/>Descargar</A>";

var g_maMenuSup = new MArray(['Seccion','Nombre','Enlace','Target']
	,[
	 ['inicio','inicio',oIGZ.m_sRootPath+'index.html','']
	,['busqueda','búsqueda',oIGZ.m_sRootPath+'busqueda_av.asp','']
	,['contacta','contáctenos',oIGZ.m_sRootPath+'contacta.html','']
	,['cines','ahora en cines','http://www.sonypicturesreleasing.es/','_blank']
	]
)

var g_maAudioFormato = new MArray(['Tipo','Valor']
	,[
	 ['Mono','a']
	,['Estereo','b']
	,['Surround','c']
	,['4.0','e']
	,['5.1','d']
	,['5.1 EX','f']
	,['5.1 DTS','g']
	,['5.1 DTS-HD','m']
	,['5.1 PCM','i']
	,['7.1 PCM','j']
	,['Dolby Surround','h']
	,['Dolby Digital','l']
	,['Dolby TrueHD 5.1','k']
	]
)

var a_sExtrasDVD = Array (
	 "Trailers","Trailers promocionales"
	,"Trailerdecine","Trailer de cine"
	,"Comentarios","Comentarios"
	,"Escenasnuncavistas","Escenas nunca vistas"
	,"Bandasonora","Banda sonora"
	,"AudioComentarios","Audio Comentarios"
	,"Comosehizo","Cómo se hizo"
	,"Filmografias","Filmografías"
	,"Fichatecnica","Ficha técnica"
	,"Documentales","Documentales"
	,"Salvapantallas","Salvapantallas"
	,"Animaciondemenus","Animación de menús"
	,"Localizaciones","Localizaciones"
	,"Notasdeproduccion","Notas de Producción"
	,"GaleriaFotografica","Galería Fotográfica"
	,"Entrevistas","Entrevistas"
	,"EnlacesWeb","Enlaces a Contenidos Web"
	,"DVDROM","Contenidos DVD-ROM"
	,"FinalAlternativo","Final Alternativo"
	,"SpotsTV","Spots de Televisión"
	,"VideoClips","Videoclips Musicales"
	,"Discos","Número de Discos"
	,"Observaciones","Observaciones"
	,"BluWizard","Blu-Wizard"
	,"BDLive","BD Live"
)



// ITEMS GENERICOS DEL WEB

if ( typeof(oIGZ)!="undefined" && oIGZ.f_checkLib("i_gfx", 0.185) ) {
	oIGZ.m_maItems = [["nType", 	"sTagName"		, "sSrcOrValue"			       , 	"sClassName", "nSizeX", "nSizeY", "sXtraAbs"]
		 ,[
		  	     1, 	"TABLAS_ORDEN"	, "pix/iconos/orden<OBJ>nOrden</OBJ>.gif"  ,           	  "",		 11,	   11, 	   	  ""
		  ,	     1, 	"LOADING_ICO"	, "pix/iconos/xbd_loading.gif"             ,			  "", 	     32, 	   32,		  ""
		  ,	     1, 	"XBD_LOADING"	, "pix/iconos/xbd_loading.gif"             ,			  "", 	     32, 	   32,		  ""
		  ,	     1, 	"XBD_OK"		, "pix/iconos/xbd_save.gif"           	   ,			  "", 	     24, 	   24,		  ""
		  ,	     1, 	"WIN_ICO"		, "pix/iconos/winshield/win_icono.gif"     ,			  "", 	     76, 	   25,		  ""
		  ,	     1, 	"WIN_CLOSE"		, "pix/iconos/winshield/close.gif"    ,		 	  "", 	     16, 	   16,		  ""
		  ,	     1, 	"FL_CAJAS"		, "pix/2007/flecha_cajas.gif"    			,		 	  "", 	     19, 	   18,		  " align='absmiddle'"

		  ]
	 ];

	if ( oIGZ.f_checkLib("i_gfx", 0.185) ) {
		oShield.m_sClassNameDIV = "ShieldBGColor"
		oShield.m_sDefaultMSG = oIGZ.f_drawItem("LOADING_ICO");
		if ( oIGZ.f_checkLib("i_exml", 1.216)) {
			var oWinFrame = new IWIN("oWinFrame");
	
			oWinFrame.f_defineTopEXML("<TABLE cellpadding=0 cellspacing=0 border=0'><TR>"
								   +"<TD class='IWinTopLeftIcoBg IWinTopLeftIcoSize' nowrap='nowrap'>&#160;</TD>"
								   +"<TD class='IWinTopBg IWinMSGTit' width='100%'><TITLE /></TD>"
								   +"<TD onclick='oWinFrame.f_close(1)' class='IWinTopCloseBg IWinTopCloseSize' nowrap='nowrap' fh_tit='Cerrar ventana'>"+oIGZ.f_drawItem('WIN_CLOSE')+"</TD>"
								   +"</TR></TABLE>"
							       );
	
			oWinFrame.f_build ("<TABLE cellpadding=0 cellspacing=0 border=0 width=<SIZEX /> >"
							  +"<TR>"
							  +"<TD class='IWinTopLeftBg IWinTopLeftSize' nowrap='nowrap'>&#160;</TD>"
							  +"<TD width='100%'><TOP /></TD>"
							  +"<TD class='IWinTopRightBg IWinTopRightSize' nowrap='nowrap'>&#160;</TD>"
							  +"</TR>"
							  +"<TR>"
							  +"<TD class='IWinMidLeftBg IWinMidLeftSize' nowrap='nowrap'>&#160;</TD>"
							  +"<TD width='100%' style='background: #000;'><BODY /></TD>"
							  +"<TD class='IWinMidRightBg IWinMidRightSize' nowrap='nowrap'>&#160;</TD>"
							  +"</TR>"
							  +"<TR>"
							  +"<TD class='IWinBotLeftBg IWinBotLeftSize' nowrap='nowrap'>&#160;</TD>"
							  +"<TD class='IWinBotBg IWinBotSize' width='100%' nowrap='nowrap'>&#160;</TD>"
							  +"<TD class='IWinBotRightBg IWinBotRightSize' nowrap='nowrap'>&#160;</TD>"
							  +"</TR>"
							  +"</TABLE>"
							  );
		}	
	}	

}


function PrintHeader(sSecActiva) { document.write( DrawHeader(sSecActiva) )} 
function DrawHeader(sSecActiva) {
	var sHTML = ""
		
		var sLogoPath= "";
		if (sSecActiva=="inicio") sLogoPath = "/home";

		sHTML +="<DIV class='logotipo'>"
		sHTML +=	"<A href='"+oIGZ.m_sRootPath+"index.html'><IMG src='"+oIGZ.m_sRootPath+"pix/2010"+sLogoPath+"/logo.gif' alt='Sony Pictures Home Entertainment España' border='0' /></A>"
		sHTML +="</DIV>"
		
		sHTML +="<DIV class='headerOptions'>"
		
		sHTML += DrawMenuSup(sSecActiva);
	
		sHTML +=	"<DIV class='EntradaInet'>"
		sHTML +=		"zona de prensa y clientes <a href='"+oIGZ.m_sRootPath+"clientes/login/login.asp?bFirst=1'>pulsa aquí para acceder</a>"
		sHTML +=	"</DIV>"

		sHTML +="</DIV>"

	return (sHTML)
}

function DrawMenuSup(sSecActiva){
		var sHTML = ""

		sHTML +=	"<DIV id='menuSup'>";
		sHTML +=	"<UL>";

		for (var f=0; f<g_maMenuSup.f_length(); f++){
			var sImgAct = 0; 
			var sClass  = "";

			var sSeccion = g_maMenuSup.f_getVal("Seccion", f);
			var sNombre  = g_maMenuSup.f_getVal("Nombre", f);
			var sEnlace  = g_maMenuSup.f_getVal("Enlace", f);
			var sTarget  = g_maMenuSup.f_getVal("Target", f);

			if (sSeccion==sSecActiva) sClass = " class='msOn'";
			if (sTarget!="") sTarget = " target='"+sTarget+"' "
			
			sHTML +="<LI><A href='"+ sEnlace +"' "+sTarget+" ";
			if (sSeccion!=sSecActiva) sClass="";
			sHTML += " "+ sClass +" ><SPAN>"+ sNombre +"</SPAN></A></LI> ";
		}
		
		sHTML +=	"</UL>";
		sHTML +=	"</DIV>";	
		
		return(sHTML);
}


function PrintFooter(bAdmin) { document.write(DrawFooter(bAdmin)) }
function DrawFooter(bAdmin){
	var sHTML = "";
	var sAnyo = new Date().f_drawFormat("nYYYY");

			sHTML +="<DIV class='footerLinks'>"
			sHTML +=	"<A href='#' onClick='AbrirAvisoLegal();'>Aviso Legal</A> :: "
			if(bAdmin){
				sHTML +=	"<A href='contacto.asp'>Contáctenos</A>"
			} else {
				sHTML +=	"<A href='"+oIGZ.m_sRootPath+"contacta.html'>Contáctenos</A>"
			}
			sHTML +="</DIV>"

			sHTML +="<DIV class='footerCopyRight'>"
			sHTML +=	"&#169; "+sAnyo+" Sony Pictures Home Entertainment España. Todos los derechos reservados."
			sHTML +="</DIV>"

	return (sHTML);
}

function AbrirAvisoLegal(){
	var sURL = oIGZ.m_sRootPath+"aviso_legal.html";
	oWinFrame.f_open("Aviso Legal",sURL, 640, 425, null, null, 1);
}


function AbrirTrailer(nIDPeli,nIDMat,sSeccion,nWidth,nHeight,sTitulo){
	var sURL = oIGZ.m_sRootPath+"trailers_ventana.asp?idPeli="+nIDPeli+"&idMat="+nIDMat+"&seccion="+sSeccion;
	var sTitVentana = "Trailer - "+sTitulo;
	
	if(nWidth==null || nWidth=="") nWidth = 640;
	if(nHeight==null || nHeight=="") nWidth = 425;
	//alert(sURL)
	oWinFrame.f_open(sTitVentana, sURL, nWidth, nHeight, null, null, 1);
}



function DescargarMaterial(oHref,nTipo,nIDPeli,nIDRef,nFotoGal,sOtros){
	var sPeli = "";
	var sRef = ""; 
	var sFotoGal = "";
	var sOtrosMateriales = "";
	
	if (nIDPeli!=undefined) sPeli = "&idPeli="+nIDPeli;
	if (nIDRef!=undefined) sRef = "&idRef="+nIDRef;
	if (nFotoGal!=undefined) sRef = "&nFotoGal="+nFotoGal;
	if (sOtros!=undefined) sRef = "&sOtrosMateriales="+sOtros;
	
	var sUrl = oIGZ.m_sRootPath+"clientes/download.asp?nFichero="+nTipo+sPeli+sRef+sFotoGal+sOtrosMateriales;
//	document.location.href=sUrl;

   oHref.href = sUrl;   
//   this.onclick = "";   
//   oHref.click();

}



// Devuelve un Dato en Concreto de un Array
function PintaDato(maDatos,sCampo) { document.write(DrawDato(maDatos,sCampo)) }
function DrawDato(maDatos,sCampo){
	var sHTML = "", sEXML = "";
		sEXML += " <BD>"+sCampo+"</BD> "
		sHTML += ParseEXMLs (sEXML,"",maDatos,0);
	return (sHTML);
}



/***************************** 
	
	Clientes ... ver lo que se usa... 

******************************/




// Pinta la Carátula Grande de las Fichas  
// -- Referencia(sRef), Array del que lee (maDatos), 
// Si viene de alguna promoción (bPromo)
function PintaCaratula(sRef,maDatos,sFormato,nPromo,bCaratula) { document.write(DrawCaratula(sRef,maDatos,sFormato,nPromo,bCaratula)) }
function DrawCaratula(sRef,maDatos,sFormato,nPromo,bCaratula){
	var sHTML = "", sEXML = ""; sPathCaratPromo = "";

	if (nPromo!="" && bCaratula==1) sPathCaratPromo="promociones/"+nPromocion+"/";

	sHTML += "<IMG src='"+oIGZ.m_sRootPath+"pix/caratulas/"+sPathCaratPromo+sRef+".png' "

	sEXML += " alt=\"<BD>Titulo</BD>\" "

	sHTML += ParseEXMLs (sEXML,"",maDatos,0) + " />"; 

	return (sHTML);
}

// Dibuja el enlace para listar películas Asignadas a un Campo.
function PrintEnlacePelisAsignadas(maDatos,sCampo,sValor) { document.write(DrawEnlacePelisAsignadas(maDatos,sCampo,sValor)) }
function DrawEnlacePelisAsignadas(maDatos,sCampo,sValor){
//	alert(sValor)
	var sHTML = "";
	var sPost = "";
	var sNombre;
	var sDatos	= maDatos.f_maGetVal (sCampo, 0)
	var a_sDato = sDatos.split (",")
	
	for (var f=0;f<a_sDato.length;f++) {
		sNombre = a_sDato[f].f_trim();
		sPost = ", ";
		if (f == a_sDato.length-1) sPost = "";
		sHTML += "<A class='enlace3' href='#' onclick=\'VerListadoAsignadas(\""+sCampo+"\",\""+sNombre+"\")\'>"+ sNombre +"</A>"+sPost;	
		
	}
	return (sHTML);
}

// Envía un Dato al listado de películas (Se usa en ficha.asp para Intérpretes y Director)
function VerListadoAsignadas(sDato,sValor){
	var sCampo = "a_"+sDato;
	sCampo = eval("document.forms.FDatos."+sCampo)
	sCampo.value = sValor
	FDatos.submit();
}


// Pinta el Título de una Pelicula con Campo Edición Especial y Campo Pack si existe.
function PintaTitulo(maDatosPeli,maDatosProducto,nCual) { document.write(DrawTitulo(maDatosPeli,maDatosProducto,nCual)) }
function DrawTitulo(maDatosPeli,maDatosProducto,nCual){
	var sHTML = "", sEXML = "", sEXML2 = "";
	if(nCual==null) nCual = 0;

	sEXML  += "<BD>Titulo</BD>  "
	sEXML2 += " <IF fun='\"<BD>Edicion</BD>\"!=\"\"'>[<BD>Edicion</BD>]</IF> <IF fun='\"<BD>Coleccion</BD>\"==\"Pack\"'>[<BD>Coleccion</BD>]</IF> "

	sHTML += ParseEXMLs (sEXML,"",maDatosPeli,nCual) + ParseEXMLs (sEXML2,"",maDatosProducto,nCual);

	return (sHTML);
}

