Try changing name=window.open(url,name,'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=width,height=height');
to have the variables width and height not inside the string literal quotes, something like this name=window.open(url,name,'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height);