function _pop(scroll, url, width, height, name) {
	if (typeof(width) == "undefined") { width=screen.width; }
	if (typeof(height) == "undefined") { height=screen.height; }
	if (name!=true) { var rnd = (Math.round((Math.random()*999)+1)); }
	else { var rnd="x"; }
	var top=Math.floor((screen.availHeight-height)/2)-(screen.height-screen.availHeight);
	var left=Math.floor((screen.availWidth-width)/2)-(screen.width-screen.availWidth);
	window.open(url, "w"+rnd, "top="+top+", left="+left+", width="+width+", height="+height+", buttons=no, scrollbars="+(scroll?"yes":"no")+", location=no, menubar=no, resizable="+(scroll?"yes":"no")+", status=no, directories=no, toolbar=no");
}

function _popup(url, width, height,name) {
	_pop(false, url, width, height, name);
    void(0);
}

function _popupR(url, width, height,name) {
	_pop(true, url, width, height, name);
    void(0);
}

function bindEvent(object, event, func) {
    if(object.attachEvent) {
		object.attachEvent('on'+event, func);
	} else {
		if(object.addEventListener) {
			object.addEventListener(event, func, false);
		} else {
		}
	}
}

function unBindEvent(object, event, func) {
    if(object.attachEvent) {
		object.dettachEvent('on'+event, func);
    } else {
		if(object.addEventListener) {
			object.removeEventListener(event, func, false);
		} else {
		}
	}
}



