var version = 2.1;
var v = 0;

function openFullScreenChat(urlname, windowname)
{
	if (document.all)
	{
		var w = screen.width - window.screenLeft - 10;
		var h = screen.height - window.screenTop;
		var win = window.open(urlname, windowname, "resizable=1, width="+w+",height="+h+",status=1");
		win.moveTo(0,0);
	}
	else
	{
		window.open(urlname, windowname, "resizable=1, fullscreen=1");
	}
}

function openNormalClient()
{
	var openURL=window.document.location.href;
	var win = window.open("client.html?init_url="+openURL, "_123livehelp_normalclientdemo"+Math.round(Math.random()*1000), "resizable=1, width=495,height=440,status=1");
}

function openCustomClient1()
{
	var win_width = document.customForm.win_width.value;
	var win_height = document.customForm.win_height.value;
	if (win_width < 495)
	{
		alert("width can't be less than 495");
		return;
	}
	
	if (win_height < 440)
	{
		alert("height can't be less than 440");
		return;	
	}
	
	var urlStr="client.html";
	
	var win_color=document.customForm.win_color.value;
	urlStr=urlStr+"?init_preColor="+win_color;
	
	var openURL=window.document.location.href;
	urlStr=urlStr+"&init_url="+openURL;
	
	var win = window.open(urlStr,"_123livehelp_customclientdemo"+Math.round(Math.random()*1000), "resizable=1, width=" + win_width + ",height=" + win_height + ",status=1");
}

function openCustomClient2()
{
	var urlStr="client.html";
	var init_nickname=document.customForm.init_nickname.value;
	urlStr=urlStr+"?init_nickname="+init_nickname;
	
	var init_room=document.customForm.init_room.value;
  urlStr=urlStr+"&init_room="+init_room;

	var openURL=window.document.location.href;
	urlStr=urlStr+"&init_url="+openURL;
	
	var win = window.open(urlStr,"_123livehelp_customclientdemo"+Math.round(Math.random()*1000), "resizable=1, width=495,height=440,status=1");
}

function displayStatusImg(onlineImg, offlineImg)
{
	var htmlcode = (s == 1) ? onlineImg : offlineImg;
	htmlcode = "<a href='client.html' target='_123livehelp_normalclientdemo' onclick='openNormalClient();return false;'><img src='" + htmlcode + "' border='0'></a>";
	document.write(htmlcode);
}


