// JavaScript Document


var arrOldValues;

function SelectAllList(CONTROL){
for(var i = 0;i < CONTROL.length;i++){
CONTROL.options[i].selected = true;
}
}

function DeselectAllList(CONTROL){
for(var i = 0;i < CONTROL.length;i++){
CONTROL.options[i].selected = false;
}
}


function FillListValues(CONTROL){
var arrNewValues;
var intNewPos;
var strTemp = GetSelectValues(CONTROL);
arrNewValues = strTemp.split(",");
for(var i=0;i<arrNewValues.length-1;i++){
if(arrNewValues[i]==1){
intNewPos = i;
}
}

for(var i=0;i<arrOldValues.length-1;i++){
if(arrOldValues[i]==1 && i != intNewPos){
CONTROL.options[i].selected= true;
}
else if(arrOldValues[i]==0 && i != intNewPos){
CONTROL.options[i].selected= false;
}

if(arrOldValues[intNewPos]== 1){
CONTROL.options[intNewPos].selected = false;
}
else{
CONTROL.options[intNewPos].selected = true;
}
}
}


function GetSelectValues(CONTROL){
var strTemp = "";
for(var i = 0;i < CONTROL.length;i++){
if(CONTROL.options[i].selected == true){
strTemp += "1,";
}
else{
strTemp += "0,";
}
}
return strTemp;
}

function GetCurrentListValues(CONTROL){
var strValues = "";
strValues = GetSelectValues(CONTROL);
arrOldValues = strValues.split(",")
}
function abrirfoto (pag) 
{
var op=("toolbar=no,directories=no,scrollbars=0,menubar=no,status=no,width=300,height=300,left = 0,top = 0")
window.open(pag,"",op);
}

function abririnfo (p) 
{
var op=("toolbar=no,directories=no,scrollbars=0,menubar=no,width=450,height=500,left = 0,top = 0")
window.open(p,"",op);
}
function abreservicio() {
		Ventana=open("ejemploservicios.html","Servicio","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=170,left = 0,top = 0');")
	}
function abreactividad() {
		Ventana=open("ejemploactividades.html","Actividad","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=170,left = 0,top = 0');")
	}
function abrepromo() {
		Ventana=open("ejemplopromocion.html","Promocion","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=170,left = 0,top = 0');")
	}
function abrerestric() {
		Ventana=open("ejemplorestricciones.html","Restricciones","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=170,left = 0,top = 0');")
	}
