function fncShcartAdd(
    natProductId // вызов с 0 тоже используется
) {

    if (
        natProductId != 0
    ) {
        fncShcartMsg(false);
    } // if
/*
    if (
        $('#ajxld'+natProductId)
    ) {
        $('#ajxld'+natProductId).html('&nbsp;<img src="/i/ajax-loader.gif" width="16" height="16" border="0" alt="..." align="absmiddle">');
    } // if
*/
	$.ajax({

		url: '/shcart_ajax_click.php',
		type: 'POST',
		data: { 'prod_id': natProductId },

		dataType: 'json',
		cache: false,

		success: function (data, textStatus) {

            var htmlACart =
//                '<a href="#" onclick="viewWind(\'/shcart.php\', \'Order2\',\'scrollbars=yes,resizable=no,width=800,height=600\'); return false;">'
                '<a href="/shcart.html">'
            ;
/*
            if (
                $('#ajxld'+natProductId)
            ) {
                $('#ajxld'+natProductId).html('Товар в&nbsp;' + htmlACart + 'корзине</a>');
            } // if
*/
            if (
                $('#shcartrsm')
            ) {
                if ( 0 == data['qtyTotalInCart'] ) {
                    $('#shcartrsm').html(htmlACart + 'Корзина пуста</a>');
                } // if
                else {
                    $('#shcartrsm').html(htmlACart + 'корзина&nbsp;(' + data['qtyTotalInCart'] + ')</a>');
                } // else
            } // if

            fncShcartMsg(true);

		}

	});

} // function

//-----------
function fncShcartMsg(boolhide) {
    if (
        $('#shcartpop')
    ) {
        if ( boolhide ) {
            $('#shcartpop').html('Товар в корзине.');
            $('#shcartpop').fadeOut(3000);
        } // if
        else {

            $('#shcartpop').css("top",(Shcart_getClientHeight()-$('#shcartpop').height())/4+100 + "px");  
            $('#shcartpop').css("left",(Shcart_getClientWidth()-$('#shcartpop').width())/2 + "px");  

            $('#shcartpop').html('Минуточку...');

            $('#shcartpop').fadeIn(5);

        } // else
    } // if
} // function
//-----------

 function Shcart_getClientWidth()  
 {  
     return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;  
 }  
   
 function Shcart_getClientHeight()  
 {  
     return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;  
             }  
             
function hold_it(obj,text)
{
if(obj.value==text)
	{
  	obj.value='';
	}
else
	{
	if(obj.value=='')
		{
		obj.value=text;
		}
	}
}
