// global.js
//


//-----------------------------------------------------------------------------
// no right click
//
var message="";

function clickIE() {
	if (document.all) {
		(message);
		return false;
	}
}

function clickNS(e) {
	if (document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2 || e.which==3) {
			(message);
			return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;
}
else {
	document.onmouseup=clickNS;
	document.oncontextmenu=clickIE;
}

document.oncontextmenu=new Function("return false")


//-----------------------------------------------------------------------------
// bookmark site
//
var url="http://www.megasgroup.com/";
var title="Megas WiredLess Network";

function addbookmark() {
if (document.all)
	window.external.AddFavorite(url,title);
}


//-----------------------------------------------------------------------------
// popup window
//
//  newWindow(mypage,myname,w,h,pos,infocus,myscrollbars,myresizable)
//
var popup=null;
function newWindow(mypage,myname,w,h,pos,infocus,myscrollbars,myresizable){
	
	if(pos=="random"){
		myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		myleft=(screen.width)?(screen.width-w)/2:100;
		mytop=150;
		// mytop=(screen.height)?(screen.height-h)/2:100;
	}
	else {  // default to upper left
		myleft=20;
		mytop=20;
	}
	
	if(myresizable == "")
		myresizable = "no";
		
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=" + myscrollbars + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=" + myresizable;
	
	popup=window.open(mypage,myname,settings);
	popup.focus();
}


//-----------------------------------------------------------------------------
// 
//

