function getObj(o) {
  if (document.getElementById) {
    return document.getElementById(o);
  }
  else if (document.all) {
    return document.all(o);
  }
  else if (document.layers) {
    return document.layers(o);
  }
}

function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
      
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

function pageWidth() 
{
    return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;
}

function pageHeight() 
{
    return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;
}

function posLeft()
{
    return typeof window.pageXOffset != "undefined" ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft:document.body.scrollLeft ? document.body.scrollLeft : 0;
}

function posTop()
{
    return typeof window.pageYOffset != "undefined" ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

function posRight()
{
    return posLeft()+pageWidth();
}

function posBottom()
{
    return posTop()+pageHeight();
}

function Print(path) 
{
	openWindow(path + 'custom/print.aspx', 700, 620, 'yes');
}

function openWindow(loc,wdt,hgt,scroll, resizable) 
{	
	window.open(loc, 'win', 'height=' + hgt + ',width=' + wdt + ',top=120,left=100' + ',toolbar=yes,scrollbars=' + scroll + ',resizable=' + resizable);
}