
function window_open(url, win_width, win_height) {
	
	var screen_width = window.screen.width;
	var screen_height = window.screen.height;
	
	var win_left = screen_width / 2 - win_width / 2;
	var win_top = screen_height / 2 - win_height / 2;
	
	var win = window.open(url, "", "width=" + win_width + ", height=" + win_height + ", location=0, menubar=0, resizable=0, status=0, titlebar=0, toolbar=0, screenX=100, left=" + win_left + ", screenY=30, top=" + win_top);
 	
}

function window_open_resizable(url, win_width, win_height) {
	
	var screen_width = window.screen.width;
	var screen_height = window.screen.height;
	
	var win_left = screen_width / 2 - win_width / 2;
	var win_top = screen_height / 2 - win_height / 2;
	
	var win = window.open(url, "", "width=" + win_width + ", height=" + win_height + ", location=0, menubar=0, resizable=1,scrollbars=1 status=0, titlebar=0, toolbar=0, screenX=100, left=" + win_left + ", screenY=30, top=" + win_top);
 	
}

function addToFavorite(http, name) {
	var ie5 = navigator.userAgent.indexOf("MSIE 5") > -1;
	var ie6 = navigator.userAgent.indexOf("MSIE 6") > -1 && navigator.userAgent.indexOf("Opera") == -1;
	if (ie5 || ie6) {
		window.external.AddFavorite(http, name);
	}
}

function repaireEmail() {
	
	var emails = document.getElementsByName("email");
	
	for (var i = 0; i < emails.length; i += 1) {
		email_address = emails[i].title;
		if (email_address) {
			email_address = email_address.replace(/ at /i, "@");
			email_address = email_address.replace(/ dot /i, ".");
			emails[i].href = "mailto:" + email_address;
		}
	}
	
}