function goBack() { history.go(-1); }

function goTo(url) { window.location.href = url; }

function waitThenGoTo(url,time) {
    if(time < 100) time = time * 1000;
    setTimeout("goTo('"+url+"')",time);
}

function waitThenGoBack(time) {
	if(time < 1000) time = time * 1000;
	setTimeout('goBack()',time);
}

function reload() { window.reload(); }

function isInt(sText) {
    var ValidChars = "0123456789";
    var isInt=true;
    var Char;

    for (i = 0; i < sText.length && isInt == true; i++) {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1) isInt = false;
    }
    return isInt;
}

function noLeadingZero(input) {
    if((input.length > 1) && (input.substr(0,1) == "0")) return input.substr(1);
    else return input;
}

function datetounixtime(hour, minute, second, month, day, year) {
    var humDate = new Date(Date.UTC(year, (noLeadingZero(month)-1),
     noLeadingZero(day), noLeadingZero(hour), noLeadingZero(minute), noLeadingZero(second)));
    return (humDate.getTime()/1000.0);
}

function ucfirst(str) {
    str += '';
    var f = str.charAt(0).toUpperCase();
    return f + str.substr(1);
}

function convertEmail(sDom, sUser){
  return("mail"+"to:"+sUser.replace(/%23/g,".").replace(/%24/g,"-")+"@"+sDom.replace(/%23/g,".").replace(/%24/g,"-"));
}

var system = new function() {
    this.basepath = "/";

    this.setBasepath = function(basepath) {
        this.basepath = basepath;
    }
}

$(function() {
    $('.ok_message, .error_message, .info_message').fadeOut(4000);
    Shadowbox.init();
});
