/* CLIENTES*/

 function fXtra(cual){
	$('xtracomercio', 'xtrapagina', 'xtratramite').invoke('hide');

	if (cual=="xtratramite"){
		$('th_tarjetalegend').update('Número de solicitud');
	}

	if (cual!="xtratramite"){
		$('th_tarjetalegend').update('Número de Tarjeta TDU');
	}

	if (cual!="nada") {
	$(cual).show();
	}
}




/* OTROS */

function ComEstatus(cual){
var wincome = new Window({className: "alphacube", title: "Cambiar Estatus", width:620, height:450, url: "comestatus.asp?id="+cual, destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincome.showCenter();
}


function ComEditar(cual){
var wincome = new Window({className: "alphacube", title: "Editar Comercio", width:620, height:450, url: "comeditar.asp?id="+cual, destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincome.showCenter();
}

function ComAgregar(){
var wincome = new Window({className: "alphacube", title: "Agregar Comercio", width:620, height:450, url: "comagregar.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincome.showCenter();
}

function CiuAgregar(){
var winciud = new Window({className: "alphacube", title: "Agregar una Ciudad", width:620, height:450, url: "ciuagregar.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
winciud.showCenter();
}


function ComCiudades(cual){
var tmptitle="Ciudades";
var wincome = new Window({className: "alphacube", title: tmptitle, width:620, height:450, url: "comciudades.asp?id="+cual, destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincome.showCenter();
}


function ComSucursales(cual){
var tmptitle="Sucursales";
var wincome = new Window({className: "alphacube", title: tmptitle, width:820, height:450, url: "comsucursales.asp?id="+cual, destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincome.showCenter();
}


function hotdeals(){
var winhd = new Window({className: "alphacube", title: "Hotdeals", width:560, height:400, url: "hotdeals.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
winhd.showCenter();
}

function entretenimiento(){
var winen = new Window({className: "alphacube", title: "Cupones y Boletos", width:660, height:500, url: "entretenimiento.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
winen.showCenter();
}


function cupones(){
var wincp = new Window({className: "alphacube", title: "Cupones", width:420, height:350, url: "cupones.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
wincp.showCenter();
}

function aprende(){
var winpig = new Window({className: "alphacube", title: "Ahorra", width:420, height:350, url: "aprende.asp", destroyOnClose: true, recenterAuto:false, wiredDrag: true});
winpig.showCenter();
}


function fwtf(cual){
	switch(cual)
	{
		case 1:
		str='<p>La página principal. Te permite acceder a todas las secciones.</p>';
		break 
		
		case 2:
		str='<p>Aquí encontraras la lista de comercios afiliados. ¡Consúltala!</p>';
		break

		case 3:
		str='<p>Entérate de los nuevos comercios afiliados, así como de los cambios más recientes.</p>';
		break
		
		case 4:
		str='<p>¿Comentarios o dudas? Envíanolos usando esta página.</p>';
		break
		
		case 5:
		str='<p>Tenemos un programa especial para empresas, conócelo aquí.</p>';
		break
		
		default:
		str="<p>&nbsp;</p>";
	}
		
		$('wtf').update(str);

}

function fBusca() {
	valida = validar.validate();
	if (valida==true){
	$('FResultados').update('<img border="0" src="images/chambing.gif">');
	var url = "ajaxconsulta.asp?"+$('Fbusca').serialize()
	new Ajax.Updater('FResultados', url, {asynchronous:true});
	}
}

function fCambios() {
	valida = validar.validate();
	if (valida==true){
	$('FResultados').update('<img border="0" src="images/chambing.gif">');
	var url = "ajaxcambios.asp?"+$('Fcambios').serialize()
	new Ajax.Updater('FResultados', url, {asynchronous:true});
	}
}


function fCome() {
	$('DivComeRes').update('<img border="0" src="../images/chambing.gif">');
	var url = "ajaxcomercios.asp?"+$('Fcome').serialize();
	new Ajax.Updater('DivComeRes', url, {asynchronous:true});
}



function descripcion(cual){
var divcommerce="desccommerce"+cual;
new Effect.toggle($(divcommerce),'blind');
}

function sucursales(ciudad,cual){
	var divsucursales="descsucursales"+cual;
		if ($(divsucursales).empty()) {
			$(divsucursales).update('<img border="0" src="images/blu.gif">');
			var url = "ajaxsucursales.asp?cd=" + ciudad+"&cm="+cual;
			new Ajax.Updater($(divsucursales), url, {asynchronous:true});
		}
	new Effect.toggle($(divsucursales),'blind');
}
