function setMargin() {
	var wh = getWindowHeight();
	var image = document.getElementById('image');
	var image_h = image.offsetHeight; // image div height

	if (wh > image_h) {
  		image.style.marginTop = ((wh-image_h)/2) + 'px';
	} else {
  		image.style.marginTop = 0 + 'px';	
	}
}

function getWindowHeight() {
  var windowHeight = 0;
	
	if (typeof(window.innerHeight) == 'number')
    	windowHeight = window.innerHeight;	
	else {		
		if (document.documentElement && document.documentElement.clientHeight)
      		windowHeight = document.documentElement.clientHeight;		
    	else {
      		if (document.body && document.body.clientHeight)
        		windowHeight = document.body.clientHeight; 
		}; 
	};
				
  return windowHeight;
}

window.onload = function() {
	settings = {
		tl: { radius: 20 },
		tr: { radius: 20 },
		bl: { radius: 20 },
		br: { radius: 20 },
		antiAlias: true,
		autoPad: false,
		validTags: ["div"]
	}

	var imageObject = new curvyCorners(settings, "image");
	imageObject.applyCornersToAll();
	setMargin();
}