/*-------------------------------------------------------------------
PkNews - Newsletters System 
By PkLab Ingegneria Informatica & automatica
site:http://www.pklab.net/
Copyright (C) 2004  pklab

PkNews is free software; you can redistribute it and/or 
modify it under the terms of the GNU General Public License as 
published by the Free Software Foundation; 
either version 2 of the License, or any later version. 

PkNews is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

ChangeLog
$Log: function.js,v $
Revision 1.2  2005/07/26 15:52:50  pklab
no message

Revision 1.1.1.1  2005/07/12 17:03:15  pklab
First public relase on sourceforge

-------------------------------------------------------------------*/

/**
 * Displays an confirmation box beforme to submit a "DROP/DELETE/ALTER" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLink(theLink, theSqlQuery)
{
		confirmMsg ="Confirm";
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function

function openWin(file) {
	open(file, "", "height=500,width=550,status=yes,toolbar=no,menubar=yes,scrollbars=yes,resizable=yes");
}

function typeEmail(user,domain)
{
  document.write("<a href=mailto:" + user+"_at_" +domain+">"+user +"_at_" +domain+"<\/a>");
}
