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 {
		}
	}
}
/*
$(document).ready(function(){
	window.alert = function(msg) {	   
	  $("body").append("<div class='message'>"+msg+"</div>");
	  var cssObj = {
	    'width':'500px',
	    'background-color' : '#fff',
	    'border' : '3px solid #ccc',
	    'margin-left' : '-250px',
	    'font-weight' : 'bold',
	    'color' : '#fd7b7b',
	    'padding': '15px 0px',
	    'position':'absolute',
	    'top':'30px',
	   	'left':'50%'
	  }
	  $(".message").css(cssObj);
	  if($(".message")) {
	  	$(".message").hide();		 
	  }
	 $(".message").show();
	   
	  window.setTimeout(function() {
	      $(".message").fadeOut("slow");
	  }, 1000);
	  
	}
});
*/

