function openPopup() 
{
	var url = this.href;
	window.open(url, "popup_id", "scrollbars,resizable,width=800,height=600");
	return false;
}
function popup_init() 
{
	var popups = getElementsByClassName("popup");
	for(var i=0;i<popups.length;i++) 
	{

		popups[i].onclick=openPopup;
	}
}

//Get all the elements of the given classname of the given tag.
function getElementsByClassName(classname,tag) 
{
	if(!tag) tag = "*";
	var anchs =  document.getElementsByTagName(tag);
	var total_anchs = anchs.length;
	var regexp = new RegExp('\\b' + classname + '\\b');
	var class_items = new Array()

	for(var i=0;i<total_anchs;i++) 
	{ //Go thru all the links seaching for the class name
		var this_item = anchs[i];
		if(regexp.test(this_item.className)) 
		{
			class_items.push(this_item);
		}
	}
	return class_items;
}




function addOnload(newFunction) {
	var oldOnload = window.onload;
	
	if (typeof oldOnload == "function") {
		window.onload = function() {
			if (oldOnload) {
				oldOnload();
			}
			newFunction();
		}
	}
	else {
		window.onload = newFunction;
	} 
}

addOnload(popup_init);
