// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function popupLink(link){

	var w = 600;
	var h = 400;

	win=window.open(link,"","scrollbars=1, width=" + w + ",height=" + h)
	win.moveTo((screen.width-w)/2,(screen.height-h)/2)

}

function cancelBubble(e)
{
	if (!e) var e = window.event;
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
        // if (e.preventDefault) e.preventDefault();
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400,left = 340,top = 200');");
}

function addEvent(o,e,f){
	if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
	else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
	else { return false; }
}

