function popup(picUrlString, windowWidth, windowHeight)
{
  // create a feature string for the popup
  var x=(screen.width-windowWidth)/2
  var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=no,menubar=no"
  featureString += ',left='+x + ',top='+y
  featureString += ',width='+(windowWidth*1+20)+',height='+ (windowHeight*1+20)
//  if (popupWin)
//  	popupWin.close();
  popupWin = window.open(picUrlString, "Product_Image_Popup", featureString);
  if(window.focus)
  	popupWin.focus();
}

function popupMap(picUrlString, windowWidth, windowHeight)
{
  // create a feature string for the popup
  var x=(screen.width-windowWidth)/2
  var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=no,menubar=no"
  featureString += ",left="+x + ",top="+y
  featureString += ",width=" + (windowWidth*1+20) + ",height=" + (windowHeight*1+20)
  //  if (popupWinMap)
//  	popupWinMap.close()
  var popupWinMap = window.open(picUrlString, "Map_Image_Popup", featureString);
  if(window.focus)
  	popupWinMap.focus();
}

function LTrim(str)
{
  var strg,vlen;
  strg=str;
  if (strg==null)
	strg = "";
  else{
  	vlen=strg.length;
	while((vlen>0)&&((strg.charAt(0)==String.fromCharCode(12288))||(strg.charAt(0)==String.fromCharCode(32))))
	{
		strg=strg.substr(1);
		vlen=strg.length;
	}
  }
  return(strg);
}

function RTrim(str)
{
  var strg,vlen;
  strg=str;
  if (strg ==null)
	strg = "";
  else{
	vlen=strg.length;
	while((vlen>0)&&((strg.charAt(vlen-1)==String.fromCharCode(12288))||(strg.charAt(vlen-1)==String.fromCharCode(32))))
	{
		strg=strg.substr(0,vlen-1);
		vlen=strg.length;
	}
  }
  return(strg);
}

function Trim(str){
	var strAllTrim = LTrim(str);
	strAllTrim = RTrim(strAllTrim);
	return strAllTrim;
}