function openUrlRotator() {
	var url = rotators[current_rotator][4];
	if ((url != "")&&(url != "http://"))
		open_url(url);
}

function change_background(newColor) {
	document.body.parentNode.style.background = newColor;
	document.body.style.background = newColor;
}

/* trim string */
function trim(str) {
	return str.replace(/(^\s+)|(\s+$)/g, "");
}

function is_email(mail) {
	var pattern = /^[a-z0-9_\.-]{1,20}@(([a-z0-9-]+\.)+(com|net|org|mil|edu|gov|arpa|info|biz|inc|name|[a-z]{2,4})|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$/; 
	return pattern.test(trim(mail));
}

function is_name(name) {
	var pattern = /^([à-ÿÀ-ßa-zA-Z0-9])+$/;
	return pattern.test(trim(name));
}

function is_pass(pass) {
	var pattern = /^([a-zA-Z0-9])+$/;
	return pattern.test(trim(pass));
}

/* change pic src */
function change_pic(img, img_url) {
	img.src = img_url;
}

/* show hide div */
function show_hide(item, id) {
	var item_id = (id > 0) ? item + "_" + id : item;
	var f = document.getElementById(item_id);
	f.style.display = f.style.display == "none" ? "block" : "none";
}

