function doQuickLink(form)
{
    var Protocol = self.location.protocol;
    var Host = self.location.host;
    var PathName = form.frm_item1[form.frm_item1.selectedIndex].value;
    var PathLength = PathName.length;
    
    // remove leading and trailing spaces
    PathName = rTrim(PathName);
    PathName = lTrim(PathName);
    
    if (!(form.frm_item1.options[0].selected))
        {      
        
        if(PathName.substring(0, 7) == "http://" || PathName.substring(0, 8) == "https://")
           window.open (PathName);           
        else 
           window.parent.location = Protocol + "//" + Host + PathName;
        }
}

// Removes trailing spaces
function rTrim(aString)
{
    var tmpString = aString;
    var strLength = tmpString.length;
    // this loop removes trailing spaces
    while(tmpString.charAt(strLength - 1) == ' ')
    {
      tmpString = tmpString.substring(0, tmpString.length -1);
      strLength = tmpString.length;
    }
    return tmpString;
}

// Removes leading spaces
function lTrim(aString)
{
    var tmpString = aString;
    var strLength = tmpString.length;
    // this loop removes leading spaces
    while(tmpString.charAt(0) == ' ')
    {
      // If indexB is greater than stringName.length, 
      // indexB is treated as if it were stringName.length.
      tmpString = tmpString.substring(1, tmpString.length);
      strLength = tmpString.length;
    }
    return tmpString;
}



//    alert("Protocol: " + Protocol + "\n" +
//    "Host: " + Host + "\n" +
//    "PathName: " + PathName + "\n" +
//    "PathLength: " + PathLength + "\n" +
//    "PathName2: " + PathName2 + "\n" +
//    "window.location: " + window.location + "\n" +
//    "window.parent.location: " + window.parent.location);
