var timeOnDiv;
var preview_id;

spacer=new Image(); spacer.src="/images/frame/spacer.gif";
var scroll_body;


b_arrow_right_ovr=new Image(15,13); b_arrow_right_ovr.src="/images/buttons/arrow_right_ovr.gif";
b_arrow_right_out=new Image(15,13); b_arrow_right_out.src="/images/buttons/arrow_right.gif";

b_arrow_left_ovr=new Image(15,13); b_arrow_left_ovr.src="/images/buttons/arrow_left_ovr.gif";
b_arrow_left_out=new Image(15,13); b_arrow_left_out.src="/images/buttons/arrow_left.gif"

b_print_ovr=new Image(94,15); b_print_ovr.src="/images/buttons/print_ovr.gif";
b_print_out=new Image(94,15); b_print_out.src="/images/buttons/print.gif";
b_fav_ovr=new Image(94,15); b_fav_ovr.src="/images/buttons/fav_ovr.gif";
b_fav_out=new Image(94,15); b_fav_out.src="/images/buttons/fav.gif";

b_logo_ovr=new Image(59,59); b_logo_ovr.src="/images/logo_ovr.gif";
b_logo_out=new Image(59,59); b_logo_out.src="/images/logo.gif";

b_news_ovr=new Image(190,29); b_news_ovr.src="/images/buttons/news_ovr.gif";
b_news_out=new Image(190,29); b_news_out.src="/images/buttons/news.gif";

b_advert_ovr=new Image(190,29); b_advert_ovr.src="/images/buttons/advertising_ovr.gif";
b_advert_out=new Image(190,29); b_advert_out.src="/images/buttons/advertising.gif";

b_about_ovr=new Image(190,29); b_about_ovr.src="/images/buttons/about_ovr.gif";
b_about_out=new Image(190,29); b_about_out.src="/images/buttons/about.gif";

b_galery_ovr=new Image(190,29); b_galery_ovr.src="/images/buttons/galery_ovr.gif";
b_galery_out=new Image(190,29); b_galery_out.src="/images/buttons/galery.gif";

b_forum_ovr=new Image(190,29); b_forum_ovr.src="/images/buttons/phorum_ovr.gif";
b_forum_out=new Image(190,29); b_forum_out.src="/images/buttons/phorum.gif";

b_subscribe_ovr=new Image(190,29); b_subscribe_ovr.src="/images/buttons/subscribe_ovr.gif";
b_subscribe_out=new Image(190,29); b_subscribe_out.src="/images/buttons/subscribe.gif";


b_first_view_ovr=new Image(70,15); b_first_view_ovr.src="/images/buttons/topics/first_view_ovr.gif";
b_first_view_out=new Image(70,15); b_first_view_out.src="/images/buttons/topics/first_view.gif";

b_survey_ovr=new Image(29,15); b_survey_ovr.src="/images/buttons/topics/survey_ovr.gif";
b_survey_out=new Image(29,15); b_survey_out.src="/images/buttons/topics/survey.gif";

b_our_tests_ovr=new Image(56,15); b_our_tests_ovr.src="/images/buttons/topics/our_tests_ovr.gif";
b_our_tests_out=new Image(56,15); b_our_tests_out.src="/images/buttons/topics/our_tests.gif";

b_tuning_ovr=new Image(37,15); b_tuning_ovr.src="/images/buttons/topics/tuning_ovr.gif";
b_tuning_out=new Image(37,15); b_tuning_out.src="/images/buttons/topics/tuning.gif";

b_nightlife_ovr=new Image(69,15); b_nightlife_ovr.src="/images/buttons/topics/night_life_ovr.gif";
b_nightlife_out=new Image(69,15); b_nightlife_out.src="/images/buttons/topics/night_life.gif";

b_autosport_ovr=new Image(49,15); b_autosport_ovr.src="/images/buttons/topics/autosport_ovr.gif";
b_autosport_out=new Image(49,15); b_autosport_out.src="/images/buttons/topics/autosport.gif";

b_autosale_ovr=new Image(53,15); b_autosale_ovr.src="/images/buttons/topics/autosale_ovr.gif";
b_autosale_out=new Image(53,15); b_autosale_out.src="/images/buttons/topics/autosale.gif";

b_interview_ovr=new Image(47,15); b_interview_ovr.src="/images/buttons/topics/interview_ovr.gif";
b_interview_out=new Image(47,15); b_interview_out.src="/images/buttons/topics/interview.gif"

b_autoclubs_ovr=new Image(51,15); b_autoclubs_ovr.src="/images/buttons/topics/autoclubs_ovr.gif";
b_autoclubs_out=new Image(51,15); b_autoclubs_out.src="/images/buttons/topics/autoclubs.gif";

b_law_ovr=new Image(80,15); b_law_ovr.src="/images/buttons/topics/law_ovr.gif";
b_law_out=new Image(80,15); b_law_out.src="/images/buttons/topics/law.gif";

b_video_ovr=new Image(30,15); b_video_ovr.src="/images/buttons/topics/video_ovr.gif";
b_video_out=new Image(30,15); b_video_out.src="/images/buttons/topics/video.gif";

b_rip_ovr=new Image(21,15); b_rip_ovr.src="/images/buttons/topics/rip_ovr.gif";
b_rip_out=new Image(21,15); b_rip_out.src="/images/buttons/topics/rip.gif";

b_events_ovr=new Image(63,15); b_events_ovr.src="/images/buttons/topics/events_ovr.gif";
b_events_out=new Image(63,15); b_events_out.src="/images/buttons/topics/events.gif";


 function light_on_g(targetId)
 {
   var targetElement;
       targetElement = document.getElementById(targetId);

      targetElement.style.display="";
      targetElement = document.getElementById('w_'+targetId);
      targetElement.style.display="";

 }

 function light_off_g(targetId)
 {
   var targetElement;
       targetElement = document.getElementById(targetId);

      targetElement.style.display="none";

      targetElement = document.getElementById('w_'+targetId);
      targetElement.style.display="none";

 }

 function light_on(targetId)
 {
   var targetElement;
       targetElement = document.getElementById(targetId);

      targetElement.style.display="";
 }

 function light_off(targetId)
 {
   var targetElement;
       targetElement = document.getElementById(targetId);

      targetElement.style.display="none";
 }

 function set_margin(targetElement,i)
 {
    targetElement.style.marginLeft=i+'px';
 }



function mark_vote(num)
{
  voting[num-1].checked='checked';
}

function show_pol()
{

 k=1;
 vote=0;

 for(i=0;i<voting.length;i++)
 {
//  alert(voting[i].checked);
  if(voting[i].checked==true)
  {
   k=0;
   vote=i;
  }
 }

 if(k==1)
 {
  alert('Выберите пункт голосования');
 }
 else
 {
   popup("/show_poll.php3?vote="+(vote+1),120,100,350,150);
 }

}

function show_mark_options(mark)
{
  var x_coords = window.event.x;
  scroll_body=document.body.scrollTop;

  if(x_coords>1000){x_coords=1000;}

  pixelLeft = document.body.scrollLeft+x_coords-10;
  pixelTop = window.event.y+20;

  popup("/show_mark_options.php3?mark_id="+mark,200,200,pixelTop,pixelLeft);
}

function show_voting(article_id)
{

  scroll_body=document.body.scrollTop;

  if(scroll_body<290)
  {
   popup("/show_voting.php3?article_id="+article_id,120,100,325,600);
  }
  else
  {
   popup("/show_voting.php3?article_id="+article_id,120,100,50,600);
  }

}


function ShowArticlesComments()
{
 targetElement = document.getElementById('comments_iframe');

 if(targetElement.style.display == 'none')
 {
  targetElement.style.display = "";
  location.href='#comment_anchor';
  LoadComments();

  targetElement1 = document.getElementById('ann_comments_show');
  targetElement1.style.display = "none";

 }
 else
 {
  location.href='#comment_anchor';
 }

}




function Movr(imageName){
if(document.images){
     document[imageName].src=eval(imageName + "_ovr.src");
}}
function Mout(imageName){
 if(document.images){
     document[imageName].src=eval(imageName+"_out.src");
}}

function Load_Ex_2()
{
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="507" height="310" id="ex2" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain" />');
 document.write('<param name="movie" value="/swf/ex25.swf?path=/ex/mustang.jpg&logo_path=/swf/ford.swf&ex_desc=тест описание&title=Супер Кар" />');
 document.write('<param name="quality" value="high" />');
 document.write('<param name="bgcolor" value="#ffffff" />');
 document.write('<embed src="/swf/ex25.swf?path=/ex/mustang.jpg&logo_path=/swf/ford.swf&ex_desc=тест описание&title=Супер Кар" quality="high" bgcolor="#ffffff" width="507" height="310" name="ex2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
 document.write('</object>');
}






function Load_Int()
{
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="252" height="310" id="int1" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain" />');
 document.write('<param name="movie" value="/swf/int7.swf?path=/fav/fav1_1.jpg&logo_path=/swf/bentley.swf&path_1=/fav/caddilac.jpg&logo_path_1=/swf/caddilac.swf" />');
 document.write('<param name="quality" value="high" />');
 document.write('<param name="bgcolor" value="#ffffff" />');
 document.write('<embed src="/swf/int7.swf?path=/fav/fav1_1.jpg&logo_path=/swf/bentley.swf&path_1=/fav/caddilac.jpg&logo_path_1=/swf/caddilac.swf" quality="high" bgcolor="#ffffff" width="252" height="310" name="int1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
 document.write('</object>');
}


function mark_simple_link(targetId)
{

 var targetElement;
     targetElement = document.getElementById("ann_"+targetId);

 targetElement.style.background = "#ca0064";
 targetElement.style.color = "#FFFFFF";
}

function mark_page(targetId)
{

 var targetElement;
     targetElement = document.getElementById("p_"+targetId);


 targetElement.style.background = "#ca0064";
 targetElement.style.color = "#FFFFFF";

}

function unmark_page(targetId)
{
 var targetElement;
     targetElement = document.getElementById("p_"+targetId);
// alert(targetElement.style.background.color);
 targetElement.style.background = "#f5f5f5";
 targetElement.style.color = "#323232";
}


function unmark_simple_link_white(targetId)
{
 var targetElement;
     targetElement = document.getElementById("ann_"+targetId);
// alert(targetElement.style.background.color);
 targetElement.style.background = "#FFFFFF";
 targetElement.style.color = "#323232";
}

function unmark_simple_link(targetId)
{
 var targetElement;
     targetElement = document.getElementById("ann_"+targetId);
// alert(targetElement.style.background.color);
 targetElement.style.background = "#ebebeb";
 targetElement.style.color = "#323232";
}

var targetzoomer;
function mark_link(targetId)
{

 var targetElement;
     targetElement = document.getElementById("ann_"+targetId);
// alert(targetElement.style.background.color);
 targetElement.style.background = "#ca0064";
 targetElement.style.color = "#FFFFFF";
 targetzoomer=targetId;
 clearTimeout(timeOnDiv);
 timeOnDiv = setTimeout("show_zoomer(targetzoomer)",500);

 return;
}

function show_zoomer(targetId)
{
 eval("div_"+targetId).style.visibility='visible';
 return;
}

function unmark_link(targetId)
{

 var targetElement;
     targetElement = document.getElementById("ann_"+targetId);

 targetElement.style.background = "#ebebeb";
 targetElement.style.color = "#323232";

 eval("div_"+targetId).style.visibility='hidden';
 clearTimeout(timeOnDiv);
}

function show_calendar()
{
  var a=document.body.clientWidth;
  preview_calendar.style.visibility='visible';
  preview_calendar.style.pixelLeft = (a/2)-276;
}

function hide_calendar()
{
  preview_calendar.style.visibility='hidden';
}

function show_preview(article_id,num)
{
 preview_id = article_id;
 load_article();
 coords = 365+num*126;
 var a=document.body.clientWidth;
 a=a/2;

 preview_article.style.pixelTop=coords;
 preview_article.style.visibility='visible';
 preview_article.style.pixelLeft=a-280;
  // alert(num);
 if(num>=5)
 {

  preview_article.style.pixelLeft=a-25;
  num=num-5;
  coords = 365+num*126;
  preview_article.style.pixelTop=coords;
 }
/*
 if(num==44)
 {
  coords = 1050;
  preview_article.style.pixelTop=coords;
  preview_article.style.pixelLeft=226;
 }
*/

}

function load_article()
{
// alert("/preview_article.php3?article_id="+preview_id);
 document.frames['previewFrame'].location.href="/preview_article.php3?article_id="+preview_id;
}

function Hide_preview()
{
 preview_article.style.visibility='hidden';
 document.frames['previewFrame'].location.href="/annotations/blank.htm";
}

var sel_opt;

sel_opt='';

function show_pic(dir,name)
{

  scroll_body=document.body.scrollTop;
//  alert(scroll_body);
  if(scroll_body>250)
  {
   popup("/show_pics.php3?dir="+dir+"&pic="+name,200,200,15,15);
  }
  else
  {
//   alert(scroll_body);
   popup("/show_pics.php3?dir="+dir+"&pic="+name,200,200,250,15);
  }

}


function show_gallery_pic(name)
{

//  scroll_body = document.body.scrollTop;

  var a=document.body.clientWidth;
  pixelLeft = (a/2)-269;

  popup_gallery("/show_gallery_pic.php3?pic_id="+name,200,200,10,pixelLeft);

}

function show_subscription()
{
  targetElement = document.getElementById('popupTitle');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_1024');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_800');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_640');
  if(targetElement)
   targetElement.innerHTML = '';

  popup("/mailer/subscribe/index.php",700,300,100,20);
}

function show_quick_subscribe(email,pass)
{

  targetElement = document.getElementById('popupTitle');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_1024');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_800');
  if(targetElement)
   targetElement.innerHTML = '';

  targetElement = document.getElementById('w_640');
  if(targetElement)
   targetElement.innerHTML = '';

  email = subscribe_email.value;
  pass = subscribe_pass.value;
  popup("/quick_subscribe.php3?email="+email+"&pass="+pass,700,300,100,20);
}





  var url="http://www.car-era.ru/";
  var titel="www.car-era.ru  -  Электронный журнал 'Эра Авто'";
  function bookmark()
   {if (document.all)
    window.external.AddFavorite(url,titel)}


function ShowDocInfo(doc)
{
 page="../../show_doc_info.php3?doc_id=" + doc;
 window.open(page,'','scrollbars=yes,resizable=no,menubar=yes,width=360,height=500,left=0,top=0');
}

function SearchClear()
{
 form1.query.value='';
}





function show_mark_models(targetId)
{
var targetElement;
    targetElement = document.getElementById(targetId);


if (targetElement.style.display == "none")
{
 targetElement.style.display = "";

}
else
{
 targetElement.style.display = "none";
}

}







function show_help(targetId)
{
var targetElement;
       targetElement = document.getElementById(targetId);
       targetElement_ = document.getElementById(targetId+"_");

if (targetElement.style.display == "none")
{
 targetElement.style.display = "";
 targetElement_.style.color = "#A40000";

 if(sel_opt!='' && sel_opt!=targetElement)
 {
   sel_opt.style.display='none';
   sel_opt_.style.color = "";
 }
 sel_opt=targetElement;
 sel_opt_ =targetElement_;
}
else
{
 targetElement.style.display = "none";
 targetElement_.style.color = "";
}
}





function show_help_for_articles(targetId,num)
{
var targetElement;

 var k;
 k=1;

for(i=1;i<num+1;i++)
{
 targetElement = document.getElementById(targetId+i);


 if (targetElement.style.display == "none")
 {
  if(k==1)
  {
   document[targetId+"_b"].src=eval("b_folder_out.src");
   k=0;
  }
  targetElement.style.display = "";

 }
 else
 {
//  alert(eval("b_folder_ovr.src"));
  if(k==1)
  {
    document[targetId+"_b"].src=eval("b_folder_ovr.src");
    k=0;
  }

  targetElement.style.display = "none";

 }
}

}





function show_help_for(targetId,num)
{
var targetElement;

 var k;
 k=1;

for(i=1;i<num+1;i++)
{
 targetElement = document.getElementById(targetId+"_"+i);


 if (targetElement.style.display == "none")
 {
  if(k==1)
  {
   //alert(targetId+"_b");

//   document["k"+targetId+"_b"].src=eval("b_folder_out.src");
   k=0;
  }
  targetElement.style.display = "";

 }
 else
 {
//  alert(eval("b_folder_ovr.src"));
  if(k==1)
  {
   // alert(targetId+"_b");

  //  document["k"+targetId+"_b"].src=eval("b_folder_ovr.src");
    k=0;
  }

  targetElement.style.display = "none";

 }
}

}








    function Point(arg) {

      eval("document."+arg).Play();

  //      document.all[arg.Play();
       document.location.replace("#"+arg);
      //  return false;

    }

    function GoUp()
    {
     scroll(0,0);
    }



function Hide_sub(targetId)
{
var targetElement;
       targetElement = document.getElementById(targetId);
 targetElement.style.display = "none";
}

function Show_sub(targetId)
{
var targetElement;
       targetElement = document.getElementById(targetId);
 targetElement.style.display = "";
}

function Movr(imageName){
if(document.images){
     document[imageName].src=eval(imageName + "_ovr.src");
}}
function Mout(imageName){
 if(document.images){
     document[imageName].src=eval(imageName+"_out.src");
}}

var LinkDivActive = 0;
var onDiv='about';

var layerRef;
var styleRef;
var showVar;
var hideVar;

if (navigator.appName == "Netscape") {
 layerRef="document.";
 styleRef="";
 showVar="'show'";
 hideVar="'hide'";
} else {
 layerRef="document.all.";
 styleRef=".style";
 showVar="'visible'";
 hideVar="'hidden'";
}

//Divisions Show | Hide
function hideDiv(divn) {
  Mout('b_' + onDiv);
 eval(layerRef+divn+styleRef+'.visibility = '+hideVar);
}

function showDiv(divn) {
 eval(layerRef+divn+styleRef+'.visibility = '+showVar);
}

//Link Divisions Stuff
function showLinkDiv(divn) {
 if (timeOnDiv != null) {
  clearTimeout(timeOnDiv);
  hideDiv(onDiv);
 }
 showDiv(divn);
 onDiv = divn;
}

function divTimer() {
 timeOnDiv = setTimeout("divOut()",500)
}

function divOut() {
 if (LinkDivActive == 0) {
  hideDiv(onDiv);
 }
}

function LinkDivOver() {
 LinkDivActive = 1;
 clearTimeout(timeOnDiv);
}

function LinkDivOut() {
 LinkDivActive = 0;
 timeOnDiv = setTimeout("divOut()",500)
}

function Drag()
{
 menu1 = catalog.style;
 menu2 = client.style;

 var a=document.body.clientWidth;
 if(a<841){a=841;};
 a=a/2;
 menu1.pixelLeft=a+38;
 menu2.pixelLeft=a+155;
}


function showbigmap()
{
  sampWin= open("", "displayWindow",
    "width="+400+",height="+391+",status=no,toolbar=no,menubar=no,left=0,top=0");
  sampWin.document.open();
  sampWin.document.write("<html><head><title>Карта проезда</title>");
  sampWin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'></head><body BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>");
  sampWin.document.write("<img src='../images/map_onlyway.gif' border=0 width=400 height=391>");
  sampWin.document.write("</body></html>");
  sampWin.document.close();
}






function settip(text)
{
 scroll_body=document.body.scrollTop;
// var scroll_body=0;
 popTip.style.visibility='visible';
// txt = "<table high=15 width=140 border=1 cellspacing=0 cellpadding=0 bordercolor=#006600 bordercolordark=#000000 bgcolor=#000000><tr><td align=center  background=/images/tip/up_bg.gif> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9></td></tr></table><table high=15 width=140 border=1 cellspacing=0 cellpadding=0 bordercolor=#006600 bordercolordark=#000000 bgcolor=#000000><tr><td align=center> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9></td></tr></table><table high=15 width=140 border=1 cellspacing=0 cellpadding=0 bordercolor=#006600 bordercolordark=#000000 bgcolor=#000000><tr><td align=center> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9> <IMG SRC='/images/tip/tip_03.gif' WIDTH=11 HEIGHT=9></td></tr></table>"
// document.all['small_tip_text'].innerHTML = text;
 document.all['tip_text'].innerHTML = text;
}

function HideTip()
{
 document.all['popTip'].style.visibility='hidden';
}

function HideColTip()
{
 document.all['colTip'].style.visibility='hidden';
}

function move()
{

  var x_coords = window.event.x;
//  if(x_coords>1000){x_coords=1000;}
  tip=popTip.style;

  tip.pixelLeft = document.body.scrollLeft+x_coords-10;
  tip.pixelTop = window.event.y+scroll_body+20;
}


function popup(url, width, height, top, left) {
        iframe = document.getElementById('FM~popupIFRAME');
        div = document.getElementById('FM~popupDIV');
        iframeDIV = document.getElementById('FM~iframeDIV');
        iframeDIV.innerHTML = '<iframe height="100%" width="100%" name=popframe id="FM~popupIFRAME" frameborder="0" style="width:'+width+'px;height:'+height+'px" src="'+url+'" style="display:none;background-color:white;" onload="this.style.display=\'block\'"></iframe>';
        iframeDIV.style.width=width;
        iframeDIV.style.height=height;
        div.style.width=width;
        div.style.height=height;
        div.style.left=-(-left-findScrollLeft());
        div.style.top=-(-top-findScrollTop());

        div.style.display='block';
        div.style.visibility='visible';
}

function popup_gallery(url, width, height, top, left) {
        iframe = document.getElementById('FM~popupIFRAME');
        div = document.getElementById('FM~popupDIV');
        iframeDIV = document.getElementById('FM~iframeDIV');
        iframeDIV.innerHTML = '<iframe height="100%" width="100%" name=popframe id="FM~popupIFRAME" frameborder="0" style="width:'+width+'px;height:'+height+'px" src="'+url+'" style="display:none;background-color:white;" onload="this.style.display=\'block\'"></iframe>';
        iframeDIV.style.width=width;
        iframeDIV.style.height=height;
        div.style.width=width;
        div.style.height=height;
        div.style.left=left;
        var topPix = -(-top-findScrollTop());
        if(topPix<374)
        {
          topPix=374;
        }
        div.style.top=topPix;

        div.style.display='block';
        div.style.visibility='visible';
}

function closePopup() {
        div = document.getElementById('FM~popupDIV');
        iframeDIV = document.getElementById('FM~iframeDIV');
        div.style.display='none';
        iframeDIV.innerHTML = "";
}

function makeDragable(objid) {
        Drag.init(document.getElementById(objid),null);
}


 function normalize_size()
 {
  height = frames['FM~popupIFRAME'].document.body.scrollHeight;

  if(height>768)
  {
   height=500;
  }

  width = frames['FM~popupIFRAME'].document.body.scrollWidth;
  iframe = document.getElementById('FM~popupIFRAME');

  iframe.style.height=height;
  iframe.style.width=width;

 }


 function loaded()
 {
  iframe = document.getElementById('FM~popupIFRAME');
  iframe.style.display='block';
  iframe.style.visibility='visible';
 }


 function scroll_()
 {
   iframe = document.getElementById('article_gallery');
//   document.fra
//   iframe.scroll_forward();
   window.frames['article_gallery'].scroll_forward();
//   iframe.style.width=200;
 }
