
function rss() {
	window.open('http://trader.platformtrader.com/rss','');
	//window.open('http://platformtrader.dyndns.ws/rss','');
}
function rssTwitter() { window.open('http://twitter.com/statuses/user_timeline/78934055.rss',''); }
function twitter() { window.open('http://twitter.com/PlatformTrader',''); }
function youtubeChannel() { window.open('http://www.youtube.com/user/platformtrader',''); }

//function redireccionar() { setTimeout("web()", 10000); }
//function web() { location.href = 'http://www.platformtrader.es'; }
function demo() {
	location.href = 'http://www.platformtrader.es/jnlp/datrader.jnlp';
	//location.href = 'updating.html';
}

function notice() { window.open('http://www.iir.es/Documentacion/VotacionesSOA.asp',''); }

/*
 * Recuperamos el parametro 'name' de la url
 */
function gup(name) {
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if (results == null)
		return "";
	else
		return results[1];
}

/*
 * Creamos el codigo html para mostrar un video de YouTube
 */
function youtube(fileName) {
	var srcYouTube = 'http:\/\/www.youtube.com\/v\/'+fileName+'&hl=es_ES&fs=1&rel=0&border=1';
	//var paramSize = 'width="445" height="364"';
	var paramSize = 'width="500" height="405"';
	document.writeln('<object '+paramSize+'>');
	document.writeln('<param name="movie" value="'+srcYouTube+'"><\/param>');
	document.writeln('<param name="allowFullScreen" value="true"><\/param>');
	document.writeln('<param name="allowscriptaccess" value="always"><\/param>');
	document.writeln('<embed src="'+srcYouTube+'" type="application\/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" '+paramSize+'><\/embed>');
	document.writeln('<\/object>');
}

/*
 * Franjas aleatorias para la home y sus enlaces asociados
 */
var franjas = [
	"img/headers/franja_home1.jpg",
	"img/headers/franja_home2.jpg"
];
var enlaces = [
	//"demo.html",
	null,
	"productos_tui.html"
];
function randomPos(a) {
	return Math.floor((Math.random() * a.length) % a.length);
}

/*
 * Creamos el header
 */
function header(imageBackground) {
	document.writeln('<table class="cuerpo_web" border="0" align="center" cellpadding="0" cellspacing="0">\r\n');
	document.writeln('<tr><td>\r\n');
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">\r\n');
	document.writeln('<tr><td height="121" valign="top" background="img\/headers\/'+imageBackground+'.jpg">\r\n');
	document.writeln('<table border="0" align="right" cellspacing="0" cellpadding="4">\r\n');
	document.writeln('<tr>');
	//document.writeln('<td class="language">Ingl&eacute;s - <a href="index.html">Espa&ntilde;ol<\/a> &nbsp;<\/td>\r\n');
	document.writeln('<td><a href="javascript:rss();"><img src="img\/logos\/rss.png" title="Feed RSS"><\/a><\/td>\r\n');
	document.writeln('<td class="rss"><a href="javascript:rss();">Feed RSS<\/a> &nbsp;<\/td>\r\n');
	//document.writeln('<td><a href="javascript:rssTwitter();"><img src="img\/logos\/rss.png" title="Canal RSS de los tweets de PlatformTrader"><\/a><\/td>\r\n');
	//document.writeln('<td class="rss"><a href="javascript:rssTwitter();">@PlatformTrader<\/a> &nbsp;<\/td>\r\n');
	document.writeln('<td><a href="javascript:twitter();"><img src="img\/logos\/twitter.png" title="Twitter"><\/a><\/td>\r\n');
	document.writeln('<td class="twitter"><a href="javascript:twitter();">Twitter<\/a> &nbsp;<\/td>\r\n');
	//document.writeln('<td><a href="javascript:youtubeChannel();"><img src="img\/logos\/youtube.png" title="YouTube Channel"><\/a><\/td>\r\n');
	//document.writeln('<td class="twitter"><a href="javascript:youtubeChannel();">YouTube<\/a> &nbsp;<\/td>\r\n');
	document.writeln('<\/tr>\r\n');
	document.writeln('<\/table>\r\n');
	document.writeln('<\/td><\/tr>\r\n');
	document.writeln('<\/table>\r\n');
	document.writeln('<\/td><\/tr>');
}
/*
 * Creamos las franjas
 */
function franjaRandom() {
	document.writeln('<tr><td height="48" valign="top" background="img\/headers\/franja_home.jpg"><br/>\r\n');
	menu();
	document.writeln('<\/td><\/tr>\r\n');
	var n = randomPos(franjas);
	document.writeln('<tr><td valign="top">\r\n');
	document.writeln('<img src="'+franjas[n]+'" usemap="#MapFranja"><br/>\r\n');
	if (enlaces[n] != null)
		document.writeln('<map name="MapFranja" id="MapFranja"><area shape="rect" coords="354,111,444,129" href="'+enlaces[n]+'" title=""><\/map>\r\n');
	document.writeln('<\/td><\/tr>\r\n');
	document.writeln('<tr><td>\r\n');
}
function franja(imageBackground) {
	document.writeln('<tr><td height="228" valign="top" background="img\/headers\/'+imageBackground+'.jpg"><br/>\r\n');
	menu();
	document.writeln('<\/td><\/tr>\r\n');
	document.writeln('<tr><td>\r\n');
}
/*
 * Creamos el menu
 */
function menu() {
	document.writeln('<table border="0" cellpadding="0" cellspacing="0">\r\n');
	document.writeln('<tr><td valign="top" class="mainMenu">\r\n');
	document.writeln('<a href="index.html">Inicio<\/a>\r\n');
	document.writeln('| <a href="productos.html">Productos<\/a>\r\n');
	document.writeln('| <a href="deployment.html">Deployment<\/a>\r\n');
	document.writeln('| <a href="riskcontrol.html">Risk Control<\/a>\r\n');
	document.writeln('| <a href="demo.html">Demo<\/a>\r\n');
	document.writeln('| <a href="screencast.html">ScreenCast<\/a>\r\n');
	document.writeln('| <a href="contacto.html">Contacto<\/a>\r\n');
	document.writeln('<\/td><\/tr>\r\n');
	document.writeln('<\/table>\r\n');
	noticia();
}
/*
 * Creamos la noticia
 */
function noticia() {
	document.writeln('<p class="notice">');
	//document.writeln('Finalista de los premios &nbsp;<a href="javascript:notice();">SOAwards 2010<\/a>&nbsp; a la mejor herramienta de integración SOA');
	document.writeln('<a href="demo.html">¡ Abierto nuevo periodo de pruebas !<\/a>');
	document.writeln('<\/p>\r\n');
}
/*
 * Creamos el footer
 */
function footer() {
	document.writeln('<\/td><\/tr>\r\n');
	document.writeln('<\/table>');

	//document.writeln('<div class="box_content"><ul>');
	//document.writeln('<li class="top_box_content"><div class="box_content_footer2">');
	document.writeln('<div class="box_content_footer">');
	document.writeln('&reg; 2010 by PlatformTrader\r\n');
	document.writeln('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \r\n');
	document.writeln('<a href="index.html">Inicio<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="empresa.html">Quiénes Somos<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="productos.html">Productos<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="demo.html">Demo<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="contacto.html">Contacto<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="sitemap.html">Sitemap<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="legal.html">Legal<\/a>\r\n');
	document.writeln('&nbsp; | &nbsp; <a href="credits.html">Créditos<\/a>\r\n');
	document.writeln('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \r\n');
	document.writeln('<img src="img\/check.png" title="Valid XHTML"\/> <a href="http://validator.w3.org/check?uri=referer" target="_blank">XHTML<\/a>\r\n');
	document.writeln('&nbsp; <img src="img\/check.png" title="Valid CSS"\/> <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">CSS<\/a>\r\n');
	document.writeln('<\/div>');
	//document.writeln('<\/div><\/li>');
	//document.writeln('<li class="bottom_box_content"><\/li>');
	//document.writeln('<\/ul><\/div>');
}
