function setfocus(src){
			var user = new getObj(src);
			
			user.obj.focus();
			try{
			user.obj.select();
			}
			catch(Exception){}
			window.scrollBy(0,300);
		}
		
function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
    if (this.obj != null)
    this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
    if (this.obj != null)
    this.style = document.all[name].style;
  }
  else if (document.layers)
  {
    this.obj = document.layers[name];
   if (this.obj != null)
    this.style = document.layers[name];
  }
}

function getObj2(name, doc)
{
  if (doc.getElementById)
  {
    this.obj = doc.getElementById(name);
    if (this.obj != null)
    this.style = doc.getElementById(name).style;
  }
  else if (doc.all)
  {
    this.obj = doc.all[name];
    if (this.obj != null)
    this.style = doc.all[name].style;
  }
  else if (doc.layers)
  {
    this.obj = doc.layers[name];
   if (this.obj != null)
    this.style = doc.layers[name];
  }
}
////////////////////////////////////
//simulation of modal dialog box.
var winModalWindow;
 
function IgnoreEvents(e)
{
  return false;
}
 
function ShowWindow(src, parms, width, height)
{
  if (window.showModalDialog)
  {
    window.showModalDialog(src,parms, "dialogWidth:" + width + "dialogHeight:" + height);
  }
  else
  {
    window.top.captureEvents (Event.CLICK|Event.FOCUS);
    window.top.onclick=IgnoreEvents;
    window.top.onfocus=HandleFocus ;
    winModalWindow = window.open (src,parms,"dependent=yes,width=" + width + ",height=" + height);
    winModalWindow.focus();
  }
}

 
function HandleFocus()
{
  if (winModalWindow)
  {
    if (!winModalWindow.closed)
    {
      winModalWindow.focus();
    }
    else
    {
      window.top.releaseEvents (Event.CLICK|Event.FOCUS);
      window.top.onclick = "";
    }
  }
  return false;
}

function getWindowSize(myWidth) {
	var myHeight = 100;
	var ary = new Array(2);
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myWidth -=28;
		myHeight = window.innerHeight;
		
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		
	}
	ary[0] = myWidth;
	ary[1] = myHeight;
	return ary;
}
