
$(document).ready(function() {

    $("#informacion_contacto > ul > li").hover(function() {
        $(this).find("a").css('color', '#FFFFFF');
    }, function() {
        $(this).find("a").css('color', '#0177a7');
    });
    $('.twitter_contenido').show();
    $("div.tiendas.rounded-corners").hide();
    $("#tiendas_Electrónicos").show();
    jQuery("#tiendas_Electrónicos").vScroll ({
        speed: 500,
        height: 297,
        upID: "#go_up",
        downID: "#go_down",
        cycle: true
    });
    $("#tienda").load("get_corto_tienda.php?tienda=Amazon");
    $("#ofertas").load("get_ofertas_categoria.php?tienda=Amazon&categoria=Electrónicos");
    $("li.menu_principal").live("click",function() {
        var objectName = $(this).attr("class");
        $("li.menu_principal").removeClass("menu_seleccionado");
        $(this).addClass("menu_seleccionado");
        var classNames = objectName.split(" ");
        var showName = "#tiendas_" + classNames[1];
        $("div.tiendas.rounded-corners").hide();
        $(showName).show();
        jQuery(showName).vScroll ({
            speed: 500,
            height: 297,
            upID: "#go_up",
            downID: "#go_down",
            cycle: true
        });
    });
    $("div.listado_tiendas").click(function() {
        var classNames = $(this).attr("class");
        var classSplit = classNames.split(" ");
        var identClass = classSplit[1].split("-");
        var categoria = identClass[1];
        var tienda = identClass[2];
        $("#tienda").load("get_corto_tienda.php?tienda=" + tienda);
        $("#ofertas").load("get_ofertas_categoria.php?tienda=" + tienda + "&categoria=" + categoria);
    });
    $(".twitter_logo").live("mouseover mouseout", function(event) {
        if ( event.type == "mouseover" ) {
            $('.twitter_contenido').fadeIn("fast");
            $('.facebook_contenido').hide();
            $('.googleplus_contenido').hide();
        }
    });
    $(".facebook_logo").live("mouseover mouseout", function(event) {
        if ( event.type == "mouseover" ) {
            $('.facebook_contenido').fadeIn("fast");
            $('.twitter_contenido').hide();
            $('.googleplus_contenido').hide();                                
        }
    });
    
    
    $(".gplus_logo").live("mouseover mouseout", function(event) {
        if ( event.type == "mouseover" ) {
            $('.googleplus_contenido').fadeIn("fast");
            $('.twitter_contenido').hide();
            $('.facebook_contenido').hide();
        }
    });
    
    $(".twitter_logo").click(function() {
        window.open('http://twitter.com/crbox','twitter_crbox');
    });
    $(".facebook_logo").click(function() {
        window.open('http://www.facebook.com/pages/CRBOX-EXPRESS/86017857376','facebook_crbox');
    });
    
    
    $(".gplus_logo").click(function() {
        window.open('https://plus.google.com/u/0/b/105724294585477680945/','google+_crbox');
    });
    
    $("#calculadora_popup, #paquetes_popup").dialog({
        autoOpen: false,
        height: 500,
        width: 650,
        zIndex: 5000
    });
    $("#contacto_popup").dialog({
        autoOpen: false,
        height: 410,
        width: 570,
        zIndex: 5000
    });
    $("#cotizacion_popup").dialog({
        autoOpen: false,
        height: 750,
        width: 650,
        zIndex: 5000
    });
    $("#bancos_popup").dialog({
        autoOpen: false,
        height: 600,
        width: 500,
        zIndex: 5000
    });
    $("#afiliacion_popup").dialog({
        autoOpen: false,
        height: 600,
        width: 800,
        zIndex: 5000
    });
    /*$(".afiliese_action").click(function() {
        window.open("http://clients.crbox.cr/Account/Register");
    });*/
    $(".calculadora_action").click(function() {
        $("#calculadora_popup").dialog('open');
    });
    $(".cotizacion_action").click(function() {
        $("#cotizacion_popup").dialog('open');
    });
    $(".contacto_action").click(function() {
        $("#contacto_popup").dialog('open');
    });
    $(".bancos_action").click(function() {
        $("#bancos_popup").dialog('open');
    });
    $(".paquetes_action").click(function() {
        $("#paquetes_popup").dialog('open');
    });
$('#bubble_inferior').load('prueba/index.html')
});
/*
var flashvars = {};
var params = {
    wmode: "transparent"
};
var attributes = {
    "class": "afiliese_action"
};
swfobject.embedSWF("http://www.youtube.com/v/kiFaMKqDEHQ?version=3&amp;hl=es_MX&amp;rel=0", "bubble_inferior", "556", "240", "9.0.0", "", flashvars, params, attributes);*/

