var resizeWindow = function(){
	var img = document. getElementsByTagName("img");
	if( img.length == 1 ){
		setWin(img[0].width, img[0].height);
	}
	
}

var setWin = function( w, h ){

	if(window.innerHeight != undefined ){
		window.innerHeight = h+20;
		window.innerWidth = w+20;
	}else{
		h += 20;
		w += 20;
		window.resizeBy(w-document.body.clientWidth,h-document.body.clientHeight);
	}
}
	


	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}
	addEvent(window,"load",resizeWindow);
