//OPEN WIN POP UP
function openwin(url, name, options)
{
	var win = window.open(url, name, options);
}
//EXPAND Terms&Conditions most used
function expandItem(obj)
{
	var el = document.getElementById(obj);
	var ar = document.getElementById("expDiv").getElementsByTagName("div");
	var ex = document.getElementById("ex"+obj);
	if(el.style.display != "block")
	{
		el.style.display = "block";
		ex.innerHTML = '[-]';
	}
	else
	{
		el.style.display = "none";
		ex.innerHTML = '[+]';
	}
}
function pageHeight()
{
	var y;
	if (self.innerHeight) // all except Explorer
	{
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		y = document.body.clientHeight;
	}
	return y;
}

function pageWidth()
{
	var x;
	if (self.innerWidth)// all except Explorer
	{
		x = self.innerWidth;
	}else if(document.documentElement && document.documentElement.clientWidth)// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
	}
	else if(document.body)// other Explorers
	{
		x = document.body.clientWidth;
	}
	return x;
}

function findLeft(obj)
{
	var foo = document.getElementById(obj);
	var curleft = 0;
	if (foo.offsetParent)
	{
		curleft = foo.offsetLeft;
		while (foo == foo.offsetParent)
		{
			curleft += foo.offsetLeft;
		}
	}
	return curleft;
}

function findTop(obj)
{
	var foo = document.getElementById(obj);
	var curltop = 0;
	if (foo.offsetParent)
	{
		curltop = foo.offsetTop;
		while (foo == foo.offsetParent)
		{
			curltop += foo.offsetTop;
		}
	}
	return curltop;
}
////////////////////// GAME POP UP//////////////////////
function gamePop(url, name, width, height, resizable, scrollbars) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  str += ",resizable=" + resizable + ",scrollbars=" + scrollbars;
  if (window.screen) {
    var ah = screen.availHeight - 0;
    var aw = screen.availWidth - 0;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  var win =  window.open(url, name, str);
  if (window.focus) {win.focus()}
}

function popup (url) {
		window.open(url,'hwpopup','top=20, left=10,width=350,height=300,scrollbars=1,resizable=yes');
		history.go(0);
}