var bG = {
  // initialisation function, call with load
  init: function() {
    if (!document.getElementById) return;     
    
    var isMSIE = /*@cc_on!@*/false;
    if (isMSIE) {
    	return;
    }
    
    		
    bG.right = document.getElementById('right-cont');		
    
		bG.addEvent(window, 'resize', bG.updateHeight, false);		
		bG.updateHeight();
				
  },
  
  updateHeight: function() {
    bG.viewwidth = bG.getBrowserWidth();
    
    var diff = bG.viewwidth - 210 - 17;
    
    
		var diffpx = ''+diff+'px';
    bG.right.style.width = diffpx;
		
  },
  
  getBrowserHeight: function(){
		if (window.innerHeight){
			return window.innerHeight;}	
		else if (document.documentElement && document.documentElement.clientHeight != 0){
			return document.documentElement.clientHeight;	}
		else if (document.body){return document.body.clientHeight;}		
			return 0;
	},
  
  getBrowserWidth: function(){
		if (window.innerWidth){
			return window.innerWidth;}	
		else if (document.documentElement && document.documentElement.clientWidth != 0){
			return document.documentElement.clientWidth;	}
		else if (document.body){return document.body.clientWidth;}		
			return 0;
	},
  
  // function to add event listener, also caches events so they can be removed when the
	// page unloads to avoid memory leaks in IE
  addEvent: function(elm, evType, fn, useCapture) {
		// for W3C DOM complience
    if (elm.addEventListener) {
      elm.addEventListener(evType, fn, useCapture);
      return true;
    } 
		// for IE...
		else if (elm.attachEvent) {
      var r = elm.attachEvent('on' + evType, fn);
      //EventCache.add(elm, evType, fn);
      return r;
    } else {
			// for anyone else not IE or Moz... Safari etc
      elm['on' + evType] = fn;
    }
  }
  
	
}

bG.addEvent(window, 'load', bG.init, false);