$(document).ready(function(){
    //get the height and width of the page
    var window_width = $(window).width();
    var window_height = $(window).height();
    //vertical and horizontal centering of modal window(s)
    /*we will use each function so if we have more then 1
    modal window we center them all*/
    $('.modal_window').each(function(){
        //get the height and width of the modal
        var modal_height = $(this).outerHeight();
        var modal_width = $(this).outerWidth();
        //calculate top and left offset needed for centering
        var top = (window_height-modal_height)/2;
        var left = (window_width-modal_width)/2;
        //apply new top and left css values
        $(this).css({'top' : top , 'left' : left});
    });
        $('.activate_modal').click(function(e){
              //get the id of the modal window stored in the name of the activating element
              var modal_id = $(this).attr('name');
            // load eform
            $('#'+modal_id).load('index.php?id=65');
              //use the function to show it
              show_modal(modal_id);
              e.preventDefault;
        });
//        $('.close_modal').click(function(e){
            //use the function to close it
//            close_modal();
//            e.preventDefault();
//         });
});
 
    //THE FUNCTIONS
function close_modal(){
    //hide the mask
    $('#mask').fadeOut(600);
    //hide modal window(s)
    $('.modal_window').fadeOut(500);
}
function show_modal(modal_id){
    //set display to block and opacity to 0 so we can use fadeTo
    $('#mask').css({ 'display' : 'block', opacity : 0});
    //fade in the mask to opacity 0.8
    $('#mask').fadeTo(800,0.8);
    //show the modal window
    $('#'+modal_id).fadeIn(800);
}
function submit_form(){
    // disable the submit button
    $('#submitbutton').attr("disabled", true); 
    // get the field values
    var name = $("input#name").val();
    var email = $("input#email").val();
    var fname = $("input#fname").val();
    var fmail = $("input#fmail").val();
	var vericode = $("input#vericode").val();
    var message = $("textarea#message").val();
     
    // load the eform results
    $('#form_window').load('index.php?id=65', {'name':name, 'email':email, 'fname':fname, 'fmail':fmail, 'message':message, 'formid':'ShareForm', 'vericode':vericode});   
}


    jQuery(document).ready(function () {
            jQuery('#mycarousel').jcarousel();
            jQuery('#mycarousel2').jcarousel();
            jQuery('#mycarousel3').jcarousel();
	  
            $("#person-search").show();
            $("#documents").hide();
            $("#newspanel").show();
            $("#anouncepanel").hide();
			$("#video-content").hide();
			$("#foto-content").show();			
			
    });