function GetUrl()
{
	var url = document.location.href;
	if ((url.indexOf('456') != -1) || (url.indexOf('492') != -1) ||	(url.indexOf('493') != -1) ||
	(url.indexOf('522') != -1) || (url.indexOf('523') != -1) || (url.indexOf('524') != -1))
	{
		var ref = document.getElementById('rNews');
		ref.className = 'menu_selected';
		ref = document.getElementById('rNews2');
		ref.className = 'menu_selected';
	}else
	    if ((url.indexOf('460') != -1) || (url.indexOf('472') != -1) || (url.indexOf('471') != -1) || (url.indexOf('502') != -1) || (url.indexOf('500') != -1) || (url.indexOf('517') != -1) || (url.indexOf('501') != -1) ||
	        (url.indexOf('525') != -1) || (url.indexOf('471') != -1) || (url.indexOf('526') != -1) || (url.indexOf('533') != -1) || (url.indexOf('527') != -1) || (url.indexOf('539') != -1) || (url.indexOf('531') != -1))
	{
		var ref = document.getElementById('rUseful');
		ref.className = 'menu_selected';
		ref = document.getElementById('rUseful2');
		ref.className = 'menu_selected';
	}else
	    if ((url.indexOf('461') != -1) || (url.indexOf('496') != -1) || (url.indexOf('483') != -1) || (url.indexOf('482') != -1) || (url.indexOf('508') != -1) || (url.indexOf('514') != -1) ||
	        (url.indexOf('541') != -1) || (url.indexOf('496') != -1) || (url.indexOf('549') != -1) || (url.indexOf('548') != -1) || (url.indexOf('551') != -1) || (url.indexOf('556') != -1))
	{
		var ref = document.getElementById('rMoms');
		ref.className = 'menu_selected';
		ref = document.getElementById('rMoms2');
		ref.className = 'menu_selected';
	}else
	if ((url.indexOf('470') != -1) || (url.indexOf('490') != -1) || (url.indexOf('480') != -1) || (url.indexOf('497') != -1) || (url.indexOf('491') != -1) ||
	    (url.indexOf('567') != -1) || (url.indexOf('568') != -1) || (url.indexOf('573') != -1) || (url.indexOf('569') != -1) || (url.indexOf('574') != -1))
	{
		var ref = document.getElementById('rGoods');
		ref.className = 'menu_selected';
		ref = document.getElementById('rGoods2');
		ref.className = 'menu_selected';
	}else
	    if ((url.indexOf('272') != -1) || (url.indexOf('462') != -1) ||
	        (url.indexOf('570') != -1) || (url.indexOf('557') != -1))
	{
		var ref = document.getElementById('rAsk');
		ref.className = 'menu_selected';
		ref = document.getElementById('rAsk2');
		ref.className = 'menu_selected';
	}else
	    if ((url.indexOf('465') != -1) || (url.indexOf('484') != -1) || (url.indexOf('485') != -1) || (url.indexOf('486') != -1) || (url.indexOf('487') != -1) || (url.indexOf('488') != -1) || (url.indexOf('489') != -1) || (url.indexOf('494') != -1) || (url.indexOf('495') != -1) ||
	        (url.indexOf('558') != -1) || (url.indexOf('559') != -1) || (url.indexOf('560') != -1) || (url.indexOf('561') != -1) || (url.indexOf('562') != -1) || (url.indexOf('563') != -1) || (url.indexOf('564') != -1) || (url.indexOf('565') != -1) || (url.indexOf('566') != -1))
	{
		var ref = document.getElementById('rBuy');
		ref.className = 'menu_selected';
		ref = document.getElementById('rBuy2');
		ref.className = 'menu_selected';
	}
	/*else
	{
		var ref = document.getElementById('rMain');
		ref.className = 'menu_selected';
		ref = document.getElementById('rMain2');
		ref.className = 'menu_selected';
	}*/
	return true;
}

function AddGood(GoodID, Action, f)
{
	if(Action == 'add')
    {
        ShowInfo(2000);
		GoodCount = document.getElementById('otext' + GoodID).value;
		if (GoodCount != '0')
		{
 	 	   	new Ajax.Updater('basketdiv',
    	    	'http://zabota.by/modules/Catalog/ajax/Basket.aspx?GoodID=' + GoodID + '&Action=' + Action + '&GoodCount=' + GoodCount,
	            {asynchronous:true,
    	   	    parameters: Form.serialize(f)}); 
		}
		else
		{
			alert('Пожалуйста, укажите количество единиц товара!');
		}
	}
    else if ((Action == 'clear') || (Action == 'delete'))
 	{
  		new Ajax.Updater('basketdiv',
    		    'http://zabota.by/modules/Catalog/ajax/Basket.aspx?GoodID=' + GoodID + '&Action=' + Action,
            	{asynchronous:true}); 
	}
	
    return false;
}

function AddGood(GoodID, Action, f, lang) 
{
    address = 'http://zabota.by/modules/Catalog/ajax/Basket.aspx?GoodID=';
    
    if (lang == 'bel')
        address = 'http://zabota.by/modules/Catalog/ajax/Basket_bel.aspx?GoodID=';  
        
     if (Action == 'add')
     {
        ShowInfo(2000);
        GoodCount = document.getElementById('otext' + GoodID).value;
        if (GoodCount != '0') {
            new Ajax.Updater('basketdiv',
    	    	address + GoodID + '&Action=' + Action + '&GoodCount=' + GoodCount,
	            { asynchronous: true,
	                parameters: Form.serialize(f)
	            });
        }
        else
        {            
            if (lang == 'bel')
                alert('Калі ласка, пазначце колькасць адзінак тавару!');
            else
                alert('Пожалуйста, укажите количество единиц товара!');            
        }
    }
    else if ((Action == 'clear') || (Action == 'delete')) {
        new Ajax.Updater('basketdiv',
    		    address + GoodID + '&Action=' + Action,
            	{ asynchronous: true });
    }

    return false;
}

function ShowInfo(latancy)
{
    document.getElementById('Info_win').style.display = 'block';
    setTimeout("HideInfo()",latancy);
}

function HideInfo()
{
    document.getElementById('Info_win').style.display = 'none';
}

function CheckGood(ID)
{
    if (document.getElementById(ID).value == '0')
    {
        alert('Пожалуйста, укажите количество единиц товара!');
    }
}

function CheckGood(ID, lang)
{
    if (document.getElementById(ID).value == '0') 
    {
        if (lang == 'bel')
            alert('Калі ласка, пазначце колькасць адзінак тавару!');        
        else
            alert('Пожалуйста, укажите количество единиц товара!');
    }
}

function Order()
{
    return 
}

