home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 June
/
ccd0605.iso
/
Software
/
Freeware
/
Programare
/
paranoia
/
ParanoiaSetup.exe
/
Gui
/
Common.js
< prev
next >
Wrap
Text File
|
2005-04-21
|
2KB
|
95 lines
/*
* Function: ExecuteCommand
* Description: This function passes the JavaScript argument to the program interpreter.
*/
function ExecuteCommand(Command)
{
var DIYCommand = "diy:|SEPERATOR|" + Command;
window.navigate(DIYCommand);
}
/*
* Function: onContextMenu
* Description: This function disables the context menu (Right click menu)
* unless the user right clicked on an INPUT tag.
*/
function onContextMenu(){
if ( window.event.srcElement.tagName !="INPUT" ) {
window.event.returnValue = false;
window.event.cancelBubble = true;
return false;
}
}
/*
* Function: onSelect
* Description: This function disables the selection of text on the page
* unless the selection is done on an INPUT tag.
*/
function onSelect(){
if ( window.event.srcElement.tagName !="INPUT" ) {
window.event.returnValue = false;
window.event.cancelBubble = true;
}
}
/*
* Function: CommonOnload
* Description: This function should be called on page load,
* it activates the "onSelect" and "onContextMenu" functions.
*/
function CommonOnload(){
document.oncontextmenu = onContextMenu;
}
/*
* Function: ErrorHandler
* Description: This function is called when a JavaScript error occur.
* If the Alert line is unmarked then the error description will show on an alert window.
*/
function ErrorHandler(msg,url,lno)
{
alert(msg);
return (true);
}
/*
* Function: SetData
* Description: This function is called by the program to set the inner HTML of
* HTML objects such as DIV or SPAN
*/
function SetData(ar)
{
var a = new VBArray(ar);
var b = a.toArray();
delete a;
for (i=0; i<b.length; i++)
{
res = b[i].split("|SEPERATOR|");
try
{
var lsExpression;
lsExpression = "document.all." + res[0] + ".innerHTML = res[1]";
eval(lsExpression);
}
catch(e)
{
}
}
}
/*
* The following line causes the browser to call the "ErrorHandler" function every time
* error occur.
*/
window.onerror = ErrorHandler;