﻿function CreatePopup(url, width, height)
{
    window.open (url, null, "location=0,status=1,scrollbars=1,resizable=1', width=" + width + ", height=" + height + "");
    return false;
}
function getWindowSize() { 
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    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;
  }
  return [myWidth, myHeight];
}
function resizeWindow(){
  height = (document.body.clientHeight<window.screen.height-160?document.body.clientHeight : window.screen.height-160)
  width = (document.body.clientWidth<window.screen.width-8?document.body.clientWidth : window.screen.width-8)
  window.resizeBy(width-getWindowSize()[0]+4,height-getWindowSize()[1]+30);
}
function resizeWindowHeight(){
   height = (document.body.clientHeight<window.screen.height-160?document.body.clientHeight : window.screen.height-160)
   window.resizeBy(0,height-getWindowSize()[1]+30);
}
function resizeWindowWidth(){
   width = (document.body.clientWidth<window.screen.width-8?document.body.clientWidth : window.screen.width-8)
   window.resizeBy(document.body.clientWidth-getWindowSize()[0]+4,0);
}


