function onsabmit(){
   if(!loginForm.login.value || !loginForm.haslo.value)
   {
      alert('Please correct the form!'); 
      return false;
   }
}

function DgoPrepare(DgoName, HTML, isVis, isTit){
	document.write('<DIV id="'+DgoName+'" onmousedown="this.style.zIndex=MaxIndex++" style="Z-index:1px;position:absolute;display:none">' + DgoRedefine(DgoName, HTML, isTit) + '</DIV>');
	if (isVis) DgoON(O(DgoName));
}

function DgoShow(DgoName){
	DgoON(O(DgoName));
	DgoDock(O(DgoName),(getWindowSize()[0]/2-200),200);
}




var ObjRefContainer = new Array();
var DtrgObj='';
if (!window.MaxIndex) window.MaxIndex=2;


function O(id){
	return document.getElementById(id);
}

function DgoOb(obj){
	if (typeof(obj)=='string') return O(obj);
	else return obj;
}

function DgoON(obj){
	obj=DgoOb(obj);
	obj.style.display="inline";
	DgoCenter(obj);
	DgoBgDis(obj);
	obj.style.zIndex=MaxIndex++;
}

function DgoOFF(obj){
	obj=DgoOb(obj);
	DgoDetachEvent(window, 'onscroll', DgoCenterMove, 'ObjDgoCenterMoveId', obj.id);
	DgoDetachEvent(window, 'onresize', DgoCenterMove, 'ObjDgoCenterMoveId', obj.id);
	obj.style.display="none";
	DgoBgEna(obj);
}

function DgoTOG(obj){
	obj=DgoOb(obj);
	if (obj.style.display=="inline") DgoOFF(obj);
	else DgoON(obj);
}

function DgoAttachEvent(obj, sEvent, fHandler, refVar, refVal){
	obj=DgoOb(obj);
	if (refVar && refVal)eval('if(typeof(ObjRefContainer["'+refVar+'"])!= "array"){ObjRefContainer["'+refVar+'"]=new Array();}; ObjRefContainer["'+refVar+'"]["'+refVal+'"]=1;');
	if (typeof(obj.attachEvent) != 'undefined') obj.attachEvent(sEvent, fHandler);
	else if (typeof(obj.addEventListener) != 'undefined') obj.addEventListener(sEvent.replace(/^on/,''), fHandler, false);
}

function DgoDetachEvent(obj, sEvent, fHandler, refVar, refVal){
	obj=DgoOb(obj);
	if (refVar && refVal) eval('ObjRefContainer["'+refVar+'"]["'+refVal+'"]=0');
	if (typeof(obj.detachEvent) != 'undefined') obj.detachEvent(sEvent, fHandler);
	else if (typeof(obj.removeEventListener) != 'undefined') obj.removeEventListener(sEvent.replace(/^on/,''), fHandler, false)
}

function DgoMoveTo(obj,X,Y){
	obj=DgoOb(obj);
	obj.actX=(X>0)?X:0;
	obj.actY=(Y>0)?Y:0;
	obj.style.left=document.body.scrollLeft+X;
	obj.style.top=document.body.scrollTop+Y;
}

function DgoDock(obj,X,Y){
	obj=DgoOb(obj);
	if(X) obj.actX=X;
	if(Y) obj.actY=Y;
	obj.style.left=document.body.scrollLeft+obj.actX;
	obj.style.top=document.body.scrollTop+obj.actY;
}

function DgoCenter(obj){	
	obj=DgoOb(obj);
	DgoAttachEvent(window, 'onscroll', DgoCenterMove, 'ObjDgoCenterMoveId', obj.id);
	DgoAttachEvent(window, 'onresize', DgoCenterMove, 'ObjDgoCenterMoveId', obj.id);
	if(obj.offsetWidth==0){
		obj.actX=((document.body.clientWidth/2-obj.offsetWidth/2)>0)?document.body.clientWidth/2-464/2:0;
		obj.actY=((document.body.clientHeight/2-obj.offsetHeight/2)>0)?document.body.clientHeight/2-198/2:0;
	}else{
		obj.actX=((document.body.clientWidth/2-obj.offsetWidth/2)>0)?document.body.clientWidth/2-obj.offsetWidth/2:0;
		obj.actY=((document.body.clientHeight/2-obj.offsetHeight/2)>0)?document.body.clientHeight/2-obj.offsetHeight/2:0;
	}
	DgoMoveTo(obj,obj.actX,obj.actY);
	DgoCenterMove();
}

function DgoCenterMove(){
	if (typeof(ObjRefContainer["ObjDgoCenterMoveId"]) != 'undefined'){
		for (var objId in ObjRefContainer["ObjDgoCenterMoveId"]){
			if (ObjRefContainer["ObjDgoCenterMoveId"][objId]){
				obj = O(objId);
				X=document.body.scrollLeft+obj.actX;
				Y=document.body.scrollTop+obj.actY;
				X=X+obj.offsetWidth>document.body.clientWidth+document.body.scrollLeft?document.body.clientWidth+document.body.scrollLeft-obj.offsetWidth:X;X=X<0?0:X;
				Y=Y+obj.offsetHeight>document.body.clientHeight+document.body.scrollTop?document.body.clientHeight+document.body.scrollTop-obj.offsetHeight:Y;Y=Y<0?0:Y;
				obj.style.left=X;
				obj.style.top=Y;
			}
		}
	}
}

function DgoPutHtml(obj,HTML){
	obj=DgoOb(obj);
	obj.innerHTML=HTML;
}

function DgoGetHtml(obj){
	obj=DgoOb(obj);
	return obj.innerHTML;
}

function GetUrl(URL){
	var req = new ActiveXObject("Microsoft.XMLHTTP");
	req.open("GET",URL,false);	req.send();
	return req.responseText;
}

function DgoInTable(HTML){
	return '<TABLE cellspacing=0 cellpadding=0 border=0 id="cien"><TR><TD style="cursor:default;padding-right:8px;padding-bottom:8px;filter:shadow(direction=135,color=gray)"><DIV style="background-color:#FFFFFF; border:1px solid black;border-width:1px;border-style:solid;border-color:black">'+HTML+'</DIV></TD></TR></TABLE>';
}

function DgoD(){
	return false;
}

function DgoE(){
	return true;
}

function DgoMouseDown(e){
	obj = O(DtrgObj);
	document.body.onselectstart=DgoD;
	document.onmousedown=DgoD;
	if(!e) var e=window.event;
	DstartX = e.clientX; DstartY = e.clientY;
	DstartXo = obj.actX; DstartYo = obj.actY;
	document.onmousemove=DgoMouseMove;
	document.onmouseup=DgoMouseUp;
}

function DgoMouseUp(){
	document.onmousemove=DgoE;
	document.onmousedown=DgoE;
	document.body.onselectstart=DgoE;
}

function DgoMouseMove(e){
	obj = O(DtrgObj);
	if(!e)var e=window.event;
	vecX=e.clientX-DstartX;X=DstartXo+vecX;
	vecY=e.clientY-DstartY;Y=DstartYo+vecY;
	X=X+obj.offsetWidth>document.body.clientWidth?document.body.clientWidth-obj.offsetWidth:X;X=parseInt(X<0?0:X);
	Y=Y+obj.offsetHeight>document.body.clientHeight?document.body.clientHeight-obj.offsetHeight:Y;Y=parseInt(Y<0?0:Y);
	DgoMoveTo(obj,X,Y);
	return false;
}

function DgoRedefine(DgoName, HTML, isTit){
	if (typeof isTit == 'undefined') isTit = true;
	
	var Ret='';
	if (isTit){
		Ret+='<TABLE cellspacing=0 onMouseDown="DgoMouseDown(event);" id="Dtable_'+DgoName+'" onmouseover="DtrgObj=\''+DgoName+'\';" cellpadding=2 background="/_g/popover/tbar.gif" width="100%"><TR>';
		Ret+='<TD width="100%" style="font-size:1px;">&nbsp;</TD>';
		Ret+='<TD><BUTTON type=button style="background-image:url(/images/cms/blog/x.gif);padding:0px;cursor:pointer;width:14px;height:14px;margin-right:3px;border:1px solid #AEAEAE;border-color:#AEAEAE;border-style:solid;border-width:1px;" onclick="DgoOFF(O(\''+DgoName+'\'))"></BUTTON></TD>';
		Ret+='</TR></TABLE>';
	}
	
	Ret+='<DIV id="'+DgoName+'_" style="margin:10px;margin-top:0" nowrap>'+HTML+'</DIV>';
	Ret=DgoInTable(Ret);
	
	return Ret;
}

function DgoBgDis(obj){
	obj=DgoOb(obj);
	if(O('to_disable') && typeof(O('to_disable').filters)=='object') O('to_disable').filters.gray.enabled=1;
	if (O('glass')){
		O('glass').style.display='block';
		if (!O('glass').style.backgroundImage && typeof(O('to_disable').filters) == 'undefined'){
			O('glass').style.height = document.body.scrollHeight;
			O('glass').style.backgroundImage='url(/images/cms/blog/k.gif)';
		}
	}
}
	
function DgoBgEna(obj){
	obj=DgoOb(obj);
	if(O('to_disable') && typeof(O('to_disable').filters)!='undefined') to_disable.filters.gray.enabled=0;
	if(O('glass')) O('glass').style.display='none';
}

function getWindowSize(wnd){
	if (!wnd) wnd=window;
	var myWidth = 0, myHeight = 0;
	var test1 = wnd.document.body.scrollHeight;
	var test2 = wnd.document.body.offsetHeight;
	if (test1 > test2){ 

		myWidth = wnd.document.body.scrollWidth;
		myHeight = wnd.document.body.scrollHeight;
	}else{

		myWidth = wnd.document.body.offsetWidth;
		myHeight = wnd.document.body.offsetHeight;
	}
	return [myWidth,myHeight];
}