function openRegistrationWindow()
{
	OpenModalWindow4("/spravka/registration1.aspx", "registration", 620,450);
	
}
function beginICQWatch()
{
	UserICQGate.HaveNewMessages(lookupNewMsg_callback);
	setTimeout("beginICQWatch()", 11000);
}
// 0 - img
// i - swf
var icqDivStatus=0;
function lookupNewMsg_callback(res)
{
	if (res.error!=null) {alert(res.error); return;}
	if (res.value==null) 
	{
		ClearIcq();
		return;
	}
	IncomingIcq();
}

function openUserPager()
{
	OpenModalWindow4("/Spravka/Support/userPager.aspx", "", 640,640);
}
function showGuestDialog(tbNameId)
{
var name = document.getElementById(tbNameId).value;
	OpenModalWindow4("/Spravka/Support/userPager.aspx?UserName=" + name, "", 640,640);
}

function IncomingIcq()
{
if (	icqDivStatus==1) return;
	var msgDiv= document.getElementById('icqSpan');
	msgDiv.innerHTML="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='16' height='14'><param name='movie' value='/Spravka/Support/SWF/2.swf'><param name=quality value=high><embed src='/Spravka/Support/SWF/2.swf' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='16' height='14'></embed></object>";
	icqDivStatus=1;
}
function ClearIcq()
{
	if (	icqDivStatus==0) return;
	var msgDiv= document.getElementById('icqSpan');
	msgDiv.innerHTML="<IMG src='/Spravka/images/Icons/icq.gif' align=absMiddle>";
	icqDivStatus=0;
}

function resizeIt(obj)
{
	if (obj.height==50) 
	{
		obj.height=200;
		var newSrc = obj.src.replace("lo.jpg", ".jpg")
		obj.src=newSrc;
	}
	else 
	{
		obj.height=50;
	}
}

function resizeIt2(obj)
{
	if (obj.height==50) obj.height=100; else obj.height=50;
}

function OpenModalWindow4(url, name, w,h)
{
	var l = (window.screen.availWidth-w)/2; 
	var t = (window.screen.availHeight-h-22)/2; 
	newWin = window.open(url,name,'width=' + w + ' height=' + h + ' top=' + t + ' left=' + l + ' status=no toolbar=no menubar=no scrollbars=yes resizable=yes');
	newWin.focus();
}

function OpenModalWindow3(url, w,h)
{
	var l = (window.screen.availWidth-w)/2; 
	var t = (window.screen.availHeight-h-22)/2; 
	newWin = window.open(url,"",'width=' + w + ' height=' + h + ' top=' + t + ' left=' + l + ' status=no toolbar=no menubar=no scrollbars=yes resizable=yes');
	newWin.focus();
}

function OpenModalWindow1(url)
{
	var w = window.screen.availWidth-10; 
	var h = window.screen.availHeight-44; 
	newWin = window.open(url,'','width=' + w + ' height=' + h + ' top=0 left=0 status=no toolbar=no menubar=no scrollbars=yes resizable=yes');
	newWin.focus();
}

function OpenFixedModalWindow3(url,w,h)
{
	window.showModalDialog(url,'','center:yes;dialogHeight:' + h + 'px; dialogWidth:' + w + 'px;');
	//window.open(url,'','center:yes;dialogHeight:' + h + 'px; dialogWidth:' + w + 'px;');
}
