if(screen != null) 
{ 
var xpos = screen.width;
var ypos = screen.height;
}
else 
{ 
var xpos = 640; 
var ypos = 480; 
}

function pic(pageToLoad, w, h)
{
	var winheight = parseInt(h);
	var scrollingwidth = w+15;
	var scrollingheight = winheight+40;
	var scrolling = 0;
	
	if(xpos > 800) 
	{
		if(h > 700) { scrollingwidth = parseInt(w) ; scrollingheight = 700; scrolling = 1; }
		if(w > 1000) { scrollingheight = parseInt(winheight) ; scrollingwidth = 1000; scrolling = 1; }
		if((w > 1000) && (h > 700)) { scrollingheight = 700; scrollingwidth = 1000; scrolling = 1; }
	}
	else
	{
		if(h > 450) { scrollingwidth = parseInt(w); scrollingheight = 450; scrolling = 1; }
		if(w > 730) { scrollingheight = parseInt(winheight) ; scrollingwidth = 730; scrolling = 1; }
		if((w > 730) && (h > 450)) { scrollingheight = 450; scrollingwidth = 730; scrolling = 1; }
	}
	xposition = (xpos - scrollingwidth) / 2;
	yposition = (ypos - scrollingheight) / 2;
	args = "width=" + scrollingwidth + ","
		+ "height=" + scrollingheight + ","
		+ "location=0, menubar=0, resizable=1, scrollbars=" + scrolling + ","
		+ "status=0, titlebar=0, toolbar=0, hotkeys=0, "
		+ "screenx=" + xposition + ","
		+ "screeny=" + yposition + ","
		+ "left=" + xposition + ","
		+ "top=" + yposition;
	oWin = window.open("","_blank",args);

	pic_pop =  '<HTML><TITLE>Model Promotion Association</TITLE>';
	pic_pop += '<BODY text="#000000" rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" marginwidth="0"  marginheight="0" style="margin:0" bgcolor="#FFFFFF">';
	pic_pop += '<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1D1D1">';
	pic_pop += '<tr>';
	pic_pop += '<td valign="top"><table width="100%" border="0"  bgcolor="#FFFFFF" >';
	pic_pop += '<tr>';
	pic_pop += '<td valign="top"><table>';
	pic_pop += '<tr>';
	pic_pop += '	<td align="center"  class="prod" valign="top"><img src="'+ pageToLoad +'" width="'+ w +'" height="'+ h +'" vspace="0" hspace="0" border="0">'; 
	pic_pop += '</td>';
	pic_pop += '<tr>';
	pic_pop += '<td align="center" colspan="4" >';
	pic_pop += '<a href="#" onClick="window.close();"><img src="images/close_butt.jpg" width="45" height="18" border="0"></a></td>';
	pic_pop += '</tr>';
	pic_pop += '</table></td>';
	pic_pop += '			</tr>';
	pic_pop += '		</table></td>';
	pic_pop += '	</tr>'
	pic_pop += '</table>'
	pic_pop += '</BODY></HTML>';

	oWin.document.open();
	oWin.document.writeln(pic_pop);
	oWin.document.close();
}
