var WinOpen;
var p_top;
var p_left;

function doPassVar(args){ 
	window.document.flash.SetVariable("SelectedButton", args); 
} 

function open_form(){

	p_top=(screen.height-502)/2;
	p_left=(screen.width-470)/2;

	WinOpen=window.open("/popup_page.php?id=1","","toolbar=no, location=no, top="+p_top+", left="+p_left+", directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=470, height=502");

return WinOpen;

}

if (document.images){

  pic1= new Image(903,352); 
  pic1.src="http://imaxmedia.ru/img/main_head.jpg"; 

}

function show_img(title, img_src, img_width, img_height) {
 	height = parseInt(img_height) + 30;
 	width = parseInt(img_width) + 30;

	p_top=(screen.height-img_height)/2-30;
	p_left=(screen.width-img_width)/2-30;

    if(WinOpen != null){
     	  WinOpen.close();
          WinOpen  =  window.open("", "Foto", "closed=yes, toolbar=no, location=no, top="+p_top+", left="+p_left+", directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+width+", height="+height+"");
    }else{
          WinOpen  =  window.open("", "Foto", "closed=yes, toolbar=no, location=no, top="+p_top+", left="+p_left+", directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+width+", height="+height+"");
}
    if(WinOpen != null){
          WinOpen  =  window.open("", "Foto", "closed=yes, toolbar=no, location=no, top="+p_top+", left="+p_left+", directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+width+", height="+height+"");
          WinOpen.document.write("<html><head><title>"+title+"</title>");
          WinOpen.document.write("<SCRIPT language=javascript>function cl() { close(); }</SCRIPT></head>");
          WinOpen.document.write("<body style='padding:0; margin:0;' bgcolor='#FFFFFF'><table width='100%' height='100%'><tr><td align='center' style='vertical-align:middle;'><img src="+img_src+" style='cursor:pointer;' alt=\"Закрыть\" onClick=\"cl()\"; style='BORDER-RIGHT: #FF2F66 4px solid; BORDER-TOP: #FF2F66 4px solid; BORDER-LEFT: #FF2F66 4px solid; BORDER-BOTTOM: #FF2F66 4px solid'></td></tr></table></body></html>");
    }

return WinOpen;

}