﻿function getparastr(strname)
{
       var hrefstr,pos,parastr,para,tempstr;
       hrefstr = window.location.href;
       pos = hrefstr.indexOf("?")
       parastr = hrefstr.substring(pos+1);
       para = parastr.split("&");
       tempstr="";
       for(i=0;i<para.length;i++)
       {
            tempstr = para[i];
            pos = tempstr.indexOf("=");
            if(tempstr.substring(0,pos) == strname)
            {
               return tempstr.substring(pos+1);
            }
       }
       return null;
} 


function trim(str){   
return str.replace(/(^\s*)|(\s*$)/g, "");
}
function ltrim(str){   
return str.replace(/(^\s*)/g,"");
}
function rtrim(str){   
return str.replace(/(\s*$)/g,"");
}

function regInput(obj, reg, inputStr)			
{
	var docSel	= document.selection.createRange()
	if (docSel.parentElement().tagName != "INPUT")	return false
	oSel = docSel.duplicate()
	oSel.text = ""
	var srcRange	= obj.createTextRange()
	oSel.setEndPoint("StartToStart", srcRange)
	var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
	return reg.test(str)
}


