﻿	function openWin(url,name,features,replace) {
		window.open(url,name,features,replace);
		return false;
	}
	function getPageWidth() {
		if (window.innerWidth) {
			xScroll = top.window.innerWidth;
		}
		else if (document.body.scrollWidth)
		{
			// all but Explorer Mac
			xScroll = top.document.body.scrollWidth;
		}
		else
		{
			// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = top.document.body.offsetWidth;
		}
		var windowWidth;
		if (self.innerWidth)
		{
			// all except Explorer
			windowWidth = top.self.innerWidth;
		}
		else if (document.documentElement && document.documentElement.clientWidth)
		{
			// Explorer 6 Strict Mode
			windowWidth = top.document.documentElement.clientWidth;
		}
		else if (document.body)
		{
			// other Explorers
			windowWidth = top.document.body.clientWidth;
		}
		if (xScroll < windowWidth)
		{
			pageWidth = windowWidth;
		}
		else
		{
			pageWidth = xScroll;
		}
		
		return pageWidth;
	}
	
	function getWindowHeight() {
		var windowHeight;
		if (self.innerHeight)
		{
			// all except Explorer
			windowHeight = top.self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
		{
			// Explorer 6 Strict Mode
			windowHeight = top.document.documentElement.clientHeight;
		}
		else if (document.body)
		{
			// other Explorers
			windowHeight = top.document.body.clientHeight;
		}
		return windowHeight;
	}
	
	function getPageHeight() {
		if (window.innerHeight && window.scrollMaxY)
		{
			yScroll = top.window.innerHeight + top.window.scrollMaxY;
		}
		else if (top.document.body.scrollHeight > top.document.body.offsetHeight)
		{
			// all but Explorer Mac
			yScroll = top.document.body.scrollHeight;
		}
		else
		{
			// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			yScroll = document.body.offsetHeight;
		}
		var windowHeight = getWindowHeight();

		// for small pages with total height less then height of the viewport
		if (yScroll < windowHeight)
		{
			pageHeight = windowHeight;
		}
		else
		{
			pageHeight = yScroll;
		}
		return pageHeight;
	}
	
  function getTop(e) {
    var t=e.offsetTop;
    while(e=e.offsetParent)t+=e.offsetTop;
    return t;
  }
  
  function getLeft(e) {   
    var l=e.offsetLeft;
    while(e=e.offsetParent)l+=e.offsetLeft;
    return l;
  }
  
  function getScrollTop() {
    var t;
    if (document.documentElement && document.documentElement.scrollTop) {
      t = document.documentElement.scrollTop;
    } else if(document.body) {
      t = document.body.scrollTop;
    }
    return t;
  }
  
  function getScrollLeft() {
    var l;
    if (document.documentElement && document.documentElement.scrollLeft) {
      l = document.documentElement.scrollLeft;
    } else if(document.body) {
      l = document.body.scrollLeft;
    }
    return l;
  }
