// Copyright (C) Acquiro Systems Inc. 2012 - All Rights Reserved

function HashMap()
{this.m_map=new Object();}
HashMap.prototype.contains=function(key)
{return this.m_map[key]!=undefined;}
HashMap.prototype.put=function(key,value)
{this.m_map[key]=value;}
HashMap.prototype.get=function(key)
{var val=this.m_map[key];if(val==undefined)
{return null;}
return val;}
HashMap.prototype.size=function()
{return this.getKeys().length;}
HashMap.prototype.getKeys=function()
{var keys=new Array();for(var key in this.m_map)
{if(key==null||key.length==0||key==undefined)
{continue;}
if(!(key in Object.prototype))
{keys.push(key);}}
return keys;}
HashMap.prototype.isEmpty=function()
{for(var key in this.m_map)
{if(key==null||key.length==0||key==undefined)
{continue;}
return false}
return true;}
HashMap.prototype.remove=function(keyToRemove)
{var temp=this.m_map;this.m_map=new Object();for(var key in temp)
{if(key==null||key.length==0||key==undefined||key==keyToRemove)
{continue;}
if(!(key in Object.prototype))
{this.m_map[key]=temp[key];}}}
function MultiMap()
{this.m_map=new HashMap();}
MultiMap.prototype.put=function(key,value)
{var values=this.m_map.get(key);if(values==null)
{values=new Array();this.m_map.put(key,values);}
values.push(value);}
MultiMap.prototype.get=function(key)
{return this.m_map.get(key);}
MultiMap.prototype.remove=function(key)
{return this.m_map.remove(key);}
MultiMap.prototype.replaceAll=function(key,values)
{this.m_map.put(key,values);}
MultiMap.prototype.contains=function(key)
{return this.m_map.contains(key);}
MultiMap.prototype.getKeys=function()
{return this.m_map.getKeys();}
try
{if(window.STRING_RESOURCES==undefined)
{window.STRING_RESOURCES=new HashMap();}}
catch(e)
{}
var STRING_RESOURCES=window.STRING_RESOURCES;var RES_ID=1;function setResourceString(resourceId,value)
{STRING_RESOURCES.put(resourceId,value);}
function getResource(resourceId)
{var resId=resourceId;if(typeof resourceId=="string")
{try
{eval("resId = "+resourceId+";");}
catch(e)
{new CoreException("Error loading resource "+resourceId);}}
var res=STRING_RESOURCES.get(resId);res=completeSubResources(res);return res;}
function completeSubResources(resource)
{var index=resource.indexOf("[res:");while(index>-1)
{var index2=index+5;var index3=resource.indexOf("]",index2);if(index3==-1)
{break;}
var subResId=resource.substring(index2,index3);eval("var subRes = getResource( "+subResId+");");resource=resource.substring(0,index)+subRes+resource.substring(index3+1,resource.length);index=resource.indexOf("[res:");}
return resource;}
function getResource1(resourceId,param1)
{var msg=getResource(resourceId);msg=msg.replace(/\$1\$/g,param1);return msg;}
function getResource2(resourceId,param1,param2)
{var msg=getResource1(resourceId,param1);msg=msg.replace(/\$2\$/g,param2);return msg;}
