wraphandler = {
  init: function() {
    if (!document.getElementById) return;
    wraphandler.setWrapper();
    wraphandler.addEvent(window,"resize", wraphandler.setWrapper);
  },

  setWrapper: function() {
    var divobj = document.getElementById("spacerdiv");
	var theWidth = 0;
    if (window.innerWidth) {
		theWidth = window.innerWidth
    } else if (document.documentElement && document.documentElement.clientWidth) {
		theWidth = document.documentElement.clientWidth
    } else if (document.body) {
		theWidth = document.body.clientWidth
    }
	if (parseInt(theWidth)/2-410 > 0) {
	  divobj.style.width = (parseInt(theWidth)/2-410)+ "px";
	  if (document.getElementById("kammon")) document.getElementById("kammon").style.left = (parseInt(theWidth)/2-410) + "px";
	} else { 
	  divobj.style.width = "0px"; 
	}
  },
  
   addEvent: function( obj, type, fn ) {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn] ( window.event );}
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else {
      obj.addEventListener( type, fn, false );
    }
  }
}
wraphandler.addEvent(window,"load", wraphandler.init);

var newWin = null; 
function popUp(strURL, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
   strOptions="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=80,left=50,height=" + strHeight + ",width=" + strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}

