﻿/* 
Copyright (c) 2010 Freellas - [www.freellas.com.br]
Todos os direitos reservados.

Arquivo criado em: 11/03/2010
----------------------------------------------------------
Todo e qualquer script referente aos webcontrols da solução
*/

function HoverImage(obj) {
    var outImageName = obj.find("img:first").attr("src").replace(".png", "");
    var outImagePath = outImageName.substring(0, outImageName.lastIndexOf('/') + 1);
    outImageName = outImageName.substring(outImageName.lastIndexOf('/') + 1);
    outImageName = outImagePath + outImageName + '_on.png';
    obj.find("img:first").attr("src", outImageName);
}

function OuterImage(obj) {
    var outImageName = obj.find("img:first").attr("src").replace(".png", "").replace("_on", "");
    var outImagePath = outImageName.substring(0, outImageName.lastIndexOf('/') + 1);
    outImageName = outImageName.substring(outImageName.lastIndexOf('/') + 1);
    outImageName = outImagePath + outImageName + ".png";
    obj.find("img:first").attr("src", outImageName);
}

/* 
- Nome: WCMenuRapido 
*/

$(function() {
    $(".WCMenuRapidoHome a").hover(
				function() {
				    HoverImage($(this));
				},
				function() {
				    OuterImage($(this));
				}
			);

    $(".WCMenuRapidoContato a").hover(
				function() {
				    HoverImage($(this));
				},
				function() {
				    OuterImage($(this));
				}
			);
});

/* 
fim do WCMenuRapido 
*/

/* 
- Nome: WCRodape 
*/

$(function() {
    $(".WCRodapeHeadContainerMenu a").hover(
				function() {
				    HoverImage($(this));
				},
				function() {
				    OuterImage($(this));
				}
			);

    $(".WCRodapeBodyContainerClose a").hover(
				function() {
				    HoverImage($(this));
				},
				function() {
				    OuterImage($(this));
				}
			);
});

function OpenFooter() {
    $(".WCRodapeBody").css("display", "");
    var wHeight;
    if (this.document.all)
        wHeight = (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
    else
        wHeight = window.innerHeight;

    ScrollWin.scrollTo('0', wHeight + 1000, 50);
}

function CloseFooter() {
    $(".WCRodapeBody").css("display", "none");
}

function AddToFavorite() {
    var url = "http://www.joevanza.com.br";
    var title = "JOEVANZA - Seu destino é a nossa prioridade!";
    if (window.sidebar) window.sidebar.addPanel(title, url, "");
    else if (window.opera && window.print) {
        var mbm = document.createElement('a');
        mbm.setAttribute('rel', 'sidebar');
        mbm.setAttribute('href', url);
        mbm.setAttribute('title', title);
        mbm.click();
    }
    else if (document.all) { window.external.AddFavorite(url, title); }
}

/* 
fim do WCRodape 
*/
