// JavaScript Document

$(document).ready(function() {
	PEPS.rollover.init();
	
	/*$('#logo img').pngfix();
	$('#cabezal #menu .boton a').pngfix();
	$('#cabezal #menu .boton span').pngfix();
	$('#cabezal #submenu').pngfix();
	setInterval( 'slideSwitch()', 5000 );*/
	
	$('#menu .boton span').hover(
		function(){
			objClass = "." + $(this).parent().get(0).id + "_desplegable";
			arr_submenu_class = new Array (".submenu1_desplegable", ".submenu2_desplegable", ".submenu3_desplegable", ".submenu4_desplegable", ".submenu5_desplegable", ".submenu6_desplegable");
			for (var i=0; i<arr_submenu_class.length; i++){
				if ( objClass !== arr_submenu_class[i] ) {
					$(arr_submenu_class[i]).slideUp('fast');
				}
			}
			$(objClass).slideDown('fast');
		}, 
		function () {
			//
		}
		
	);
	// función rollover
	
});

function ShowMap(pImg){
    window.showModalDialog("viewMap.php?img=" + pImg,"name","dialogWidth:450px;dialogHeight:450px");
}

function ShowPickUpPoints(){
    var html = $.ajax({
        url: 'pick_up_point_locator_01.php?q=' + $('#SelectCity').val(),
        async: false
    }).responseText;
    $('#PickUpPointList').html(html);
}

function SearchCajeros(){
    var html = $.ajax({
        url: 'cajero_locator_02.php?q=' + $('#zipcode').val(),
        async: false
    }).responseText;
    $('#contenedor_cajero_locator').html(html);
}

function ShowCajeroMap(pAddres){
    window.open("http://maps.google.com/?q=" + pAddres,"name","width:1000px;height:900px");
}
