
var timed = 0;
var scrollGo = false;
var delay=150;
var space=100;
function statusbar_scroll() {
	var i=0;
	msg="pinottinet.com |||the open source portal|||";
	for (i=0;i<space;i++) msg=" "+msg;
	scrollGo=true;
	timerid=window.setTimeout("scrollmsg(0)",delay);
}
function scrollmsg(pos) {
	var out = "";
	scrollGo=false;
	if (pos < msg.length-2)
		self.status = msg.substring(pos, msg.length);
	else
		pos=-3;
	pos += 3;
	scrollGo=true;
	timerid=window.setTimeout("scrollmsg("+pos+")",delay);
}

var bookmarkurl="http://www.pinottinet.com/"
var bookmarktitle="pinottinet.com |||the open source portal|||"
function addbookmark() {
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function popUp(page) {
	// center popup on mouse cursor
	w = 480; h = 460;
	x = xMousePos-w/2; y = yMousePos-h/2-20;
	// ensure popup is within page's margins
	x = mmin(x, xMousePosMax-w); y = mmin(y,yMousePosMax-h);
	window.open(page, "msg", 'width='+w+',height='+h+',directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,top='+y+',left='+x).focus();
}
function mmin(v1, v2) {
	if (v1 < v2) return v1;
	else return v2;
}

if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} 
else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} 
else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page
function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX; yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset; yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft; yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft; yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX; yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset; yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

function getCookie(name) {

    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}


