function findSize() {
  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;
  }
  var rA = Array();
  rA[0] = myWidth;
  rA[1] = myHeight;
  return rA;
}
function x(a){
    return document.getElementById(a);
}

function setPos(){
    var elems = Array("contents","c");
    var dimensions = findSize();
    for(var i=0;i<elems.length;i++){ 
        var elem = x(elems[i]);
        if(elem){
            
	    if(elems[i]=="c"){
		elem.style.left = lim(dimensions[0]-12,920,100000)+"px";
		elem.style.top = lim(dimensions[1]/2,270,10000)+"px";
	    }else{
		elem.style.top = lim(dimensions[1]/2,220,10000)+"px";
		 elem.style.left = lim(dimensions[0]/2,450,10000)+"px";
	    }
        }
    }
    var top = x('navbartop')
    var topminwidth = 680;
    if(top){
	top.style.width = lim(dimensions[0]*0.9,topminwidth,100000)+"px";
    }
	return true;
}

function lim(v,min,max){
	
	if(v<min){
		return min;
	}
	if(v>max){
		return max;
	}
	return v;
}