﻿




// function parameters are: field - the string field, count - the field for remaining
//characters  number and max - the maximum number of characters  
function CountLeft(field, count, max) {
    // if the length of the string in the input field is greater than the max value, trim it 
    if (field.value.length > max)
        field.value = field.value.substring(0, max);
    else
        count.value = max - field.value.length;
    // calculate the remaining characters  
}


function overlay() {
    elem = document.getElementById("overlay");
    elem.style.visibility = "hidden";
    elem = document.getElementById("bodydiv");
    elem.style.visibility = "visible";
}


function closeDiv(controlId) {
    var d = document.getElementById(controlId).parentNode;
    var olddiv = document.getElementById(controlId);
    d.removeChild(olddiv);
}


function cargando( mensaje) {
    elem = document.getElementById("overlay");
    elem.style.visibility = "visible";
    elem = document.getElementById("bodydiv");
    elem.style.visibility = "hidden";   
}








$(document).ready(function() {

//todos los links tienen la propiedad de mostrar la pantalla de caregar
// excepto los links que tienen rel=facebox que son los q se abren en una ventanita
$("a[target!='_blank'][rel!='facebox']").click(
function() {
    elem = document.getElementById("overlay");
    elem.style.visibility = "visible";
    elem = document.getElementById("bodydiv");
    elem.style.visibility = "hidden"; 
});

});




    $(document).ready(function() {
        $('#slider1').s3Slider({
            timeOut: 5000
        });
    });

    $(document).ready(function() {
        $(".pane-list li").click(function() {
            window.location = $(this).find("a").attr("href"); return false;
        });

        

    });

    $(document).ready(function() {
        $('.rss').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

        $('.facebook').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

        $('.twitter').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

    });
    
    $(document).ready(function() {
        $('.rss').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

        $('.facebook').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

        $('.twitter').append('<span class="hover"></span>').each(function() {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function() {
                $span.stop().fadeTo(500, 1);
            }, function() {
                $span.stop().fadeTo(500, 0);
            });
        });

    });
