function bookmarksite(title, url)
{
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}


var w_url='tcd-contact.html';
var w_title='totcedoresti.ro';
var w_w=400;
var w_h=400;
var w_settings='status=yes,toolbar=no,menubar=no,location=no,scrollbars=auto,resizable=no';
var w_settings_p='';
function nw(w_url,w_title,w_w,w_h,w_settings_p)
{
  var winl = (screen.width - w_w) / 2;
  var wint = (screen.height - w_h) / 2;
  w_settings+=',width='+w_w+',height='+w_h;
  w_settings+=',top='+wint+',left='+winl;
  if(w_settings_p) w_settings+=','+w_settings_p;
  window.open(w_url, w_title, w_settings);
  w_settings='';
}


var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function emailD(inp)
{
var out = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
var base64test = /[^A-Za-z0-9\+\/\=]/g;
if (base64test.exec(inp)) {
}
inp = inp.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {

enc1 = keyStr.indexOf(inp.charAt(i++));
enc2 = keyStr.indexOf(inp.charAt(i++));
enc3 = keyStr.indexOf(inp.charAt(i++));
enc4 = keyStr.indexOf(inp.charAt(i++));

chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;

out = out + String.fromCharCode(chr1);
if (enc3 != 64) {
out = out + String.fromCharCode(chr2);
}
if (enc4 != 64) {
out = out + String.fromCharCode(chr3);
}
chr1 = chr2 = chr3 = "";
enc1 = enc2 = enc3 = enc4 = "";
} while (i < inp.length);
return out;
}


function changeTitle(titlun){
 document.title = titlun;
}


//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
function addLoadEvent(func)
{
        var oldonload = window.onload;
        if (typeof window.onload != 'function'){
            window.onload = func;
        } else {
                window.onload = function(){
                oldonload();
                func();
                }
        }

}

