// JavaScript Document

var org= window.location.href.toString().toLowerCase();
var GD= (org.indexOf("ghostdevel/") > -1)? 'ghostdevel/' : '';
var token= randomToken();

if(!BLWIDGET_width) var BLWIDGET_width= 200; //will set defaults in php
if(!BLWIDGET_height) var BLWIDGET_height= 400; //will set defaults in php
if(!BLWIDGET_postcount) var BLWIDGET_postcount= 0; //will set defaults in php
BLWIDGET_width= intval(BLWIDGET_width); //converts to integer value, or 0 on failure
BLWIDGET_height= intval(BLWIDGET_height); //converts to integer value, or 0 on failure
BLWIDGET_postcount= intval(BLWIDGET_postcount); //converts to integer value, or 0 on failure
if(BLWIDGET_width < 200) BLWIDGET_width= 200; //keep it positive, up to minimum
if(BLWIDGET_height < 250) BLWIDGET_height= 250; //keep it positive, up to minimum
if(BLWIDGET_postcount < 0) BLWIDGET_postcount= 0; //keep it positive
<!-- Widget snippet code -->
var BLWIDGET_html= "\n<div align=\"center\">\n"
+"\t<iframe src=\"http://brainline.org/"+GD+"widget/widget_ATE.php?postcount="+BLWIDGET_postcount+"&width="+BLWIDGET_width+"&height="+BLWIDGET_height+"&token="+token+"\" width=\""+BLWIDGET_width+"\" height=\""+BLWIDGET_height+"\" scrolling=\"no\" frameborder=\"0\" >This widget requires iframes to be enabled!</iframe>\n"
+"</div>\n";
document.write(BLWIDGET_html);
<!-- End Widget snippet code -->

function randomToken(){
	var d= new Date();
	var randomNum= d.getMilliseconds()+1;
	return randomNum;
}
function intval(mixed_var, base) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: stensi
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: intval('Kevin van Zonneveld');
    // *     returns 1: 0
    // *     example 2: intval(4.2);
    // *     returns 2: 4
    // *     example 3: intval(42, 8);
    // *     returns 3: 42
    // *     example 4: intval('09');
    // *     returns 4: 9
 
    var tmp;
 
    var type = typeof( mixed_var );
 
    if(type == 'boolean'){
        if (mixed_var == true) {
            return 1;
        } else {
            return 0;
        }
    } else if(type == 'string'){
        tmp = parseInt(mixed_var * 1);
        if(isNaN(tmp) || !isFinite(tmp)){
            return 0;
        } else{
            return tmp.toString(base || 10);
        }
    } else if(type == 'number' && isFinite(mixed_var) ){
        return Math.floor(mixed_var);
    } else{
        return 0;
    }
}

