/*добавить в Избранное*/
function bookmark(title,url) {
	if (!url) url = location.href;
	if (!title) title = document.title;
	//FF
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
	//IE4+
	else if (typeof window.external == "object") window.external.AddFavorite(url, title);
	//Opera7+
	else if (window.opera && document.createElement) {
		var a = document.createElement('A');
		if (!a) return false; //IF Opera 6
		a.setAttribute('rel','sidebar');
		a.setAttribute('href',url);
		a.setAttribute('title',title);
		a.click();
	}
	else return false;
	return true;
}
function gethostbyaddr(ip, dest) {
	params = {'ip': ip};
	new Ajax.Updater(
		dest, 
		'/js/ajax_server/get_host_by_addr.php', 
		{
			method: 'get',
			parameters: params,
			onCreate: function(process) {
				document.body.className = 'ajaxwait';
			},
			onComplete: function(complete) {
				document.body.className = '';
			}
		}
	);
}
function sf_submit(formid, txt, alerttxt){
	if ($F(formid) == txt || !$F(formid)) {
		alert (alerttxt);
		return false;
	} else {
		return true;
	}
}
function sf_focus(inputid, txt) {
	if ($F(inputid) == txt) {
		$(inputid).value = '';
	}
}
function sf_blur(inputid, txt) {
	if ($F(inputid) == '') {
		$(inputid).value = txt;
	}
}

function show_banner(zone, width, height) {
	if (!zone || !width || !height) {
		return false;
	}
	var code = "<iframe id='z"+zone+"' name='z"+zone+"' src='http://bs.9111.ru/www/delivery/afr.php?zoneid="+zone+"&amp;cb="+Math.random()+"' frameborder='0' scrolling='no' width='"+width+"' height='"+height+"'><a href='http://bs.9111.ru/www/delivery/ck.php?n=accc00f9&amp;cb="+Math.random()+"' target='_blank'><img src='http://bs.9111.ru/www/delivery/avw.php?zoneid="+zone+"&amp;cb="+Math.random()+"&amp;n=z"+zone+"'' border='0' alt='' /></a></iframe>";
	$('advzone'+zone).update(code);
}
function check_email(email) {
	if (!(/^([a-z\d\-\._]+)@{1}(([a-z\d\-]{1,67})|([a-z\d\-]+\.[a-z\d\-]{1,67}))\.(([a-z\d]{2,4})(\.[a-z\d]{2})?)$/.test(email))) {
		return false;
	} else {
		return true;
	}
}

