var winWidth = 610;
var winHeight = 600;
var agent=navigator.userAgent.toLowerCase();
if (agent.indexOf('opera')!=-1)
{
	winHeight = 500;
}

function CurrencyConvert()
{
	document.getElementById('convert_currency').value = (document.getElementById('convert_currency').value == "0") ? "1" : "0";
	document.getElementById('currency').value = (document.getElementById('currency').value == "usd") ? "rur" : "usd";
	document.filter.submit();
	
	return true;
}

function OpenWindow()
{
	
	arr=document.getElementsByTagName('input');
	for (ii=0; ii<arr.length; ii++)
	{
		if (arr[ii].type=='checkbox' && arr[ii].name=="cmp_check" && arr[ii].checked)
		{
			ChangeCompareState(arr[ii].checked,arr[ii].parentNode.getElementsByTagName('input')[1].value,arr[ii].parentNode.getElementsByTagName('input')[2].value);
		}
	}
    goods = CompareStringToArray(GetCookie("compare_string"));
    var g=0;
    var t='';
    for(i=0; i<goods.length; i++)
    {
        if(Number(goods[i]) > 0)
        {
            g++;
        };
    }
    if(g>0)
    {
        window.open('/common/vallar.php','name_of_popup_window','resizable=yes,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,fullscreen=no,dependent=no,width=800,height=600,left=100,top=100');
    }
    else
    {
        alert('Не выбран ни один товар. Отметьте галочками интересующие Вас товары для сравнения');
    }
}

function GetCookie(name)
{
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   return unescape(document.cookie.substring(len,end));
}

function SetCookie(name,value,expires,path,domain,secure)
{
    var cookieString = name + "=" +escape(value) +
       ( (expires) ? ";expires=" + expires.toGMTString() : "") +
       ( (path) ? ";path=" + path : ";path=/") +
       ( (domain) ? ";domain=" + domain : "") +
       ( (secure) ? ";secure" : "");
    document.cookie = cookieString;
}

function CompareStringToArray(s)
{
  if(s==null) return new Array();
  return s.split(',');
}

function ArrayToCompareString(ids)
{
  s="";
  for(i=0;i<ids.length; i++)
  {
    s+=ids[i]+",";
  }
  return s;
}

function AddToCompare(good_id, category_id)
{
  goods_str = "";
  goods_str = GetCookie('compare_string');
  group = GetCookie('compare_group');
  goods = CompareStringToArray(goods_str);
  if(goods.length > 0 && group != category_id)
  {
    if(!confirm("Для сравнения необходимо выбрать товары из одной группы. Нажмите ОК для очистки списка или отмену для отмена операции")){
      document.getElementById('chkbx_'+good_id).checked = false;
    }else{
         SetCookie('compare_group',category_id);
         SetCookie('compare_string',"");
         AddToCompare(good_id, category_id);
    }
    return;
  }

  // lookup this good_id
  for(i=0; i<goods.length; i++)
  {
    if(goods[i] == good_id) return;
  }

  if(goods.length==0)
    group = category_id;

  goods.push(good_id);

  SetCookie('compare_string',ArrayToCompareString(goods),0,'/');
  SetCookie('compare_group',group,0,'/');
}

function RemoveFromCompare(good_id)
{
  goods_str = "";
  goods_str = GetCookie('compare_string');
  goods = CompareStringToArray(goods_str);
  goods_new = new Array();
  // lookup this good_id
  for(i=0; i<goods.length; i++)
  {
    if(goods[i] != good_id)
    {
     //if(goods[i]=='' || goods[i]=='undefined'){
      goods_new.push(goods[i]);
     //}
    }
  }
  SetCookie('compare_string',ArrayToCompareString(goods_new),0,'/');
}

function ChangeCompareState(ck_checked, good_id, cat_id)
{
  if(!ck_checked)
  {
    RemoveFromCompare(good_id);
  }
  else
  {
    AddToCompare(good_id, cat_id);
  }
  return;
}

var pricehelp = "Цена доступна в рамках акции <a href=\"http://www.ultra-online.ru/action.php\" target=\"_top\">«Ударим доставкой по погодным аномалиям»!</a>";


var Price_availability_0 = "Товар отсутствует на складе, информация о будущих поставках отсутствует";
var Price_availability_s1 = "Товар ожидается";
var Price_availability_s2 = "Обрабатывается на складе, в ближайшее время поступит в продажу";
var Price_availability_16 = "Товар свободен для заказа";
var Price_availability_713 = "Весь имеющийся на складе товар зарезервирован, для получения оперативной информации о поступлении воспользуйтесь сервисом \"Уведомления\"";

var CatalogStatus_0 = "Товар свободен для заказа";
var CatalogStatus_1 = "Весь имеющийся на складе товар зарезервирован, о возможности продажи этого товара можно узнать у менеджеров";
var CatalogStatus_3 = "Товар отсутствует на складе, информация о будущих поставках отсутствует";
var CatalogStatus_4 = "Товар обрабатывается на складе и вскоре поступит в продажу";
var CatalogStatusService = "Услуга оформляется через менеджеров отдела продаж";

var PriceColumn_1 = "При покупке на сумму более&nbsp;35&nbsp;000&nbsp;рублей и месячном обороте от&nbsp;70&nbsp;000&nbsp;рублей";
var PriceColumn_2 = "При покупке на сумму более&nbsp;60&nbsp;000&nbsp;рублей и квартальном обороте от&nbsp;200&nbsp;000&nbsp;рублей";

var SubOrderTip = "Товар поставляется в течение 3-х дней при онлайн-заказе. <a href=\"http://www.ulmart.ru/pages/help/faq/index.html#6\" target=\"_blank\">Подробности...</a>";

function showHelpTip(e, sHtml, bHideSelects, mouseOutHidden) {
        // find anchor element
        var el = e.target || e.srcElement;
        while (el.tagName != "A")
                el = el.parentNode;

        // is there already a tooltip? If so, remove it
        if (el._helpTip) {
                helpTipHandler.hideHelpTip(el);
        }

        helpTipHandler.hideSelects = Boolean(bHideSelects);

        // create element and insert last into the body
        helpTipHandler.createHelpTip(el, sHtml);

        // position tooltip
        helpTipHandler.positionToolTip(e);

        // add a listener to the blur event.
        // When blurred remove tooltip and restore anchor
        el.onblur = helpTipHandler.anchorBlur;
        el.onkeydown = helpTipHandler.anchorKeyDown;
		if (mouseOutHidden)
		{
			el.onmouseout = helpTipHandler.anchorMouseOut;
		}
}

var helpTipHandler = {
        hideSelects:        false,

        helpTip:                null,

        showSelects:        function (bVisible) {
                if (!this.hideSelects) return;
                // only IE actually do something in here
                var selects = [];
                if (document.all)
                        selects = document.all.tags("SELECT");
                var l = selects.length;
                for        (var i = 0; i < l; i++)
                        selects[i].runtimeStyle.visibility = bVisible ? "" : "hidden";
        },

        create:        function () {
                var d = document.createElement("DIV");
                d.className = "help-tooltip";
                d.onmousedown = this.helpTipMouseDown;
                d.onmouseup = this.helpTipMouseUp;
                document.body.appendChild(d);
                this.helpTip = d;
        },

        createHelpTip:        function (el, sHtml) {
                if (this.helpTip == null) {
                        this.create();
                }

                var d = this.helpTip;
                d.innerHTML = sHtml;
                d._boundAnchor = el;
                el._helpTip = d;
                return d;
        },

        // Allow clicks on A elements inside tooltip
        helpTipMouseDown:        function (e) {
                var d = this;
                var el = d._boundAnchor;
                if (!e) e = event;
                var t = e.target || e.srcElement;
                while (t.tagName != "A" && t != d)
                        t = t.parentNode;
                if (t == d) return;

                el._onblur = el.onblur;
                el.onblur = null;
        },

        helpTipMouseUp:        function () {
                var d = this;
                var el = d._boundAnchor;
                el.onblur = el._onblur;
                el._onblur = null;
                el.focus();
        },

        anchorBlur:        function (e) {
                var el = this;
                helpTipHandler.hideHelpTip(el);
        },

        anchorKeyDown:        function (e) {
                if (!e) e = window.event
                if (e.keyCode == 27) {        // ESC
                        helpTipHandler.hideHelpTip(this);
                }
        },

        anchorMouseOut:        function (e) {
                helpTipHandler.hideHelpTip(this);
        },

        removeHelpTip:        function (d) {
                d._boundAnchor = null;
                d.style.filter = "none";
                d.innerHTML = "";
                d.onmousedown = null;
                d.onmouseup = null;
                d.parentNode.removeChild(d);
                //d.style.display = "none";
        },

        hideHelpTip:        function (el) {
                var d = el._helpTip;
                /*        Mozilla (1.2+) starts a selection session when moved
                        and this destroys the mouse events until reloaded
                d.style.top = -el.offsetHeight - 100 + "px";
                */

                d.style.visibility = "hidden";
                //d._boundAnchor = null;

                el.onblur = null;
                el._onblur = null;
                el._helpTip = null;
                el.onkeydown = null;

                this.showSelects(true);
        },

        positionToolTip:        function (e) {
                this.showSelects(false);
                var scroll = this.getScroll();
                var d = this.helpTip;

                // width
                if (d.offsetWidth >= scroll.width)
                        d.style.width = scroll.width - 10 + "px";
                else
                        d.style.width = "";

                // left
                if (e.clientX > scroll.width - d.offsetWidth)
                        d.style.left = scroll.width - d.offsetWidth + scroll.left + "px";
                else
                        d.style.left = e.clientX - 2 + scroll.left + "px";

                // top
                if (e.clientY + d.offsetHeight + 18 < scroll.height)
                        d.style.top = e.clientY + 18 + scroll.top + "px";
                else if (e.clientY - d.offsetHeight > 0)
                        d.style.top = e.clientY + scroll.top - d.offsetHeight + "px";
                else
                        d.style.top = scroll.top + 5 + "px";

                d.style.visibility = "visible";
        },

        // returns the scroll left and top for the browser viewport.
        getScroll:        function () {
                if (document.all && typeof document.body.scrollTop != "undefined") {        // IE model
                        var ieBox = document.compatMode != "CSS1Compat";
                        var cont = ieBox ? document.body : document.documentElement;
                        return {
                                left:        cont.scrollLeft,
                                top:        cont.scrollTop,
                                width:        cont.clientWidth,
                                height:        cont.clientHeight
                        };
                }
                else {
                        return {
                                left:        window.pageXOffset,
                                top:        window.pageYOffset,
                                width:        window.innerWidth,
                                height:        window.innerHeight
                        };
                }

        }

};

function class_click(state)
{
    document.getElementById('group_class').value=state?1:0;
    document.getElementById('group_vend').value=0;
    document.getElementById('group_v').checked=false;
}

function vend_click(state)
{
    document.getElementById('group_vend').value=state?1:0;
    document.getElementById('group_class').value=0;
    document.getElementById('group_c').checked=false;
}

function openPriceChange(pr1,pr2,dt1,dt2)
{
    PriceWin=open("", "","scrollbars=0,resizable=0,width=160,height=70,status=no,toolbar=no,menubar=no");
    PriceWin.document.open();
    PriceWin.document.write("<html><head><title>"+goods_price_change+"</title><link rel='stylesheet' href='" + statisHostUri + "/etc/css/style2.css' type='text/css' /></head><body leftmargin=0 topmargin=0>");
    PriceWin.document.write("<center><br><table border='0' cellpadding='0' cellspacing='1' width='150'><tr>    <td bgcolor='#BBCEEC' align='center'>"+goods_new_price+"</td>    <td bgcolor='#BBCEEC' width='60' align='center'>"+goods_date+"</font></td></tr><tr>    <td align='center'>"+pr1+"</td><td align='center'>"+dt1+"</td></tr><tr>    <td></td><td></td></tr><tr><td bgcolor='#BBCEEC' align='center'>"+goods_prev_price+"</td>    <td bgcolor='#BBCEEC' width='60' align='center'>"+goods_date+"</td></tr><tr>    <td align='center'>"+pr2+"</td><td align='center'>"+dt2+"</td></tr></table></center>");
    PriceWin.document.write("</body></html>");
    PriceWin.focus();
    PriceWin.document.close();
}

function openPriceComplaint(good_id, site_id)
{
//    window.open("http://www.ulmart.ru/common/price_compl.php?good_id="+good_id+"&site_id="+site_id,"","scrollbars=0,resizable=0,width=400,height=400,status=no,toolbar=no,menubar=no");
//    window.open("/common/price_compl.php?good_id="+good_id+"&site_id="+site_id,"","scrollbars=0,resizable=0,width=450,height=400,status=no,toolbar=no,menubar=no");
	window.open("/common/price_compl.php?good_id="+good_id+"&site_id="+site_id,"","scrollbars=1,resizable=1,width=800,height=700,status=no,toolbar=no,menubar=no");
    return false;
}

function openEstimate(url, goodID)
{
    window.open(url + "common/estimate.php?goodID=" + goodID,goodID,"scrollbars=1,resizable=0,width=650,height=400,status=no,toolbar=no,menubar=no");
    return false;
}

// PREVIEW BEGIN
var frameYPosition = 0;
function goodsPreviewForm(rXml, rText, rP)
{
	if (frameYPosition == 0 && window.parent.document.getElementById("price") != null)
	{
		elem = window.parent.document.getElementById("price");
		while (elem)
		{
			frameYPosition += elem.offsetTop;
			elem = elem.offsetParent;
		}
	}

	var x = ((!isNaN(window.innerWidth) ? window.innerWidth : document.body.offsetWidth) / 2) - (640 / 2);
	var y = 10;

	// True browsers
	if (!isNaN(window.pageYOffset))
	{
		offset = window.pageYOffset + window.parent.pageYOffset - frameYPosition;
		if (offset > 0)
		{
			y += offset;
		}
	}
	else
	{
		offset = document.body.scrollTop + window.parent.document.body.scrollTop - frameYPosition;
		if (offset > 0)
		{
			y += offset;
		}
	}
	
	$("goodsPreviewFrame").innerHTML = rText;
	$("goodsPreviewFrame").style.top = y;
	$("goodsPreviewFrame").style.left = x;
	$("goodsPreviewFrame").style.visibility = "visible";
}

function goodsPreviewIn(siteURL, goodID, barcodeID)
{
	var p = new Object();
	XMLHttpSendRequest(siteURL + 'goods/' + goodID + (barcodeID != 0 ? "_" + barcodeID : "" ) + "/?preview", goodsPreviewForm, false, p);
}
function goodsPreviewOut()
{
	$("goodsPreviewFrame").style.visibility = "hidden";
}
function quickSearch(str)
{
	str = str.toLowerCase();
	var tbl = $("mt");
	for (i = 0; i < tbl.rows.length; i++)
	{
		var row = tbl.rows[i];
		var vis = false;
		// Find rows
		if (row.id.indexOf("tpr") != -1)
		{
			// Find cell - 'name'
			for (j = 0; j < row.cells.length; j++)
			{
				var cell = row.cells[j];
				if (cell.id.indexOf("tx") != -1)
				{
					var spans = cell.getElementsByTagName("span");
					if (spans.length == 1)
					{
						var name = spans[0].innerHTML.toLowerCase();
						if (name.indexOf(str) != -1)
						{
							vis = true;
						}
					}
				}
			}

			if (vis)
			{
				try
				{
					$(row.id).style.display='table-row';
				}
				catch(e)
				{
					$(row.id).style.display='block';
				}
			}
			else
			{
				$(row.id).style.display="none";
			}
		}
	}
}

function quickSearch2(str)
{
	str = str.toLowerCase();
	var tbl = $("mt");
	for (i = 0; i < tbl.rows.length; i++)
	{
		var row = tbl.rows[i];
		var vis = false;
		// Find rows
		if (row.id.indexOf("tpr") != -1)
		{
			// Find cell - 'name'
			for (j = 0; j < row.cells.length; j++)
			{
				var cell = row.cells[j];
				if (cell.id.indexOf("tx") != -1)
				{
					var spans = cell.getElementsByTagName("a");
					if (spans.length > 0 && spans[0].className == "catalog_goods")
//					if (spans.length == 1)
					{
						var name = spans[0].innerHTML.toLowerCase();
						if (name.indexOf(str) != -1)
						{
							vis = true;
						}
					}
				}
			}

			if (vis)
			{
				try
				{
					$(row.id).style.display='table-row';
				}
				catch(e)
				{
					$(row.id).style.display='block';
				}
			}
			else
			{
				$(row.id).style.display="none";
			}
			
			// Black hack
			var splitRow = tbl.rows[i+1]
			if (splitRow != null && splitRow.id.indexOf("tps") != -1)
			{
			    if (vis)
			    {
				try
				{
					$(splitRow.id).style.display='table-row';
				}
				catch(e)
				{
					$(splitRow.id).style.display='block';
				}
			    }
			    else
			    {
				$(splitRow.id).style.display="none";
			    }
			}
		}
	}
}

function openExtSearchWindow(catID)
{
	window.open('/common/extended_search.php?cat='+catID,'Extended_Search','resizable=yes,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,fullscreen=no,dependent=no,width=640,height=480,left=100,top=100');
}
function showBrand()
{
	var brands = document.getElementById('brands');
	if (brands.style.display == 'none')
	{
		brands.style.display = 'block';
	}
	else
	{
		brands.style.display = 'none';
	}
}
function brandOK()
{
	document.getElementById('filter').submit();
	return false;
}
function brandClean()
{
	var brandList = document.getElementById('brandList');
	if (brandList != null)
	{
		var checkList = brandList.getElementsByTagName("input");
		for (i = 0; i < checkList.length; i++)
		{
			var tag = checkList[i];
			tag.checked = false;
		}
	}
	brandOK();
	return false;
}
function groupOk(value)
{
	document.getElementById('filter_group').value = value;
	document.getElementById('filter').submit();
	return false;
}
function changeOrder(orderby, orderdir)
{
    $("#orderby").val(orderby);
    $("#orderdir").val(orderdir);
    $("#filter").submit();
    return false;
}
function openMailWindow(url)
{
	window.open('/common/send_link.php?url='+encodeURI(url),'name_of_popup_window','resizable=yes,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,fullscreen=no,dependent=no,width=600,height=200,left=100,top=100');
}

/////////////////////////////
// События с иконкой корзины

//cart_icon_link_hover = '/i/menu3/cart_icon_anim_hover.gif';
//cart_icon_link_click = '/i/menu3/cart_icon_2_anim.gif';
//cart_icon_link_default = '/i/menu3/cart_icon_stat.gif';
cart_icon_link_click = '/i/catalog2/buy_button_box.png';
cart_icon_link_default = '/i/catalog2/buy_button_ico.png';
cart_icon_link_hover = '/i/menu3/cart_icon_anim_hover.gif';

cart_icon_put = new Array();
function cartIconHover(eThis, icon_gid)
{
	/*
	if (cart_icon_put[icon_gid] != undefined && cart_icon_put[icon_gid])
		return true;
		
	eThis.src = cart_icon_link_hover;
	*/
	eThis.className = 'buy_button_hover';
}
function cartIconClick(eThis, icon_gid)
{
	if (cart_icon_put[icon_gid] == null || cart_icon_put[icon_gid] == undefined)
	{
		cart_icon_put[icon_gid] = 0;
	}
	cart_icon_put[icon_gid] = cart_icon_put[icon_gid]+1;
	
	im = document.getElementById('gb_btn_'+icon_gid);
	im.src = cart_icon_link_click;
	
	quantity = (im.parentNode.getElementsByTagName('span')[1])? im.parentNode.getElementsByTagName('span')[1].innerHTML.replace(/[^\d∞\-ь]+/gi, '') : 0;
	quantity=(quantity=='1ь')? 0 : quantity;
	quantity=(quantity=='2-3')? 0 : quantity;
	quantity=(quantity=='∞')? 100 : quantity*1;
	
	texto='<nobr>Уже в корзине <span ';
	if (quantity+1>9)
	{
		texto+='style="font-size: 11px !important; letter-spacing:0.2px;  color: #a0a0a0;"';
	}
	texto+='>('+(quantity+1)+')</span></nobr>';
	if(quantity+1>=100)
	{
		texto=texto.replace(/\((\d)+\)/gi, '(∞)');
	}
	im.parentNode.getElementsByTagName('span')[0].innerHTML=texto;
	
	
	
	// отступ через LEFT делаем!
	im.parentNode.getElementsByTagName('span')[0].style.left='44px'; 
	im.parentNode.getElementsByTagName('span')[0].style.marginLeft='0';
	im.parentNode.getElementsByTagName('span')[0].style.color='#515151';
	im.parentNode.style.backgroundColor='white';
}
ert=11;
function cartIconClick2(eThis, icon_gid)
{
	
	if (cart_icon_put[icon_gid] == null || cart_icon_put[icon_gid] == undefined)
	{
		cart_icon_put[icon_gid] = 0;
	}
	cart_icon_put[icon_gid] = cart_icon_put[icon_gid]+1;
	
	im = document.getElementById('gb_btn_'+icon_gid);
	im.src = cart_icon_link_click;
	
	quantity = (im.parentNode.getElementsByTagName('span')[0])? im.parentNode.getElementsByTagName('span')[0].innerHTML.replace(/[^\d∞\-ь]+/gi, '') : 0;
	
	quantity=(quantity=='1ь')? 0 : quantity;
	quantity=(quantity=='2-3')? 0 : quantity;
	quantity=(quantity=='∞')? 100 : quantity*1;


	texto='<nobr>Уже в корзине <span ';
	if (quantity+1>9)
	{
		texto+='style="font-size: 11px !important; letter-spacing:0.2px;  color: #a0a0a0;"';
	}
	texto+='>('+(quantity+1)+')</span></nobr>';
	if(quantity+1>=100)
	{
		texto=texto.replace(/\((\d)+\)/gi, '(∞)');
	}
	im.parentNode.getElementsByTagName('p')[0].innerHTML=texto;
	
	
	// отступ через LEFT делаем!
	//im.parentNode.getElementsByTagName('p')[0].style.left='44px'; 
	//im.parentNode.getElementsByTagName('span')[0].style.marginLeft='-33px';
	im.parentNode.getElementsByTagName('p')[0].style.color='#515151';
	im.parentNode.style.backgroundColor='white';
}
function cartIconDefault(eThis, icon_gid)
{
	/*
	if (cart_icon_put[icon_gid] != undefined && cart_icon_put[icon_gid])
		return true;
	
	eThis.src = cart_icon_link_default;
	*/
	eThis.className = 'buy_button';
}
/*
var cart_icon_1 = new Image();
var cart_icon_2 = new Image();
cart_icon_1.src = icon_link_click;
cart_icon_2.src = icon_link_hover;
*/


/////////////
// всплывающая инфа о наличии

var bb_bg = new Image(); // прелоад
bb_bg.src = '/i/catalog2/buy_button_bg.jpg';
var await_helptip = 0;

function ptShow(gid, eThis, mode)
{
	if (await_helptip == 25)
	{
		eTh = eThis;
		await_helptip = 1;
		
		setTimeout("ptShow('"+gid+"', eTh, "+mode+")", 500);
		
		return true;
	}
	else
	{
		eth = eThis
	if (mode == undefined)
	{
		mode = 1;
	}
	
	pt_enable_hide = false;
	pop_custom = document.getElementById('pt_custom_'+mode+'_'+gid);
	pop_custom2 = document.getElementById('pt_custom_ext_'+mode+'_'+gid); // доп блок, сборный текст если 
	pop_div = document.getElementById('pop_div_block');
	
	//pop_div.style.display='none';
	pos = getAbsolutePos(eThis);
	
		page_width = document.body.clientWidth
	
		
		
	await_helptip = 0;
	
	//pop_div.style.display = 'none';
		temp_hellp=setTimeout("display_it(pos, eth)", 500);
	
	
	}
}

a = 0
pt_enable_hide = true;	
function display_it(pos, eThis) {
		pop_div.style.display = '';
		px = pos.x-pop_div.offsetWidth-10;
		py = pos.y-pop_div.offsetHeight+eThis.offsetHeight
		
		
		
		if (page_width < px+pop_div.offsetWidth) // справа упирается
		{
			
		}
		
		if (px<0) // слева упирается
		{
			px = 10;
			py = pos.y-pop_div.offsetHeight-10;
		}

		
		pop_div.style.left = px+'px';
		pop_div.style.top = py+'px';
		document.getElementById('ptCont').innerHTML = '';
	if (pop_custom != undefined)
	{
		document.getElementById('ptCont').innerHTML += pop_custom.innerHTML;
	}
	if (pop_custom2 != undefined)
	{
		document.getElementById('ptCont').innerHTML += pop_custom2.innerHTML;
	}	
	
	}
function ptHide()
{
	//alert(a);
	pt_enable_hide = true;
	pop_div = document.getElementById('pop_div_block');
	
	clearTimeout(temp_hellp	);
		setTimeout('ptHideTimer()',900);
		
	
}
function choose(event) {
target=event.target ? event.target : event.srcElement
return target
}

function ptHideTimer()
{
	if (!pt_enable_hide)
		
		return false;
		
	pop_div = document.getElementById('pop_div_block');
	pop_div.style.display = 'none';	
	is_popup=0;
}

pt_enable_hide = true;


///////////////


function addGoodToConfigurator(good_id, retail, conf_group)
{
	document.getElementById('goods_id').value = good_id;
	document.getElementById('retail').value = retail;
	document.getElementById('conf_group').value = conf_group;
	document.getElementById('add_goods_form').submit();
}
