// JavaScript Document

function getxmlhttp (){
	var xmlhttp = false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function processajax (obj, serverPage){
	xmlhttp = getxmlhttp ();
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			document.getElementById(obj).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}
function videomadrid(){
	tb_show(null,"videomadrid.html?height=510&width=582");
};

function formularioSiCliente(){
	tb_show(null,"formulariocliente.php?height=530&width=465&TB_iframe=true");
};
function formularioNoCliente(){
	tb_show(null,"formularionocliente.php?height=530&width=465&TB_iframe=true");
};


function formas(){
	tb_show(null,"formas.html?height=410&width=830");
};

function contacto(){
	tb_show(null,"contacto.html?height=300&width=390");
};

function video(num){
	var text = "";
	var video = 0;
	switch(num){
		case 1:		text = "Ella nos cuenta qu&eacute; bien se lo ha pasado en uno de nuestros talleres.";
					video = 3;
					break;
		case 2:		text = "La primera vez que compr&oacute; ropa era para su beb&eacute;. Y ahora tambi&eacute;n &iexcl;compra ropa para ella!";
					video = 4;
					break;
		case 3:		text = "Nos explica su experiencia<br/>con nosotros.";
					video = 1;
					break;
		case 4:		text = "Ha ahorrado mucho tiempo<br/>en compras.";
					video = 6;
					break;
		case 5:		text = "&iexcl;Cu&aacute;ntas ventajas tiene comprar<br/>con La Redoute!";
					video = 2;
					break;
		case 6:		text = "Hace 8 a&ntilde;os que es nuestra clienta y &iexcl;Est&aacute; encantada!";
					video = 5;
					break;
	}
	$('#videotexto').html(text);
	$('#videotestimonial').html("");
	$('#videotestimonial').flash({src: 'swf/video'+video+'.swf',width: 186,height: 124});
}

$(document).ready( function() {
   
    $('a[rel="external"]').click( function() {
        mywindow = window.open( $(this).attr('href'),"mywindow","menubar=1,resizable=1,width=600,height=400,location=1,status=1,scrollbars=1");
		//var posX=((screen.width)/2)-(300);
		//var posY=((screen.height)/2)-(200);
		//mywindow.moveTo(posX,posY);
        return false;
    });
   
});