function shop_info(type,id)
{
	window.open('/php_includes/shop_contacts.php?s_type='+type+'&s_id='+id,'','scrollbars=1,width=650,height=600,left='+((screen.width-600)/2)+',top='+((screen.height-600)/2));
}

var vv=parseInt(navigator.appVersion);
isNetscape=navigator.appName.indexOf('Netscape')>=0;
isExplorer=navigator.appName.indexOf('Explorer')>=0;
if (vv>=3) self.focus();

function popUp(goLocation,ww,wh) {
	positionCode='';
	if (vv>=4) {
		sw=screen.width; sh=screen.height;
		wbx=Math.round((sw-ww)/2); wby=Math.round((sh-wh)/2);
		if (isExplorer) positionCode='left='+wbx+',top='+wby+',';
		if (isNetscape) positionCode='screenX='+wbx+',screenY='+wby+',';
	}
	newWindow=window.open(goLocation,'','width='+ww+',height='+wh+','+positionCode+'toolbar=0,'+'scrollbars=0,'+'resizable=0');
	if (isNetscape && vv>=3) newWindow.focus();
}


function mapView(mapURL, wdt, hgt) {
	positionCode='left='+((screen.width-wdt)/2)+',top='+((screen.height-hgt)/2)+',';
	if (vv>=4) {
		sw=screen.width; sh=screen.height;
		wbx=Math.round((sw-wdt)/2); wby=Math.round((sh-hgt)/2);
		if (isExplorer) positionCode='left='+wbx+',top='+wby+',';
		if (isNetscape) positionCode='screenX='+wbx+',screenY='+wby+',';
	}
	page=window.open("",'','width='+ wdt +',height='+ hgt +','+positionCode+'toolbar=0,'+'scrollbars=0,'+'resizable=0');
	page.document.open();
pagecode = '<html><title>Âîëõîâåö</title></head><BODY STYLE="margin:0px ; padding:0px"><img src='+ mapURL +' border=0></BODY></html>';
page.document.write(pagecode);
page.document.close();
	if (isNetscape && vv>=3) newWindow.focus();
}
/* ÎÏÐÅÄÅËßÅÌ ÁËÎÊÈ */
v = new Array();
/* ÇÀÂÅÐØÈËÈ ÎÏÐÅÄÅËÅÍÈÅ ÁËÎÊÎÂ */
blocks=new Array();
function SelectElement(block_name,ind)
{
document.getElementById(block_name+'_main').src=blocks[block_name][ind]["middle"];
 // document.all[block_name+'_main'].src=blocks[block_name][ind]["middle"];
 document.getElementById(block_name+'_main').onclick=function(){mapView(blocks[block_name][ind]["full"],'296','361')};
  //document.all[block_name+'_main'].onclick=function(){mapView(blocks[block_name][ind]["full"],'296','361')};
   document.getElementById(block_name+'_ind').style.filter="alpha(opacity=50)";
  //document.all[block_name+'_'+ind].style.filter="alpha(opacity=50)";

}
function DeselectElement(block_name,ind)
{
  //document.all[block_name+'_'+ind].style.filter="alpha(opacity=100)";
  document.getElementById(block_name+'_ind').style.filter="alpha(opacity=100)";
}
function ChangePic(block_name,image_id)
{
document.getElementById(main3).src=document.all.getElementById(img1).src;
	//document.all.main3.src=document.all.img1.src;
}
function IncludeImageBlock(name,urls)
{
  blocks[name]=new Array();
  blocks[name]["name"]=name;
  //document.write('<table width=296 style="border: 0px !important;"><tr style="border: 0px !important;">');
 // if (urls.length>1)
 // {
 //   document.write('<td colspan=3 style="border: 0px !important;">');
 // }
  document.write('<a href="#" OnClick="return false;"><img onClick="mapView(\'/catalogue/models/'+urls[0]+'_full.jpg\',\'296\',\'361\')" id="'+name+'_main" width=296 height=361 border=0 src="/catalogue/models/'+urls[0]+'_middle.jpg"></a>');
  //document.write('</td></tr>');
  document.write('<br clear="all">');
  if (urls.length>1)
  {
    //document.write('<tr style="border: 0px !important;"><td style="border: 0px !important;">');
    for (i=0;i<urls.length;i++)
    {
    // document.write('<div class="catdoor2">');
      if (i<urls.length)
      {
        blocks[name][i]=new Array();
        blocks[name][i]["small"]="/catalogue/models/"+urls[i]+"_small.jpg";
        blocks[name][i]["middle"]="/catalogue/models/"+urls[i]+"_middle.jpg";
        blocks[name][i]["full"]="/catalogue/models/"+urls[i]+"_full.jpg";
        document.write('<img style="margin: 10px 12px 10px 0px;" id="'+name+'_'+i+'" src="/catalogue/models/'+urls[i]+'_small.jpg" value="/catalogue/models/'+urls[i]+'.jpg" onMouseOver="JavaScript:SelectElement(\''+name+'\','+i+');" onMouseLeave="JavaScript:DeselectElement(\''+name+'\','+i+');" width=90 border=0 height=110">');
       // document.all[name+'_'+i].setAttribute('value','/catalogue/models/'+urls[i]+'.jpg');
	   document.getElementById(name+'_'+i).setAttribute('value','/catalogue/models/'+urls[i]+'.jpg');
      }
     // document.write('</div>');
		if ((i==2)||(i==5))
			{
				  document.write('<br clear=all>');
			}
    }
    //document.write('</td></tr></table>');
    SelectElement(name,0);
    DeselectElement(name,0);
  }
  //else
  //{
	//document.write('</table>');
  //}
}
