var header = new Array()
	header[1] = 'Салон 1'
	header[2] = 'Салон 2'
	
var text = new Array()
	text[1] = 'Описание'
	text[2] = 'Описание'
 
        layerStyleRef="layer.";
        layerRef="document.layers";
        styleSwitch="";
   
    layerStyleRef="layer.style.";
    layerRef="document.all";
    styleSwitch=".style";


function show(layerName)
{
    if (parseInt(navigator.appVersion)>= 4)
    {
      eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
     }
}

function cls(layerName){
  if (parseInt(navigator.appVersion)>= 4)
  {
   eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
   }
}

/*************************************************************************************************************************/

bname=navigator.appName;
bver=parseInt(navigator.appVersion);
var cando;

if(bname=="Microsoft Internet Explorer" && bver>=4) {
	cando=true;
	vis='visible';
}
else {
	cando=false;
	vis='hidden';
}

font_style = 'style="FONT: 10px/1.5 Tahoma,Arial,Geneva,sans-serif; LAYOUT-FLOW: vertical-ideographic; color:#FFFFFF"';
div_style = '<div id="text" style="LEFT: 97%; POSITION: absolute; TOP: 0px; height: 100%; width: 30px; visibility: ' + (cando ?'visible' : 'hidden') + '; background-color:#B4A692" align="center">';

function ReverseElement(target){
if (document.getElementById(target).style.display == 'none'){
document.getElementById('td_'+target).style.background="url(img/sm_tree_dots_vert.gif) repeat-y 8px 0px";
document.getElementById('img_'+target).src='img/sm_tree_null.gif';
document.getElementById(target).style.display = '';
}else{
document.getElementById('td_'+target).style.background="url(img/sm_tree_dots_vert1.gif) repeat-y 8px 0px";
document.getElementById('img_'+target).src='img/sm_tree_plus.gif';
document.getElementById(target).style.display = 'none';
}
}

function ReverseElement1(target){
	if (document.getElementById(target).style.display == 'none'){
		document.getElementById('td_'+target).style.background="url(img/sm_tree_dots_vert.gif) repeat-y 20px 0px";
		document.getElementById('img_'+target).src='img/sm_tree_null.gif';
		document.getElementById(target).style.display = '';
	}else{
		document.getElementById('td_'+target).style.background="url(img/sm_tree_dots_vert1.gif) repeat-y 20px 0px";
		document.getElementById('img_'+target).src='img/sm_tree_plus.gif';
		document.getElementById(target).style.display = 'none';
	}
}


function MM_swapImgRestore() { //v3.0
  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_preloadImages() { //v3.0
  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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}



function MM_swapImage() { //v3.0
  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 showHideMenu(oImg, oMenu){
if(oMenu!=null && oMenu.tagName=="P"){
	if(Prototype.Browser.IE) oSubmenu=oMenu.nextSibling;
	else oSubmenu=oMenu.next();
}else oSubmenu=oMenu;
if(oSubmenu!=null && oSubmenu.tagName=="SPAN"){
		if(oSubmenu.offsetHeight>1){
		   oSubmenu.style.display='none';
		   oImg.src='img/plus.gif';
		   oImg.title='Развернуть'
		}
		else{
			oSubmenu.style.display='block';
			oImg.src='img/minus.gif';
			oImg.title='Свернуть'
		}
	}
}
/**********************************catalog scripts**************************/
function getBySelector(className, root, tagName) {
    if(root!=Object) root=document;
    // for native implementations
    if (document.getElementsByClassName && !Prototype.Browser.IE) {
        return root.getElementsByClassName(className);
    }

    // at least try with querySelector (IE8 standards mode)
    // about 5x quicker than below
    if (root.querySelectorAll) {
        tagName = tagName || '';
        return root.querySelectorAll(tagName + '.' + className);
    }

    // and for others... IE7-, IE8 (quirks mode), Firefox 2-, Safari 3.1-, Opera 9-
    var tagName = tagName || '*', _tags = root.getElementsByTagName(tagName), _nodeList = [];

    for (var i = 0, _tag; _tag = _tags[i++];) {
    	if(!Prototype.Browser.IE){
	        if (this.hasClass(_tag, className) ) {
	            _nodeList.push(_tag);
	        }
        }else if(_tag.className==className){
        	_nodeList.push(_tag);
        }
    }
    return _nodeList;
}
function _print ()
{
	var colRadio = document.getElementsByClassName("radioBClass");
	for(i=0; i<colRadio.length; i++)
		if(colRadio[i].checked) urlPostfix = colRadio[i].value;

	window.open('/?page=basket&delivery='+urlPostfix+'&print=1','Печать');
}

function _order ()
{
	var colRadio = document.getElementsByClassName("radioBClass");
	for(i=0; i<colRadio.length; i++)
		if(colRadio[i].checked) urlPostfix = colRadio[i].value;

	location.href='/?page=order&delivery='+urlPostfix;
}
window.onload=function(){   
//initialize blocks of hide/show function
oCont=getBySelector("descr_div",document,"DIV");
	if(oCont!=null){
		for(i=0;i<oCont.length;i++){
				hHeight=oCont[i].getAttribute("height");
				orHeight=oCont[i].offsetHeight;
				if(orHeight>80){
					oA=oCont[i].parentNode.getElementsByTagName('A').item(0);
					oA.innerHTML="Описание полностью";
					//oCont[i].style.height=hHeight+'px';
					oCont[i].style.height='80px';
				}
		}
	}
}
function showHideDetails(obj){
hHeight=obj.getAttribute("height");
//alert(obj.offsetHeight);
oA=obj.parentNode.getElementsByTagName('A').item(0);
if(obj.offsetHeight<=80){
//if(obj.offsetHeight<=hHeight){
	obj.style.height='100%';
	oA.innerHTML="Свернуть описание";
}else{
	//obj.style.height=hHeight+'px';
	obj.style.height='80px';
	oA.innerHTML="Описание полностью";
}
}

function absPosition(obj) {
      var x = y = 0;
      while(obj) {
            x += obj.offsetLeft;
            y += obj.offsetTop;
            obj = obj.offsetParent;
      }
      return {x:x, y:y};
}

function showPricePopup(obj){
	posX=absPosition(obj).x;
	posY=absPosition(obj).y;
	PP=document.getElementById('price_popup');
	PP.style.left=posX-250+'px';
	PP.style.top=posY-130+'px';
	PP.style.display='block';
}





