//get Window height for explorer
    function getWindowHeight(win) { if (win == undefined) win = window; if (win.innerHeight) { return win.innerHeight; } else { if (win.document.documentElement && win.document.documentElement.clientHeight) { return win.document.documentElement.clientHeight; } return win.document.body.offsetHeight; } }

//get Window width for explorer
    function getWindowWidth(win) { if (win == undefined) win = window; if (win.innerWidth) { return win.innerWidth; } else { if (win.document.documentElement && win.document.documentElement.clientWidth) { return win.document.documentElement.clientWidth; } return win.document.body.offsetWidth; } }


//position script
	function pos() {
			//get sizes
				/*
				if (document.all) { 
									var header_width = document.all.header.offsetWidth;
									} 
				else {
									var header_width = document.getElementById('header').offsetWidth;
				}*/

				
				if (getWindowWidth()<1000) {
					if (document.all) { 
						document.getElementById('header').style.backgroundPosition = '0px -562px';
						document.getElementById('header').style.height = '188px';
					} 
					document.getElementById('main').style.margin = '0 auto';
					document.getElementById('header').style.marginBottom = '-4.8%';
				} else if (getWindowWidth()<1200) {
					if (document.all) { 
						document.getElementById('header').style.backgroundPosition = '0px -282px';		
						document.getElementById('header').style.height = '235px';			
					}
					document.getElementById('main').style.margin = '0 9.5% 0 11.5%';
					document.getElementById('header').style.marginBottom = '-7.3%';
				} else {
					if (document.all) { 
						document.getElementById('header').style.backgroundPosition = '0px 0px';
						document.getElementById('header').style.height = '282px';	
						document.getElementById('header').style.marginBottom = '-9.8%';
					}
					document.getElementById('main').style.margin = '0 9.5% 0 11.5%';
					document.getElementById('header').style.marginBottom = '-9.8%';
				}

	}


// init
	function init () {
		pos();
        initFontSize();
	}

// register window events
	window.addEventListener?window.addEventListener("resize",pos,false):window.attachEvent("onresize",pos);
	window.addEventListener?window.addEventListener("load",init,false):window.attachEvent("onload",init);


// popups
function open_function(url,width,height,options)
  {
    if ( height > screen.availHeight || width > screen.availWidth) {
      if ( options.indexOf( "scrollbars=") < 0) {
        if ( height > screen.availHeight)
          height = screen.availHeight;
        if ( width > screen.availWidth)
          width = screen.availWidth;
        options += ",scrollbars=yes";
      }
    }
    self.msgWindow = open(url, "Window", "width=" + (width+36) + ",height=" + (height+30)
      + ",screenX=" + (screen.width-width)/2
      + ",screenY=" + (screen.height-height)/2
      + ",dependent=yes"
      + ",left=" + (screen.width-width)/2
      + ",top=" + (screen.height-height)/2
      + options
      );

    if (self.msgWindow) {
      self.msgWindow.focus();
      if (self.msgWindow.opener == null) self.msgWindow.opener = self;
    }
  }

function get_url (url, k0 ,v0 ,k1 ,v1 ,k2 ,v2 ,k3 ,v3 ,k4 ,v4 ) 
{
  if (k0 && v0) url += "?" + k0 + "=" + escape(v0);
  if (k1 && v1) url += "&" + k1 + "=" + escape(v1);
  if (k2 && v2) url += "&" + k2 + "=" + escape(v2);
  if (k3 && v3) url += "&" + k3 + "=" + escape(v3);
  if (k4 && v4) url += "&" + k4 + "=" + escape(v4);
  return url;
}

// gsk popup

function nwr(x,w,h,t,l,n){
	if (h == "") h = 100;
       if (w == "") w = 100;
       if (t == "") t = 10;
       if (l == "") l = 10;
       if (n == "") n = "login";
       	var xx = "top="+t+",left="+l+",width="+w+ ",height="+h+", directories=0, status=1, scrollbars=1, resizable=1, toolbar=0,menubar=0";
		msgWindow=window.open(x,n,xx);
		msgWindow.focus();
}
