var hide;
hide=false;
var doc = document.all;

function ShowMenu(obj)
{

}

function HideMenu(obj)
{

}

function it(id)
{
var ret;
	if (document.getElementById) 
		ret = document.getElementById(id);
	else if (document.all)
		ret = document.all(id);
	else if (document.layers)
		ret = document.layers[id];
	else if (document[id])
		ret = document[id];
return ret; 
}


function findPosX(obj)
{
var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
		curtop += obj.offsetTop
		obj = obj.offsetParent;
		}
	}	
	else if (obj.y)
		curtop += obj.y;
return curtop;
}

function ResizeTo(w,h)
{
	 if (parseInt(navigator.appVersion)>3) 
	 {
	   if (navigator.appName=="Netscape") 
		{
		top.outerWidth=w;
		top.outerHeight=h;
		}
	   else top.resizeTo(w,h);
	 }
 }

var tmrall = new Array();

function Rozwin(t)
 {
	 if ((tmrall['z' + t])!=null)
	 {
		for(i=0;i<tmrall['z' + t].length;i++)
		{
			clearTimeout(tmrall['z' + t][i]);
		}
	 }
	var tmr=new Array();
	var index =0;
	for (i=it(t).height;i<20;i++) 
	 {
		tmr[index] = setTimeout("try{it('" + t + "').height='" + i + "px';}catch(error){}", ((i*i)/2)*4);
		index+=1;
	 }
	tmrall['r' + t]=tmr;
	trm=null;
}

function Zwin(t)
 {
	 if ((tmrall['r' + t])!=null)
	 {
		for(i=0;i<tmrall['r' + t].length;i++)
		{
			clearTimeout(tmrall['r' + t][i]);
		}
	 }

	var tmr=new Array();
 	var index =0;
	for (i=it(t).height;i>1;i--) 
	{	
		tmr[index] = setTimeout("try{it('" + t + "').height='" + i + "px';}catch(error){}", 200/i);
		index+=1;
	}
	tmrall['z' + t]=tmr;
	trm=null;
}

function trim (str) 
{
  while (str.charAt(0) == ' ')
    str = str.substring(1);
  while (str.charAt(str.length - 1) == ' ')
    str = str.substring(0, str.length - 1);
  return str;
}

function ShowIFR(navurl)
{
//'viewmessage.aspx?msgid=' + ob.id + '&ag=' + document.Form1.hidAg.value + '&siteid=' + ob.SiteID;
    if ((document.getElementById('tblIFR').style.display=='') && (navurl==cururl))
    {
        document.getElementById('tblIFR').style.display='none';
    }
    else
    {
      cururl=navurl;
        document.getElementById('tblIFR').style.display='';
        document.getElementById('tblIFR').style.top=((WindowHeight()/10) + getScrollXY()[1]) + 'px';
      document.getElementById('tblIFR').style.left=100;
      //alert(WindowHeight()/10);
      document.getElementById('showmessageIFR').style.height = (WindowHeight() - WindowHeight()/7);
      document.getElementById('showmessageIFR').style.width = (WindowWidth() - WindowWidth()/7);
      document.getElementById('showmessageIFR').src=navurl;
    }
}

function WindowWidth()
{
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
        //odejmowanie scrollbars
    if (parseInt(navigator.appVersion)>3) 
    {
    if (navigator.appName=="Netscape") {
      //myWidth=myWidth-16;
    }
    if (navigator.appName.indexOf("Microsoft")!=-1) {
      //myWidth=myWidth-20;
    }
    }
  return myWidth;
}
function WindowHeight()
{
    var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
    //odejmowanie scrollbars
    if (parseInt(navigator.appVersion)>3) 
    {
    if (navigator.appName=="Netscape") {
      myHeight=myHeight-16;
    }
    if (navigator.appName.indexOf("Microsoft")!=-1) {
      myHeight=myHeight-20;
    }
    }
  return myHeight;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}