﻿function findPosition( oElement ) {
  if(oElement!=null){
      if( typeof( oElement.offsetParent ) != 'undefined' ) {
        for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
          posX += oElement.offsetLeft;
          posY += oElement.offsetTop;
        }
        return [ posX , posY ];
      } else {
        return [ oElement.x , oElement.y ];
      }
  }
  else
  {
    return null;
  }
}

function isdefined(variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}

