var version = 6.4;
var versionstr = "6.4";
var v = 0;

function openFullScreenChat(url)
{
	if (document.all)
	{
		var w = screen.width - window.screenLeft - 10;
		var h = screen.height - window.screenTop;
		var win = window.open(url, "_123FullscreenDemo", "resizable=1, width="+w+",height="+h+",status=1");
		win.moveTo(0,0);
	}
	else
	{
		window.open(url, "_123FullscreenDemo", "resizable=1, fullscreen=1");
	}
}

function openPrivateWin(winId,w,h)
{
	window.open ("privatewin.html?"+winId, "privateMsg_"+winId, "height="+h+", width="+w+", top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
}

function openCustomLiteClient(win_width,win_height)
{
	var win_width = window.screen.width - 5;
	var win_height = window.screen.Height - 10;
	
	if(document.customForm.customsize[0].checked==true)
	{
			win_width=document.customForm.win_width.value;
			win_height=document.customForm.win_height.value;
	}
	
	if (win_width < 270)
	{
		alert("width can't be less than 270");
		return;
	}
	
	if (win_height < 200)
	{
		alert("height can't be less than 200");
		return;	
	}
	
	var init_user=document.customForm.init_user.value;
	var init_password=document.customForm.init_password.value;
	var init_room=document.customForm.init_room[document.customForm.init_room.selectedIndex].value;
	var url="lite_client.html?init_user="+init_user+"&init_password="+init_password+"&init_room="+init_room;
	if(document.customForm.customsize[0].checked==true)
	{
	  var win = window.open(url, "_123flashchat_lite", "resizable=1, width=" + win_width + ",height=" + win_height + ",status=1,top=0,left=0");
  }
	else
	{
				var win = window.open(url, "_123flashchat_fullscreen_lite", "resizable=1, fullscreen=1");
	}
}

function openCustomStandardClient()
{
	var win_width = window.screen.width - 5;
	var win_height = window.screen.Height - 10;
	if(document.customForm.customsize[0].checked==true)
	{
			win_width=document.customForm.win_width.value;
			win_height=document.customForm.win_height.value;
	}
	
	if (win_width < 634)
	{
		alert("width can't be less than 634");
		return;
	}
	
	if (win_height < 476)
	{
		alert("height can't be less than 476");
		return;	
	}
	
	var urlStr="standard.html";
	var init_user;
	var init_password="";
	var init_room;
	var init_skin=document.customForm.init_skin[document.customForm.init_skin.selectedIndex].value;
	var init_lang=document.customForm.init_lang[document.customForm.init_lang.selectedIndex].value;
	
	if(document.customForm.autologin[1].checked==true)
	{
			init_user=document.customForm.init_user.value;
	}
	
	if(document.customForm.roomlist[document.customForm.roomlist.selectedIndex].value=="true")
	{
			init_room="1";
	}
	
	var init_ad=document.customForm.adbanner[document.customForm.adbanner.selectedIndex].value;

	if(init_user!=undefined)
	{
		urlStr=(urlStr.indexOf("?")==-1)?urlStr+"?init_user="+init_user:urlStr+"&init_user="+init_user;	
		urlStr+="&init_password="+init_password;
	}

	if(init_room!=undefined)
	{
		urlStr=(urlStr.indexOf("?")==-1)?urlStr+"?init_room="+init_room:urlStr+"&init_room="+init_room;
		if(init_user==undefined)
		{
			init_user="guest";
		}
		urlStr+="&init_user="+init_user;
		urlStr+="&init_password="+init_password;
	}
	
	if(init_lang!="*")
	{
		urlStr=(urlStr.indexOf("?")==-1)?urlStr+"?init_lang="+init_lang:urlStr+"&init_lang="+init_lang;
	}
	urlStr=(urlStr.indexOf("?")==-1)?urlStr+"?init_skin="+init_skin:urlStr+"&init_skin="+init_skin;
	urlStr+="&init_ad="+init_ad;
	if(document.customForm.customsize[0].checked==true)
	{
		var win = window.open(urlStr, "_123flashchat_demo", "resizable=1, width=" + win_width + ",height=" + win_height + ",status=1,top=0,left=0");
  }
	else
	{
				var win = window.open(urlStr, "_123flashchat_fullscreen_demo", "resizable=1, fullscreen=1");
	}
}
