
function requestQueryString(q,myURLDecode)
{
  return targetQueryString(self,q,myURLDecode)
}
function targetQueryString(target,q,myURLDecode)
{ 
  if(target.location.href.search==null)return "";
  if(target.location.href.search=="")return "";
  var mg
  mg=target.location.search.substr(1)
  
  var qArray =mg.split("&")
  
  var keyArray=new Array()
  var valueArray=new Array()
  for(var i=0;i<qArray.length;i++)
  {
    var temArray=qArray[i].split("=")
    
    keyArray[keyArray.length]=temArray[0]
    valueArray[valueArray.length]=temArray[1]
  
  }
  
  for(var i=0;i<keyArray.length;i++)
  {
    if(keyArray[i]==q)
    { var Qvalue=valueArray[i]
      var rValue
      switch(myURLDecode)
      { case 1:
         rValue= URLDecode(Qvalue)
         break
        case 0:
         rValue= decodeURIComponent(Qvalue)
         break
        default:
         rValue= Qvalue
         break
      }
      return rValue
    }
  
  }
  
  return ""
}