
/* Target=new replacement for valid xhtml strict */

/*
	Add an event to the window.onload property of the page.
*/
function addLoadEvent(func) {
	var oldonload = window.onload;

	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

/*
	Shorthand for document.getelementbyid
*/
function $(e) { return document.getElementById(e); }


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";
        }
}

addLoadEvent(externalLinks); 

/*
eyemg.Compose-specific javascript
*/

function pop_image(image,width,height) {
	window.open(escape(image),"","width="+width+",height="+height+",menubar=0,scrollbars=1,toolbar=0");
	return false;
}

function pop_image2(image,width,height) {
	window.open(image,"","width="+width+",height="+height+",menubar=0,scrollbars=1,toolbar=0");
	return false;
}

function pop(url) {
	var loc = window.location;
	window.open(url,'pop_resource','toolbar=0,menubar=0,location=0,scrollbars=1,height=500,width=600,resizable=1');
	return false;
}

function pop_window(url,width,height) {
	window.open(url,"info",'toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,height='+height+',width='+width);
	return false;
}

/*
print with print.css
*/
function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature. Please print by using the print menu in your browser");
}


