function rand(l,u) // lower bound and upper bound
 {
     return Math.floor((Math.random() * (u-l+1))+l);
 }




function setCBTitle(titletext,closeX) {
 $('#cboxTitle').html(titletext);

if (closeX == "1") {
 $('#cboxClose').show();
}else{
 $('#cboxClose').hide();
}

// alert (closeX);
}

function nl2br (str, is_xhtml) {
    // Converts newlines to HTML line breaks  
    // 
    // version: 1008.1718
    // discuss at: http://phpjs.org/functions/nl2br    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Philip Peterson
    // +   improved by: Onno Marsman
    // +   improved by: Atli Þór
    // +   bugfixed by: Onno Marsman    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +   improved by: Maximusya
    // *     example 1: nl2br('Kevin\nvan\nZonneveld');    // *     returns 1: 'Kevin\nvan\nZonneveld'
    // *     example 2: nl2br("\nOne\nTwo\n\nThree\n", false);
    // *     returns 2: '<br>\nOne<br>\nTwo<br>\n<br>\nThree<br>\n'
    // *     example 3: nl2br("\nOne\nTwo\n\nThree\n", true);
    // *     returns 3: '\nOne\nTwo\n\nThree\n'    

    var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '' : '<br>';
     return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
}


function CheckZahl (e) {
  if (e.value<0 || e.value>99) {e.value=0;}

  if (isNaN(e.value)) {
    e.value = 0;
  }
}



function infobanner_show() {
$('#sponsorInfo').fadeOut(500);
var t=setTimeout("infobanner_hide()",10000);
}
function infobanner_hide() {
$('#sponsorInfo').fadeIn(500);
var t=setTimeout("infobanner_show()",10000);
}

