﻿/*
This file has jQuery references in it and as such, the file jquery.js must be referenced in the head tag before this file.
*/

var mousePX = 0;
var mousePY = 0;
var docwidth = 0;
var docheight = 0;

jQuery(document).ready(function(){
$().mouseup(function(e){
  mousePX = e.pageX;
  mousePY = e.pageY;
}); 
})



function setXYHiddenFields(hidXID, hidYID, XOffset, YOffset)
{
    document.getElementById(hidXID).value = (mousePX - XOffset);
    document.getElementById(hidYID).value = (mousePY - YOffset);
}

function showDiv(divID, XOffset, YOffset)
{
    var sendMsgDiv = document.getElementById(divID);
    sendMsgDiv.style.left = (mousePX - XOffset) + "px";
    sendMsgDiv.style.top = (mousePY - YOffset) + "px";
    sendMsgDiv.style.display = "block";
}

function closeDiv(divID)
{
    document.getElementById(divID).style.display = "none";
}

function closeSendMsgDiv()
{
    document.getElementById("ctl00_sendmessage").style.display = "none";
    document.getElementById("ctl00_tbSendMessageSubject").value = "";
    document.getElementById("ctl00_tbSendMessageBody").value = "";
}

function sendMsgThanks(isEnglish)
{
    if (document.getElementById("ctl00_tbSendMessageSubject").value != "" && document.getElementById("ctl00_tbSendMessageBody").value != "")
    {
        var thxMsg;
        if (isEnglish)
            thxMsg = "Thank you for send a message to Liberation Community.\r\n\r\nWe will respond to you as soon as possible.";
        else
            thxMsg = "Gracias por enviar un mensaje a la Comunidad Liberación.\r\n\r\nLe responderemos tan pronto como sea posible.";
        alert(thxMsg);
    }
}

function refreshDimmerPanel(panelID) {
var toppos = f_scrollTop() + "px";
if (document.getElementById(panelID) != null) {
document.getElementById(panelID).style.top = toppos; }
}
/*scroll top position browser compatibility functions by SoftComplex, Inc.
http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html*/
function f_scrollTop() {
return f_filterResults (
window.pageYOffset ? window.pageYOffset : 0,
document.documentElement ? document.documentElement.scrollTop : 0,
document.body ? document.body.scrollTop : 0 ); }
function f_filterResults(n_win, n_docel, n_body) {
var n_result = n_win ? n_win : 0;
if (n_docel && (!n_result || (n_result > n_docel)))
n_result = n_docel;
return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; }

