
function el(id) {
	return document.getElementById(id)
}

function show(id) {
    $('#'+id).slideDown();
}    

function hide(id) {
   $('#'+id).fadeOut();
}    

function show_hide(id) {
	if ($('#'+id).css('display') == 'none') {
		$('#'+id).slideDown();
	} else {
		$('#'+id).fadeOut();
	}
}	

function redirect(url) {
	window.location = url;
	return false;
}

function if_confirm(url) {
	if(confirm("Вы уверены?"))
		redirect(url);
}

function Submit(form) {
	f = document.forms[form];
	f.submit();
}

function bookmark(url, title) {
	if (!url) url = location.href;
	url = "http://www.mega-porno.ru";

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url, "");
	} else if (window.external) { // IE Favorite
		window.external.AddFavorite(url, title);
	} else if (window.opera && window.print) { // Opera Hotlist
		return true;
	}
}	

function Block(html, width, height, unblock) {
	$.blockUI(
		{ 
			message: html,
			css: { 
				width: '700px',
				top: '20%',
				left: '23%',
				padding: '5px', 
				backgroundColor: '#333333', 
				border: '1px solid #111111',
				color: '#f0ffff',
				cursor: 'default'
			}
		}
	); 
	if (unblock) $('.blockOverlay').attr('title','Click to unblock').click(UnBlock);
}
function UnBlock() {
	$.unblockUI();
}


function popup(link, width, height, resizable, scroll) {
    if (!window.focus) 
		return true;
	
	var href;
	if (typeof(link) == 'string')
   		href=link;
	else
   		href=link.href;
	if(!resizable) 
		resizable = 'yes';
	
	if(!scroll) 
		scroll = 'no';

	window.open(href, '', 'width='+width+',height='+height+',scrollbars='+scroll+',resizable='+resizable+',alwaysRaised=yes');
}

function simulateClick() {
  var evt = document.createEvent("MouseEvents");
  evt.initMouseEvent("click", true, true, window,
    0, 0, 0, 0, 0, true, true, true, true, 0, null);
  var cb = document.getElementById("_href"); 
	t = cb.dispatchEvent(evt);
  alert(t);
}
