function view_pic(pic_url,pic_width,pic_height,alt_text,set_print)
{var left_padding=(screen.width-pic_width)/2;var top_padding=(screen.height-pic_height-50)/2;var params='toolbar=0, location=0, left='+left_padding+', top='+top_padding+', directories=0, status=0, menubar=0, scrollbars=0, resizable=0, copyhistory=0, width='+pic_width+', height='+pic_height;foto=window.open('','',params);foto.document.write('<html><head><title>'+alt_text+'</title><link rel="stylesheet" href="/styles.css" type="text/css" /></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align=center valign=center>');if(set_print==true)foto.document.write("<div id='print' class='print'><div><a href='javascript:window.print()'>Распечатать</a></div></div>");foto.document.write("<img src='"+pic_url+"'  onclick='window.close(); opener.focus()' alt='"+alt_text+"'></td></tr></table></body></html>");foto.focus();}
function view_pic_html(pic_id,db_id,pic_width,pic_height)
{pic_height=pic_height-(-150);if(pic_width<400)pic_width=400;pic_width=pic_width-(-50);var left_padding=(screen.width-pic_width)/2;var top_padding=(screen.height-pic_height-50)/2;var params='toolbar=0, location=0, left='+left_padding+', top='+top_padding+', directories=0, status=0, menubar=0, scrollbars=0, resizable=0, copyhistory=0, width='+pic_width+', height='+pic_height;foto=window.open('/images.php?db='+db_id+'&js=1&id='+pic_id,'',params);foto.focus();}
function view_payment(display,value){var payment=document.getElementById('payment');payment.innerHTML='<a href="/payment.php?door_id='+value+'"><div><nobr><img src="/pic/payment.gif" align="absmiddle">Оформить заявку</nobr></div></a>';payment.style.display=display!='yes'?'none':'block';}
function showPrice(){var prlist=document.getElementById('priceList');prlist.style.display=(prlist.style.display=="none")?"block":"none";var prbut=document.getElementById('priceListButton');prbut.src=(prlist.style.display=="none")?"catalogue/buttons/button_pp_p.gif":"catalogue/buttons/button_sp_p.gif";}
function HideShow(object_id,button_id){var obj=document.getElementById(object_id);obj.style.display=(obj.style.display=="none")?"block":"none";var prbut=document.getElementById(button_id);prbut.src=(obj.style.display=="none")?"catalogue/buttons/plus.gif":"catalogue/buttons/minus.gif";}
function showDoor(dName,dFullName,period,p_width,p_height,altText,fullAltText){if(!period)period='';else period='<div id="periodTime"><img src="/pic/periods/'+period+'.png"></div>';if(!p_width)p_width=201;if(!p_height)p_height=321;if(!altText)altText='';var door=document.getElementById('showDoor');door.innerHTML=period+'<a href="'+dFullName+'" onClick="javascript:view_pic(\''+dFullName+'\',\''+p_width+'\',\''+p_height+'\',\''+altText+'\');return false;"><img src="'+dName+'" alt="'+altText+'"><div class="loop"><img src="/pic/LargerView.gif"> Увеличить</div></a>';if(fullAltText){door.innerHTML+='\n<br><span class="doorName">'+fullAltText+'</span>';}}
var max_height=520;var min_s_height=768;function screen_height(){var s_height=0;if(self.screen){s_height=screen.height}
else if(self.java){var jkit=java.awt.Toolkit.getDefaultToolkit();var scrsize=jkit.getScreenSize();s_height=scrsize.height;}
return s_height;}
function showDoorHTML(dName,dFullId,period,p_width,p_height,dbId,fullAltText){if(screen_height()<=min_s_height&&p_height>max_height){p_height=max_height}
if(!period)period='';else period='<div id="periodTime"><img src="/pic/periods/'+period+'.png"></div>';if(!p_width)p_width=201;if(!p_height)p_height=321;var door=document.getElementById('showDoor');door.innerHTML=period+'<a href="/images.php?db='+dbId+'&id='+dFullId+'" onClick="view_pic_html(\''+dFullId+'\',\''+dbId+'\',\''+p_width+'\',\''+p_height+'\');return false;"><img src="'+dName+'"><div class="loop"><img src="/pic/LargerView.gif"> Увеличить</div></a>';if(fullAltText){door.innerHTML+='\n<br><div class="doorName">'+fullAltText+'</div>';}}
function period(value){var period=document.getElementById('period');if(value){if(value==1){value='1 день';}
if(value>1&&value<5){value=value+' дня';}
if(value>4&&value<21){value=value+' дней';}
period.innerHTML='срок поставки: '+value;}
else{period.innerHTML='&nbsp';}}
function ShowHideList(div_id,button_id){var obj=document.getElementById(div_id);if(obj.style.display==false)obj.style.display="none";if(obj.style.display=="none"){var rty=document.getElementById('cnslt');disp_divs(rty);}
obj.style.display=(obj.style.display=="none")?"block":"none";var prbut=document.getElementById(button_id);prbut.src=(obj.style.display=="none")?"catalogue/buttons/plus.gif":"catalogue/buttons/minus.gif";}
function disp_divs(d_obj){for(var i=0;i<d_obj.childNodes.length;i++){if(d_obj.childNodes[i].tagName=='DIV'){d_obj.childNodes[i].style.display="none";}
else if(d_obj.childNodes[i].childNodes.length>0){disp_divs(d_obj.childNodes[i])}}}
function ShowHideAnswers(ask_id){d_obj=document.getElementById(ask_id);for(var i=0;i<d_obj.parentNode.childNodes.length;i++){if(d_obj.parentNode.childNodes[i].tagName=='DIV'){d_obj.parentNode.childNodes[i].style.display='none';}}
d_obj.style.display="block";}
function doorPos(startPos,mPos,maxPos){var header=document.getElementById('showDoor');if(!header)return;var currentOffset=document.documentElement.scrollTop||document.body.scrollTop;var desiredOffset=currentOffset-startPos;if(desiredOffset<180&&desiredOffset>=0){header.style.top=startPos+'px';}
if(desiredOffset<maxPos&&desiredOffset>=180){header.style.top=startPos+desiredOffset+mPos+'px';}
if(desiredOffset<0)header.style.top=startPos+Math.abs(desiredOffset)+'px';if(desiredOffset>=maxPos)header.style.top=startPos+maxPos+mPos+'px';}
function isFlash(){flash=false;if(navigator.userAgent.indexOf('MSIE')==-1)
{if(navigator.plugins["Shockwave Flash"])flash=true;else flash=false;}
else
{try
{obj=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');flash=true;}
catch(e)
{flash=false;}}
return flash;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&document.getElementById)x=document.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function open_win3(url)
{window.open(url,'clubculturewin','fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0 ,resizable=no,width=350,height=129, top=10, left=10');}
function open_win4(url,nm)
{window.open(url,'nm'+nm,'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,resizable=no,width=570,height=445, top=10, left=10');}
function open_win1(nm)
{var left_padding=(screen.width-600)/2;var top_padding=(screen.height-620-50)/2;window.open('/where/'+nm+'.htm','nm'+nm,'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=no,width=600,height=620,top='+top_padding+',left='+left_padding);}
function open_shops(nm)
{var left_padding=(screen.width-990)/2;var top_padding=(screen.height-650-50)/2;window.open('http://www.union.ru/where/shops.php?id='+nm+'&win=1','nm'+nm,'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=no,width=990,height=650,top='+top_padding+',left='+left_padding);}
