// JavaScript Document

/*
	Programación:	Cristián R. Villagra
					CRISTIANVILLAGRA.COM
					cristian@cristianvillagra.com
*/


function saca_imagen(div_id) {
	document.getElementById(div_id).innerHTML = '';
}

function carga_imagen(div_id, archivo, ancho, alto, comentario, idioma) {
	var chtml = '';
	
	cerrar = new Array("Cerrar", "Close");
	
	chtml += '<table border="0" cellpadding="10" cellspacing="0" bgcolor="#42459d">';
	chtml += '<tr><td align="left" valign="top" onmouseover="this.style.cursor = \'hand\'; this.style.background=\'#42459d\';" onmouseout="this.style.background=\'#42459d\'" onclick="saca_imagen(\'' + div_id + '\');" class="small">' + cerrar[idioma] + ' [ x ]</td></tr>';
	chtml += '<tr><td><img src="' + archivo + '" border="0" alt="' +comentario + '"/></td></tr>';
	chtml += '<tr><td valign="top">' + comentario + '</td></tr>';
	//chtml += '<tr><td height="4"></td></tr>';
	chtml += '</table>';	

	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  //winW = window.innerWidth;
	  winW = document.documentElement.clientWidth;
	  winH = document.documentElement.clientHeight;
	 }
	}
	

	document.getElementById(div_id).innerHTML = chtml;	
	document.getElementById(div_id).style.left = ((winW-ancho)/2) + "px";
	document.getElementById(div_id).style.top = 140 + "px";
		
	//alert(archivo + " Screen: " + winW + "x" + winH + "\nImage: " + ancho + "x" + alto);
	
}

function carga_video(div_id, archivo, ancho, alto, comentario, idioma) {
	var chtml = '';
	
	cerrar = new Array("Cerrar", "Close");
	
	chtml += '<table border="0" cellpadding="10" cellspacing="0" bgcolor="#42459d">';
	chtml += '<tr><td align="left" valign="top" onmouseover="this.style.cursor = \'hand\'; this.style.background=\'#42459d\';" onmouseout="this.style.background=\'#42459d\'" onclick="saca_imagen(\'' + div_id + '\');" class="small">' + cerrar[idioma] + ' [ x ]</td></tr>';
	chtml += '<tr><td>';
	
	//<script type="text/javascript">
	//AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width',ancho,'height',alto,'id','FLVPlayer','src','FLVPlayer_Progressive','flashvars','&MM_ComponentVersion=1&skinName=Corona_Skin_3&streamName=' + archivo + '&autoPlay=true&autoRewind=true','quality','high','scale','noscale','name','FLVPlayer','salign','lt','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','FLVPlayer_Progressive' ); //end AC code

	chtml += '	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + ancho + '" height="' + alto + '" id="FLVPlayer">';
	chtml += '	  <param name="movie" value="FLVPlayer_Progressive.swf" />';
	chtml += '	  <param name="salign" value="lt" />';
	chtml += '	  <param name="quality" value="high" />';
	chtml += '	  <param name="scale" value="noscale" />';
	chtml += '	  <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Corona_Skin_3&streamName=' + archivo + '&autoPlay=true&autoRewind=true" />';
	chtml += '	  <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Corona_Skin_3&streamName=' + archivo + '&autoPlay=true&autoRewind=true" quality="high" scale="noscale" width="' + ancho + '" height="' + alto + '" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" />';
	chtml += '	</noscript>';

	chtml += '</td></tr>';
	chtml += '<tr><td valign="top">' + comentario + '</td></tr>';
	//chtml += '<tr><td height="4"></td></tr>';
	chtml += '</table>';

	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  //winW = window.innerWidth;
	  winW = document.documentElement.clientWidth;
	  winH = document.documentElement.clientHeight;
	 }
	}
	

	document.getElementById(div_id).innerHTML = chtml;	
	document.getElementById(div_id).style.left = ((winW-ancho)/2) + "px";
	document.getElementById(div_id).style.top = 140 + "px";
		
	//alert(archivo + " Screen: " + winW + "x" + winH + "\nImage: " + ancho + "x" + alto);
	
}
