
String.prototype.endsWith=function(str)
{return(this.substr(this.length-str.length)==str);}
String.prototype.contains=function(str)
{return(this.indexOf(str)>=0);}
var MIN_COMPARE=1;var MAX_COMPARE=5;function doSubmit(form)
{var keys=new Array();var i;var url;if((form.compare.type=='checkbox'&&form.compare.checked)||form.compare.type=='hidden'){keys[0]="compare="+escape(form.compare.value);}else{if(form.compare.length==0)
return false;for(var i=0;i<form.compare.length;i++)
{if(form.compare[i].checked||form.compare[i].type=='hidden')
{keys[keys.length]="compare="+escape(form.compare[i].value);}}}
if(keys.length<MIN_COMPARE)
{url=new String(location.href);if(url.indexOf("?"))
url=url.substring(0,url.indexOf("?"));url+="?err=e19";window.location.href=url;return;}
if(keys.length>MAX_COMPARE)
{url=new String(location.href);if(url.indexOf("?"))
url=url.substring(0,url.indexOf("?"));url+="?err=e28";window.location.href=url;return;}
url=new String(form.action);if(!url.contains("?"))
url+="?";else
url+="&";url+=keys.join("&");url+="&returnUrl="+escape(window.location.href);window.location.href=url;return;}