// JavaScript Document

function fnAddToCart(message,good_key) {
   
    
  
if(incart[good_key]!=null)
  incart[good_key]=incart[good_key]+1;
else incart[good_key]=1;
	
 //alert(incart[good_key]);
  	//alert(document.getElementById('edit_group_name'+group_key).value);
  	JsHttpRequest.query(
  	'load_info_cart.php', // backend
  	{
  		// pass a text value
  		'action': 'add_to_cart',
  		'good_key': good_key,
  		'new_num':incart[good_key]
  		
  		
  	},
  	// Function is called when an answer arrives.
  	function(result, errors) {
  		if (errors && errors!=='') {
  			//document.getElementById('test').appendChild(document.createTextNode(errors));
  			//alert(errors);
  			document.getElementById('already_'+good_key).innerHTML='(уже '+incart[good_key]+' шт.)';
  		}
  		// Write errors to the debug div.
  		// document.getElementById("debug").innerHTML = errors;
  		// Write the answer.
  		if (result) {
  			if(result['res']==true)
  			{
  				jQuery.growl('Товар добавлен', message+' добавлен в корзину! Чтобы просмотреть корзину нажмите <a href="javascript:opennewwindow(\'cart.php\',800,700);">сюда</a>!','images2/info.png');
  				 	
  			}
  			
  			//alert(userExist);
  			//document.getElementById("subgroup_item"+subgroup_key).style.display="none";

  		}
  	},
  	false // do not disable caching
  	);
  }
  
 
  
  
jQuery(document).ready(function() {
 // $('.noticeTitle').val(title);



	jQuery.growl.settings.displayTimeout = 7200;
	jQuery.growl.settings.dockCss.width = '225px';
	jQuery.growl.settings.noticeTemplate = ''
	+ '<table width="225" border="0" cellpadding="0" cellspacing="0">'
	+ '	<tr>'
	+ '		<td style="background-image: url(images2/dm_top.png); width: 225px; height: 49px; background-repeat: no-repeat; color: #fff;">'
	+ '			<img src="%image%" style="max-width: 25px; max-height: 25px; text-align: center; margin-left: 19px; margin-top: 19px;" />'
	+ '			<h1 style="font-size: 18px; margin: 0pt; margin-left: 5px; margin-bottom: 10px; display: inline;">%title%</h1>'
	+ '		</td>'
	+ '	</tr>'
	+ '	<tr>'
	+ '		<td style="background-image: url(images2/dm_repeat.png); width: 225px; background-repeat: repeat-y; color: #fff;">'
	+ '			<p style="margin: 20px;">%message%</p>'
	+ '		</td>'
	+ '	</tr>'
	+ '	<tr>'
	+ '	<td style="background-image: url(images2/dm_bottom.png); background-repeat: no-repeat; width: 225px; height: 27px;" valign="top" align="right" >'
	+ '			<a style="margin-right: 25px; font-size: 10px; color: #fff; text-align: right;" href="" onclick="return false;" rel="close">Закрыть</a>'
	+ '		</td>'
	+ '	</tr>'
	'+ </table>';
  /*
    + '<div class="%priority%">'
    + '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
    + '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
    + '  <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
    + '  <h3 style="margin: 0pt; margin-left: 77px; padding: 0px; padding-bottom: 10px; font-size: 13px;">%title% (%priority%)</h3>'
    + '  <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
    + '</div>'
    + '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
    + '</div>';
  */
  //$.growl.settings.noticeElement($('.notice'));
	jQuery.growl.settings.noticeCss = {
    position: 'relative'
  };

  var msg = 'How are you doing?<br /><b>CSS Bugs with IE</b>: I am aware that the default template on this page has display issues with IE, however, I dislike IE with a passion, so ... please use Safari or Firefox to view this demo properly.  The plugin itself has full support for IE 6/7, the template used here does not.';
  var title = 'Hello World';
 

});


