function showUserProMenuL(menuid)
{
	obj = document.getElementById('main'+menuid);
	obj.style.display = 'inline';
}





function showUserProMenu(menuid, left, top, content)
{	
	obj = document.getElementById('main'+menuid);
//	if(menuid == 'menu4')
	//	left -= 134;
	if(menuid == 'menu5')
		left -= 65;
	var wd = 1024;	
	if (document.all)
	{wd = document.body.clientWidth;}
	else
	{wd = window.innerWidth;}
	obj.style.left = left+((wd-820)*80/333)+20+'px';
	obj.style.top = top+103+'px';
	//obj.innerHTML = '<div align="left" style="padding-bottom:10px;">'+content+'</div>';
	obj.style.display = 'inline';
}



function hideUserProMenu(menuid)
{
	obj = document.getElementById('main'+menuid);
	obj.style.display = 'none';
}



function popup_show(id)
{
  var element      = document.getElementById(id);  

  var width        = window.innerWidth  ? window.innerWidth  : document.documentElement.clientWidth;
  var height       = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;

  element.style.position = "absolute";
  element.style.display  = "block";

  element.style.left = (document.documentElement.scrollLeft+(width -350 )/2)+'px';
  element.style.top  = (document.documentElement.scrollTop +(height-250)/2)+'px';
}



function regme()
{
	if((document.frmregister.txtname.value != "")
	 &&(document.frmregister.txtmail.value != "")&&(document.frmregister.txtpass1.value != "")&&(document.frmregister.txtpass2.value != ""))
	{
		document.frmregister.submit();
	}
	else
	{
		alert('Мэдээллийг гүйцэт бөглөнө үү!');
	}
}



function checkdata()
{
	if((document.frmaddnews.txtnewstitle.value != "")&&(document.frmaddnews.txtzar.value != "")
		&&(document.frmaddnews.txtphone.value != ""))
	{
		document.frmaddnews.submit();
	}
	else
	{
		alert('Мэдээллийг гүйцэт бөглөнө үү!');
	}
}


function loadajax(url, container, param)
{
	$('#loading').show();
	if(container == '#popup')
	{
		$('#popup').css("top", (($(window).height() - $('#popup').outerHeight()) / 2) + $(window).scrollTop() + "px");
	    $('#popup').css("left", (($(window).width() - $('#popup').outerWidth()) / 2) + $(window).scrollLeft() + "px");
		$('#popup').show();
	}
	$.ajax({
		  url: url,	
		  type: "GET",
		  data: param,		
		  cache: false,
		  success: function (html) {				
			  $(container).html(html);
			  $('#loading').hide();
		  }		
	  });
}
