// JavaScript Document

/* 
 * SELECT CON TODAS LAS SERIES
 */

function preparaSelect() {
	var s = document.getElementById('selectSerie');
	appendOption(s,"Simon 27 Play","/html/int/GuiaDisenos/Estilos/default.jsp");
	appendOption(s,"Simon 27 Neos","/html/int/GuiaDisenos/Estilos/27neos.jsp");
	appendOption(s,"Simon 31","/html/int/GuiaDisenos/Estilos/31.jsp");
	appendOption(s,"Simon 75","/html/int/GuiaDisenos/Estilos/75.jsp");
	appendOption(s,"Simon 82","/html/int/GuiaDisenos/Estilos/82.jsp");
	appendOption(s,"Simon 82 Nature","/html/int/GuiaDisenos/Estilos/82n.jsp");
	appendOption(s,"Simon 88","/html/int/GuiaDisenos/Estilos/88.jsp");
	appendOption(s,"Simon VOX Basic","/series/vox-basic/promotor.html");
	s.selectedIndex = 7; // Selecciono Simon Vox Basic como predeterminado
	s.onchange = function () {
		var url = s.options[s.selectedIndex].value;
		location.href = url;
	}
}

function appendOption(select, text, value) {
  var optNew = document.createElement('option');
  optNew.text = text;
  optNew.value = value;
  try {
    select.add(optNew, null); // standards compliant; doesn't work in IE
  }
  catch(ex) {
    select.add(optNew); // IE only
  }
}


/*
 * CENTRADO DE LA PÁGINA
 */
 
function repaint(){
	var caja=document.getElementById("contenedor");

	if (window.document.body.offsetWidth < 802)
        	{caja.style.left="401px";}
	else
		{caja.style.left=((window.document.body.offsetWidth-802)/2+401)+"px";}


	if (document.documentElement.clientHeight<574)
		{caja.style.top="287px";}
	else
		{caja.style.top=((document.documentElement.clientHeight)/2)+"px";}
}


/*
 * EVENTOS
 */

window.addEvent('domready', function(){
	preparaSelect();
	repaint();
});
window.addEvent('resize', repaint);