/** * Package main JavaScript * * @package myEASYdb * @author Ugo Grandolini * @version 0.0.1 */ /** * Globals */ var mouseAbsX = 0, mouseAbsY = 0; //alert(window.location.protocol + '//' + window.location.hostname + '/'); var ajaxURL = window.location.protocol + '//' + window.location.hostname + '//wp-content/plugins/myeasydb/ajax_ro.php'; var imgURL = window.location.protocol + '//' + window.location.hostname + '//wp-content/plugins/myeasydb/img/'; //alert(ajaxURL); //alert(imgURL); //alert('js'); /** * Return an array with the page dimensions [width, height] */ function getPageDimensions() { var body = document.getElementsByTagName('body')[0]; var bodyOffsetWidth = 0, bodyOffsetHeight = 0, bodyScrollWidth = 0, bodyScrollHeight = 0, this_pagedim = [0,0]; if(typeof document.documentElement!='undefined' && typeof document.documentElement.scrollWidth!='undefined') { this_pagedim[0] = document.documentElement.scrollWidth; this_pagedim[1] = document.documentElement.scrollHeight; } bodyOffsetWidth = body.offsetWidth; bodyOffsetHeight = body.offsetHeight; bodyScrollWidth = body.scrollWidth; bodyScrollHeight = body.scrollHeight; if(bodyOffsetWidth>this_pagedim[0]) { this_pagedim[0] = bodyOffsetWidth; } if(bodyOffsetHeight>this_pagedim[1]) { this_pagedim[1] = bodyOffsetHeight; } if(bodyScrollWidth>this_pagedim[0]) { this_pagedim[0] = bodyScrollWidth; } if(bodyScrollHeight>this_pagedim[1]) { this_pagedim[1] = bodyScrollHeight; } return this_pagedim; } /** * Initialize the function to display the popup tag */ function pop(msg, link, secs) { if(!msg) { msg = 'pop(missing msg!)'; } if(msg=='*closePop') { var popWin = document.getElementById('myeasydb_popWin'); if(popWin) { document.body.style.cursor = 'default'; popWin.style.display = 'none'; } return; } setTimeout('pop_show(\'' + msg + '\',\'' + link + '\',\'' + secs + '\')', 10); } /** * Display the popup tag */ function pop_show(msg, link, secs) { if(!secs) { secs = getCookie('pop_time'); } if(!secs || isNaN(secs)) { secs = 1; } //alert('msg:'+msg+' link:'+link+' sec:'+secs); document.body.style.cursor = 'wait'; var popWin = document.getElementById('myeasydb_popWin'); if(popWin) { var this_pagedim = getPageDimensions(); popWin.innerHTML = '