﻿//Initialization of pretyPhoto
//$(document).ready(function() { $("a[rel^='prettyPhoto']").prettyPhoto(); });

//NewsLoop
/*
$('#news_block div:first').show();
$(document).ready(function() {$('#news_block').cycle({ fx: 'fade' });});
*/

//$("#news_block").cycle({ fx: 'scrollDown', sync: 0, delay: -2000, pause: true });

//Search field click
$(document).ready(function clickclear(thisfield, defaulttext) { if (thisfield.value == defaulttext) thisfield.value = ""; });
$(document).ready(function clickrecall(thisfield, defaulttext) { if (thisfield.value == "") thisfield.value = defaulttext; });
$(".sub_menu li:last-child").addClass("sub_menu_item_last");
//$("#sub_menu li:last-child").addClass("sub_menu_item_last");
var siteUrl = '<%=GS.siteUrl %>';
$(document).ready(function() {
    $('.pline').click(function() {
        if ($('.cat_content', this).is(':hidden')) {
            $('.cat_content', this).show('slow');
        }
        else {
            $('.cat_content', this).hide('slow');
        }
    });

    $('.pline').hover(function() { $(this).css("background-color", "#eeeeee") }, function() { $(this).css("background-color", "#ffffff") });
});
$(document).ready(function() {
    $(".sub_menu_item").hover(function() { $(".sub_menu1", this).show(); }, function() { $(".sub_menu1", this).hide(); });
    $(".subSub_menu_item1").hover(function() { $(".sub_menu2", this).show(); }, function() { $(".sub_menu2", this).hide(); });
    $(".subSub_menu_item2").hover(function() { $(".sub_menu3", this).show(); }, function() { $(".sub_menu3", this).hide(); });
    //$('.sub_menu_item').show();
});

function switchOpenCloseDiv(lblQuestionID,lblAnswerID) {
    var lblAnswer = document.getElementById(lblAnswerID);
    var lblQuestion = document.getElementById(lblQuestionID);
    if (lblAnswer.style.display == 'none') {
        lblAnswer.style.display = 'block';
        //lblQuestion.style.textDecoration = 'underline';
        lblQuestion.style.fontWeight = 'bold';
    }
    else {
        lblAnswer.style.display = 'none';
        //lblQuestion.style.textDecoration = 'none';
        lblQuestion.style.fontWeight = 'normal';
    }
}

function refreshTopLetterBar(obj) {
    var allIndexTD = document.getElementsByName('letterA');
    for (f = 0; f < allIndexTD.length; f++) {
        allIndexTD.item(f).parentNode.className = 'letterTd';
    }

    obj.parentNode.className = 'letterTd_selected'
}

function showVideoContent(strContent) {
    var divVideoContentHolder = document.getElementById('div_videoContentHolder')
    divVideoContentHolder.style.display = 'block';
    divVideoContentHolder.innerHTML = unescape(strContent);
}

function HideVideoContent(strContent) {
    var divVideoContentHolder = document.getElementById('div_videoContentHolder')
    divVideoContentHolder.style.display = 'none';
}

function RedirectToUrl(UrlToGo) { $(location).attr('href', UrlToGo); }

$(document).ready(function() {
    if ($("#gal_big_img").length > 0) {
        var broot = $("#gal_big_img").scrollable();
        var bapi = broot.scrollable();

        var sroot = $("#gal_thumb_img").scrollable();
        var sapi = sroot.scrollable();

        $('.overlay').css({ 'opacity': 0.6, 'background': '#000' });
    }

    $("#gal_thumb_img .thumb_gal_item").click(function() {
        //var gal_index = $(".thumb_gal_item").index(this);
        $("#img_title").text($("img", this).attr("title"));
        //bapi.seekTo(gal_index);
        var gal_img = $("img", this).attr("src").replace("Thumbs/", "");
        $(".imgBig").attr("src", gal_img);
    });

});

function ShowPopup(iframeSrc, modalTitle, modalWidth, modalHeight) {
    $(".popUpIframeFrame").attr("src", iframeSrc);
    $(".modalPopUp").dialog('destroy');
    //$('.modalPopUp').attr('title', modalTitle);
    $(".modalPopUp").dialog({ width: modalWidth, maxHeight: modalHeight, modal: true });
}

function HidePopup() {
    //$find('#pnl_modalPopUp').hide();
    $(".modalPopUp").dialog('close');
}
