// -----------------------------------------------------------------------------// Generic Javascript Functions//// Copyright (C) 2001 - 2002 BeCom S.A. http://www.becom.gr// Distributed under the terms of the GNU Library General Public License// -----------------------------------------------------------------------------// String trimming functions - S.B.// -----------------------------------------------------------------------------function bjs_ltrim(str){
	for(var i=0;str.charAt(i)==" ";i++);
	return str.substring(i,str.length);
}
function bjs_rtrim(str){
	for(var i=str.length-1;str.charAt(i)==" ";i--);
	return str.substring(0,i+1);
}
function bjs_alltrim(str){return bjs_ltrim(bjs_rtrim(str));}
// -----------------------------------------------------------------------------
//Original:  David Salsinha (david.salsinha@popsi.pt)
// -----------------------------------------------------------------------------function Encrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
rnd = Math.round(Math.random() * 122) + 68;
Temp[i] = theText.charCodeAt(i) + rnd;
Temp2[i] = rnd;
}
for (i = 0; i < TextSize; i++) {
output += String.fromCharCode(Temp[i], Temp2[i]);
}
return output;
}
function unEncrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
Temp[i] = theText.charCodeAt(i);
Temp2[i] = theText.charCodeAt(i + 1);
}
for (i = 0; i < TextSize; i = i+2) {
output += String.fromCharCode(Temp[i] - Temp2[i]);
}
return output;
}
// -----------------------------------------------------------------------------
//Cookies
// -----------------------------------------------------------------------------
function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
function Delete_Cookie(name,path,domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
// -----------------------------------------------------------------------------
//Correct IE 5.5 Cursor error (SB)
// -----------------------------------------------------------------------------
var pointer = 'hand';
if (navigator.appName.toLowerCase().indexOf('microsoft') != -1){pointer = 'hand';} else {pointer = 'pointer';}