﻿// PEGI Flag
var wPegiShowed = false;

// Shows the PEGI info
function GMPEGIShowInfo(uParent)
{
    // Only Handle once
    if ( wPegiShowed ) return;
    // Make sure we have an object
	if (!uParent) var uParent = window.event;
    
    // Determine position
    var PosX = jQuery(window).scrollLeft() / 2 + jQuery(window).width() / 3 + 50;
    var PosY = jQuery(window).scrollTop() / 2 + jQuery(window).height() / 3 - 50;
    if (PosY < jQuery(window).scrollTop()){
        PosY = jQuery(window).scrollTop();
    }
        
    // Set position of our box
    var cssObj = {
        display: "block",
        visibility: "visible",
        left: PosX + "px",
        top: PosY + "px"
      }
    jQuery('#GMPegiMain').css(cssObj);
    jQuery('#GMPegiMain').show();
    wPegiShowed = true;
}

// Hides the PEGI info again
function GMPEGIHideInfo(uParent)
{
    jQuery('#GMPegiMain').hide(); 
    wPegiShowed = false;  
}

