var xmlHttp;

try{xmlHttp=new XMLHttpRequest();}
catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){alert("Your browser does not support AJAX!");}}}

function _ms() {
	var d = new Date();
	return d.getTime();
}

function _gel(id) {
	return document.getElementById(id);
}

function getScreenPos(obj) {
	var ol = 0;
	var ot = 0;
	while (obj != null) {
		ol += obj.offsetLeft;
		ot += obj.offsetTop;
		obj = obj.offsetParent;
	}
	return {left:ol, top:ot};
} 

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
	 var anchor = anchors[i];
	 if (anchor.getAttribute("href") &&
			 anchor.getAttribute("rel") == "external")
		 anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function popup_window(theurl,w,h)
{
 // set the width and height
 var the_width=w;
 var the_height=h;
 // set window position
 var from_top=200;
 var from_left=200;
// set other attributes
// if(w>1000 || h>800)
 var has_scrollbars='no';
//else
//	var has_scrollbars='no';

 var has_toolbar='no';
 var has_location='no';
 var has_directories='no';
 var has_status='no';
 var has_menubar='no';
 
 var is_resizable='no';
 // attributes put together
 var the_atts='width='+the_width+'show,height='+the_height+',top='+from_top+',screenY='+from_top+',left='+from_left+',screenX='+from_left;
 the_atts+=',toolbar='+has_toolbar+',location='+has_location+',directories='+has_directories+',status='+has_status;
 the_atts+=',menubar='+has_menubar+',scrollbars='+has_scrollbars+',resizable='+is_resizable;
 // open window
 window.open(theurl,'',the_atts);
}

