//<script>
function showPopUpProduct(idp,ids)
{
 	 var url=window.location.protocol+'//'+window.location.host +'/content/catalog/print/root_site/ida/'+idp+'/ids/'+ids+'/shmode/2.html';
  	 var vsp=window.open(url,"popup_product","status=no,menubar=no,scrollbars=yes,width=680,height=500,resizable=yes,titlebar=no,toolbar=no,location=no,directories=yes,channelmode=no")
}
function setMode(idmode)
{
    document.getElementsByName("operation")[0].value = idmode;
}

function compareProduct(idSection)
{
    arpr = document.getElementsByName("compProductID");
    rresult = "-1";
    var s = 0;
    for (x=0; x < arpr.length; x++)
    {
	    if (arpr[x].checked == true)
	    {
	        s = s + 1;
		    rresult = rresult + "," + arpr[x].value;
	    }
    }
    if (s < 2)
    {
		alert('Необходимо отметить 2 и более товаров для сравнения');
    }
    else
    {
        var url = window.location.protocol+'//'+window.location.host +'/content/catalog/compare.asp?shmode=200&ids='+idSection+'&idps='+rresult;
  	    var vsp = window.open(url,"compare_product","status=no,menubar=no,scrollbars=yes,width=680,height=400,resizable=yes,titlebar=no,toolbar=no,location=no,directories=yes,channelmode=no")
    }
}

function catFolderOpen(obj)
{
    folder = document.getElementById(obj);
    //alert(folder.childNodes.length)
    if (folder.style.display == "none")
    {
        folder.style.display = "block";
    }
    else
    {
        folder.style.display = "none";
    }
}

function catImageZoom(mode, obj)
{
    target = document.getElementById(obj);
    if (mode == 1)
    {
        target.style.display = "block";
    }
    else
    {
        target.style.display = "none";
    }
}
function selectProductToCompare(obj, checkBoxID)
{
    var img = obj.firstChild;
    var checkbox = document.getElementById(checkBoxID);
    if (obj.getAttribute("nselected") == "0")
    {
        img.src = "/images/content/compareActive.gif";
        checkbox.checked = true;
        obj.setAttribute("nselected", "1");
    }
    else
    {
        img.src = "/images/content/compareInActive.gif";
        checkbox.checked = false;
        obj.setAttribute("nselected", "0");
    }
}

function showCatFilter(obj)
{
    filter = document.getElementById(obj);
    if (filter.style.display == "" || filter.style.display == "none")
    {
        filter.style.display = "block";
    }
    else
    {
        filter.style.display = "none";
    }
}

function showResponse(id,ids,scope)
{
    vsp=window.open("/content/store/popup.asp?shmode=2&id="+id+"&ids="+ids+"&idt="+scope,"show_response","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=430,height=350,resizable=no")
}

function addToBasket(id,ids)
{
/*    var tParam = null;
//	var return_param=window.showModalDialog("/content/basket/basketform.asp",tParam,'dialogHeight:70px;dialogWidth:80px;center:1;status:no;help:no;')
    vsp=window.open("/content/basket/basketform.asp","add_tobasket","status=0,menubar=0,scrollbars=0,width=170,height=80,resizable=0,titlebar=0,toolbar=0,location=0,directories=0,channelmode=0")
alert(1);
	
	if (return_param!=null)
	{
		if (return_param.ok==1)
		{
			var amount=return_param.retvalue;
			var x, d, t = 'text/plain';
			var u='/content/basket/addtobasket.asp?amount='+amount+'&idi='+id+'&ids='+ids;
			function g(s) {
				x = 0;
				try {
					x = new ActiveXObject(s);
				} catch (s) {
				}
			return x;
			};
			x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();
			x.overrideMimeType && x.overrideMimeType(t);
			x.open("GET", u, false);
			x.send(null);
			var formElement=document.getElementById('topBasketText');
			formElement.innerHTML= x.responseText;
		}
	}
	*/
}

var _currenSeason = null;
var _currentButton = 0;
var _currentButtonIndex = 0;
var _topImages = new Array();
var _imgPath = "/images/topmenu/";
var _advScript = "/content/store/flashData.asp?shmode=1&ids=summer";
var _advertising = null;
var _advertisingFrame = null;

function preloadMenuImages(season)
{
    img1Path = "/images/topmenu/" + season + "/m1a.gif";
    img2Path = "/images/topmenu/" + season + "/m2a.gif";
    img3Path = "/images/topmenu/" + season + "/m3a.gif";
    img4Path = "/images/topmenu/" + season + "/m4a.gif";
}
function showTopAdvertising(obj, image, season, currentSeason)
{
    if (_currenSeason == null)
    {
        obj.firstChild.src = _imgPath + currentSeason + "/m" + image + "a.gif";
        _currenSeason = season;
        _currentButton = obj;
        _currentButtonIndex = image;
        showAdvertising("url");
    }
    else
    {
        if (_currenSeason == season)
        {
            hideAdvertising(currentSeason);
        }
        else
        {
            _currentButton.firstChild.src = _imgPath + currentSeason + "/m" + _currentButtonIndex + ".gif";
            obj.firstChild.src = _imgPath + currentSeason + "/m" + image + "a.gif";
            _currenSeason = season;
            _currentButton = obj;
            _currentButtonIndex = image;
            showAdvertising("url");
        }
    
    }
}

function showAdvertising(url)
{
    if (_advertising == null)
    {
        _advertising = document.getElementById("advertising");
        _advertisingFrame = document.getElementById("advertisingFrame");
    }
    if (_advertising.style.display == "none" || _advertising.style.display == "")
    {
        _advertising.style.display = "block";
        _advertisingFrame.src = _advScript;
    }
}

function hideAdvertising(currentSeason)
{
    _currentButton.firstChild.src = _imgPath + currentSeason + "/m" + _currentButtonIndex + ".gif";
    _currenSeason = null;
    _advertising.style.display = "none";
}
function showResponseBook(e)
{
    target = document.getElementById(e);
    if (target.style.display == "")
    {
        target.style.display = "block";
    }
    else
    {
        target.style.display = "";
    }
}