function Order(i,img)
{
	var strOrderList,nOrderCount
	var nUserID,strUserName,nposi

	nUserID=getcookie('logID')

	nposi=nUserID.indexOf('&')
	nUserID=nUserID.substring(0,nposi)

	//alert(nUserID+'werwer you login properly, you have no rights to access the page.');
	strOrderList=getcookie('OrderList')
	nOrderCount=getcookie('OrderCount')
	if(strOrderList!='')
	{	//alert('USERID='+nUserID+'\n\nCookie='+strOrderList)
		if(strOrderList.indexOf('!'+nUserID+'@@')<0)
		{	strOrderList=''
			nOrderCount=0
		}
	}
	if(strOrderList=='')
	{
		strOrderList=strOrderList+'!'+nUserID+'@@'+'|'
	}

if (img.src.indexOf('img/barWantoff.gif')>0)
{
	if(nOrderCount==''  || nOrderCount=='undefined'){ nOrderCount=0 }
	if(nOrderCount>=400)
	{
		alert('You have chose 400 products for quotation.\n\nBefore continuing choice, please quote them first.')
		return
	}
	if(strOrderList.indexOf('|'+i+'|') == -1)
	{
		strOrderList=strOrderList+i+'|'
		nOrderCount =nOrderCount*1 + 1
	}
	setcookie('OrderList',strOrderList,'')
	setcookie('OrderCount',nOrderCount,'')
	MM_swapImage('mO'+i,'','img/barWanton.gif',1)
}
else
	if (img.src.indexOf('img/barWanton.gif')>0)
	{
		if(strOrderList.indexOf('|'+i+'|') > 0)
		{
			strOrderList=strOrderList.replace('|'+i+'|','|')
			nOrderCount =nOrderCount*1 - 1
			setcookie('OrderList',strOrderList,'')
			setcookie('OrderCount',nOrderCount,'')
			MM_swapImage('mO'+i,'','img/barWantoff.gif',1)
		}
	}
}

function setcookie(name,value,domain)
{
var argv=setcookie.arguments;
var argc=setcookie.arguments.length;

var today = new Date();
var expiration = new Date(today.getTime() + 6 * 60 * 60 * 1000);  // 6 hours from now
document.cookie=name+"="+escape(value)+";expires="+expiration.toGMTString()+";path=/";
}

function getcookie(Name) {
   var 	WholeCookie=document.cookie;
   var index = WholeCookie.indexOf(Name + "=");
   if (index == -1) return "";
   index=WholeCookie.indexOf("=", index)+1;
   var endstr = WholeCookie.indexOf(";", index);
   if (endstr == -1) endstr = WholeCookie.length;
   var IndividualCookie = unescape(WholeCookie.substring(index, endstr));
   if (IndividualCookie == null || IndividualCookie == "null" ||
       IndividualCookie == "" || IndividualCookie.indexOf("undefined") >= 0 ||
       IndividualCookie.lastIndexOf("=") == IndividualCookie.length - 1) {
      IndividualCookie = ""
   }
   return IndividualCookie
}

function deletecookie(name)
{
	var exp= new Date();
	exp.setTime(exp.getTime()-1);
	var cval=getcookie(name);
	if (cval!=null)
	document.cookie=name+"="+cval+";expires="+exp.toGMTString();
}


