function PopEdit(ContentId){
	var tmp = '../EditContent.aspx?ConteudoId=' + ContentId;
	var Abre = window.open(tmp,'EditContent','width=640,height=540,screenX=350,screenY=197,status=yes,maximize=yes, resizable=yes');
}
function PopImg(_image){
	var tmp = '../ShowPic.aspx?ImagePath=' + _image;
	var Abre = window.open(tmp,'ViewImage','width=640,height=540,screenX=350,screenY=197,status=yes,maximize=yes, resizable=yes');
}
function abrirJanela(theURL,winName) { //v2.0
  var Abre = window.open(theURL, winName, 'width=640,height=540,screenX=350,screenY=197,status=yes,maximize=yes, resizable=yes');
}

// Formulario
var fieldstocheck = new Array();
fieldnames = new Array();
function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Por favor introduce tu "+fieldnames[i]);
      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }
}
function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

/*
 * FlashObject embed
 * by Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)
 *
 * v1.1.1 - 05-17-2005
 *
 * writes the embed code for a flash movie, includes plugin detection
 *
 * Usage:
 *
 *	myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");
 *	myFlash.write("objId");
 *
 * for best practices, see:
 *  http://blog.deconcept.com/2005/03/31/proper-flash-embedding-flashobject-best-practices/
 *
 */

var FlashObject = function(swf, id, w, h, ver, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.version = ver;
	this.align = "middle";

	this.params = new Object();
	this.variables = new Object();

	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.bypassTxt = "<p>Already have Macromedia Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";
	
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = getQueryParamValue('detectflash');
}

var FOP = FlashObject.prototype;

FOP.addParam = function(name, value) { this.params[name] = value; }

FOP.getParams = function() { return this.params; }

FOP.getParam = function(name) { return this.params[name]; }

FOP.addVariable = function(name, value) { this.variables[name] = value; }

FOP.getVariable = function(name) { return this.variables[name]; }

FOP.getVariables = function() { return this.variables; }

FOP.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    return (paramTags == "") ? false:paramTags;
}

FOP.getHTML = function() {
    var flashHTML = "";
    if (navigator.plugins && navigator.mimeTypes.length) { // netscape plugin architecture
        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs()) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    } else { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags()) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    return flashHTML;	
}

FOP.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) { 
    	variablePairs.push(name + "=" + escape(this.getVariable(name))); 
    }
    return (variablePairs.length > 0) ? variablePairs.join("&"):false;
}

FOP.write = function(elementId) {
	if(detectFlash(this.version) || this.doDetect=='false') {
		if (elementId) {
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else if (this.altTxt) {
			if (elementId) {
				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
			} else {
				document.write(this.altTxt +""+ this.bypassTxt);
			}
		}
	}		
}

/* ---- detection functions ---- */
function getFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			var y = x.description;
   			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		result = false;
	    for(var i = 15; i >= 3 && result != true; i--){
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
   			flashversion = i;
   		}
	}
	return flashversion;
}

function detectFlash(ver) {	return (getFlashVersion() >= ver) ? true:false; }

// get value of query string param
function getQueryParamValue(param) {
	var q = document.location.search || document.location.href.split("#")[1];
	if (q) {
		var detectIndex = q.indexOf(param +"=");
		var endIndex = (q.indexOf("&", detectIndex) > -1) ? q.indexOf("&", detectIndex) : q.length;
		if (q.length > 1 && detectIndex > -1) {
			return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
		} else {
			return "";
		}
	}
}

/* add Array.push if needed */
if(Array.prototype.push == null){
	Array.prototype.push = function(item) { this[this.length] = item; return this.length; }
}

//foto
function foto(){
	var rnd_number=Math.round(23*Math.random())
    document.getElementById("contenedor").style.backgroundImage = 'url(../images/Bruno'+ rnd_number +'.jpg)';
}

//traza

LoadVars=function(){
	this.loaded=false;
	this.sandlobj=false;
	this.onData=function(){};
	this.onLoad=function(){};
	this.headers=new Object();
	this.addRequestHeader("content-type","application/x-www-form-urlencoded");
	cConex=this.cconex();
}
//Private methods
LoadVars.prototype.cconex=function(){
	var conex = "";
	if(window.XMLHttpRequest){conex=new XMLHttpRequest();}
	else if(window.ActiveXObject){
		try{conex = new ActiveXObject("Msxml2.XMLHTTP");}
		catch(e){try{conex = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(e){conex=false;}
		}
	}
	return conex;	
}
LoadVars.prototype.parseVars=function(){
	this.decode(this.valor);
	this.loaded=true;
	if(oConex.sandlobj){
		try{
			oConex.sandlobj.onLoad(true);
			oConex.sandlobj.onData(oConex.valor);
		}catch(e){
			alert("ERROR: "+e);
		}
	}else{
		oConex.onLoad(true);
		oConex.onData(oConex.valor);	
	}
}
LoadVars.prototype.processOnLoad=function(){
	if(cConex.readyState == 4){
		if(cConex.status==200){
			oConex.valor=cConex.responseText
			oConex.parseVars();
		}else if(cConex.status==404){
			//alert("[processOnLoad.1] No se ha encontrado el archivo requerido: "+oConex.ruta);
			if(oConex.sandlobj){
				try{
					oConex.sandlobj.onLoad(false);
					oConex.sandlobj.onData(false);
				}catch(e){
					alert("[processOnLoad.2] El objeto: "+oConex.sandlobj.toString()+" no es un objeto loadVars valido");
				}
			}else{
				oConex.onLoad(false);
				oConex.onData(false);
			}
		}
	}
}
LoadVars.prototype.setHeaders=function(){
	for(var x in this.headers){
		var vari = x;
		var valu = this.headers[x];
		cConex.setRequestHeader(vari,valu);
	}
}
LoadVars.prototype.addVars=function(obj){
	for(var i in obj){
		this[i]=obj[i];
	}
}
LoadVars.prototype.getVariables=function(bool){
	var excepcions = new Array("","contentType","loaded","onData","onLoad","headers","cconex","parseVars","processOnLoad","setHeaders","getVariables","addRequestHeader","decode","load","send","sendAndLoad","toString","ruta","variables","valor","rutaArg","creaForm","addVars","loadPost","sandlobj","getBytesLoaded","getBytesTotal");
	var retorn = "";
	if(bool){
		var o = new Object();
	}
	for(var i in this){
		var isin=false;
		for(var j in excepcions){
			if(i == excepcions[j]){isin=true;}
		}
		if(!isin){
			if(bool){o[i]=this[i];
			}else{retorn += (i + "=" + this[i] + "&");}
		}
	}
	if(bool){
		return o;
	}else{
		return retorn.substring(0,retorn.length-1);
	}
}
LoadVars.prototype.creaForm=function(action,objVars,method){
	var form=document.createElement("form");
	form.action=action;
	form.method=method;
	form.style.display="none";
	for(var i in objVars){
		var inp=document.createElement("input");
		inp.type="hidden";
		inp.name=i;
		inp.value=objVars[i];
		form.appendChild(inp);
	}
	return form;
}
LoadVars.prototype.loadPost=function(ruta){
	oConex=this;
	this.ruta=ruta;
	if(cConex){
		cConex.onreadystatechange=this.processOnLoad;
		cConex.open("POST",this.ruta);
		this.setHeaders();
		var varPost=this.getVariables();
		cConex.send(varPost);
	}
}
//Public methods
LoadVars.prototype.addRequestHeader=function(variable,value){
	if(arguments.length==2){
		this.headers[variable]=value;
	}else if(arguments.length==1){
		for(var x=0;x<variable.length;x+=2){
			var vari = variable[x];
			var valu = variable[x+1];
			this.headers[vari]=valu;
		}
	}
}
LoadVars.prototype.decode=function(valor){
	this.variables = valor.split("&");
	for(var i=0;i<this.variables.length;i++){
		var _k=this.variables[i].split("=");
		this[_k[0]]=_k[1];
	}
}
LoadVars.prototype.load=function(ruta){
	oConex=this;
	this.ruta=ruta;
	this.rutaArg=ruta+"?"+this.getVariables();
	if(cConex){
		cConex.onreadystatechange=this.processOnLoad;
		cConex.open("GET",this.rutaArg);
		this.setHeaders();
		cConex.send(null);
	}
}
LoadVars.prototype.send=function(ruta,target,method){
	method=method.toUpperCase();
	if(method!="GET")method="POST";
	var vars = this.getVariables(true)
	var formulari=this.creaForm(ruta,vars,method);
	formulari.target=target;
	document.body.appendChild(formulari);
	formulari.submit();
	formulari.parentNode.removeChild(formulari);
}
LoadVars.prototype.sendAndLoad=function(ruta,obj,method){
	method=method.toUpperCase();
	if(method!="GET")method="POST";
	if(method=="GET"){
		this.addVars(obj);
		this.load(ruta);
	}else{
		this.addVars(obj);
		this.loadPost(ruta);
	}
	this.sandlobj=obj;
}
LoadVars.prototype.toString=function(){
	return this.getVariables();
}
LoadVars.prototype.getBytesLoaded=function(){
	if(cConex.readyState > 2){
		return cConex.responseText.length;
	}else{
		return 0;
	}
}
LoadVars.prototype.getBytesTotal=function(){
	var v=cConex.getResponseHeader("Content-Length");
	if(!v){v=0;}
	return v;
}

//*******************************************//
function traza (id1,id2){
	var vars = new LoadVars();
	vars.nombre = id1;
	vars.telefono = id2;
	vars.load("seguimiento.php",vars,"POST");
	return false;			
		}