function CartManager_frmSubmit(frm)
{	
	if(frm.CartManager_ItemNumber.length==null){													
		if(isInt(trim(frm.CartManager_ItemNumber.value),false))
		{
			frm.CartManager_action.value="update";
			return true;
		} else {
		  alert("введите круглые цифры");
		  frm.CartManager_ItemNumber.focus();
		  return false;
		}
	}else{
		var length = frm.CartManager_ItemNumber.length;   
  
  		for(i=0;i<length;i++)	
  		{    
			if(!isInt(trim(frm.CartManager_ItemNumber[i].value),false))
			{
				alert("введите круглые цифры");
				  frm.CartManager_ItemNumber[i].focus();
				  return false;  			
			} 
  		}
  
  		frm.CartManager_action.value="update";
		return true;   
	}
}

function CartManager_check(compId,compName,itemId,mode)
 {
   var date = new Date();
   strUrl = ""; 	
   if (compId!= null && compId.length > 0) 
	strUrl = strUrl + '?CompID=' + compId; 
   if (compName!= null && compName.length > 0) 
	strUrl = strUrl + '&CompName=' + compName; 
   if (itemId!= null && itemId.length > 0) 
	strUrl = strUrl + '&CartManager_ItemID=' + itemId; 
   if (mode!= null && mode.length > 0) 
	strUrl = strUrl + '&CartManager_action=' + mode; 
	strUrl = strUrl + "&time=" + date.getTime();
   eval("self.location='" + strUrl + "'");
}				
 	
function CartManager_putfavorite(page, id,self)
{
  var date = new Date();
	if(page.indexOf("?") > -1)							
		document.location = page + "&Favorite_action=add&Favorite_RequestPage="+self+"&Favorite_ProductID=" + id + "&time=" + date.getTime();				
	else
		document.location = page + "?Favorite_action=add&Favorite_RequestPage="+self+"&Favorite_ProductID=" + id + "&time=" + date.getTime();				
} 

function CartManager_link(page)
{
  var date = new Date();
	if(page.indexOf("?") > -1)							
		document.location = page + "&time="+date.getTime();				
	else
		document.location = page + "?time="+date.getTime();											
}			


function CartManager_openNewWindow(url, type, str)
{			
	newWindow = window.open(url, type, str);		
}
function CartManager_OutProductRegister(form)
{	
	//window.location="OutProductRegisterShow.html?CartManager_action=outproductregister";	
	form.submit();
	window.close();
}
