function showWindow(proc,W,H){
  var l=Math.floor(top.document.body.clientWidth/2)-W/2;
  var t=Math.floor(top.document.body.clientHeight/2)-H/2;
  var opt="left="+l+",top="+t+",width="+W+",height="+H+",location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes"
  window.open(proc,"_blank",opt)
}

function popUp(href,h,w){
window.open(href,'','width='+w+',height='+h+',left=250,top=50,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes');
}

function changecolor(color)
{
	document.getElementById("box").style.backgroundColor='#'+color;
}
function ImagePoster(type)
{
	if (type==1) return document.getElementById("imagePoster").offsetHeight;
	if (type==2) return document.getElementById("imagePoster").offsetWidth;
}

function changesize(size,type)
{
	var obj = document.getElementById("box");
	if (type==1){
		obj.style.paddingTop=size*padding_px;
	}
	if (type==2){
		obj.style.paddingBottom=size*padding_px;
	}
	
	if (type==3){
		obj.style.paddingLeft=size*padding_px;
		obj.style.paddingRight=size*padding_px;
	}
}

function changewidth(){
	width = document.getElementById("width_select").value;
	changesize(width,3);
	
	type=document.getElementById("type_select").value;
	
	if (type==1){
		changesize(width,1);
		changesize(width,2);
	}
	if (type==2){
		changesize(width,1);
		changesize(width*2,2);
	}
	if (type==3){
		changesize(width*2,1);
		changesize(width*2,2);
	}
}