function userWindow(website,ls_w,ls_h) {
   var heightspeed = 100; // vertical scrolling speed (higher = slower)
   var widthspeed = 17; // horizontal scrolling speed (higher = slower)
   var leftdist = 0; // distance to left edge of window
   var topdist = 100; // distance to top edge of window
   var winwidth = ls_w
   var winheight = ls_h
   var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=800,height=800,scrollbars=yes,status=yes");
   //for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
   //sizer.resizeTo("1", sizeheight);
   //}
   //for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
   //sizer.resizeTo(sizewidth, sizeheight);
   //}
   sizer.resizeTo(winwidth,winheight)
   sizer.location = website;
}
function smallWindow(website) {
   var heightspeed = 100; // vertical scrolling speed (higher = slower)
   var widthspeed = 57; // horizontal scrolling speed (higher = slower)
   var leftdist = 300; // distance to left edge of window
   var topdist = 100; // distance to top edge of window
   var winwidth = 600
   var winheight = 300
   var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=800,height=800,scrollbars=yes,status=yes");
   //for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
   //sizer.resizeTo("1", sizeheight);
   //}
   //for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
   //sizer.resizeTo(sizewidth, sizeheight);
   //}
   sizer.resizeTo(winwidth,winheight)
   sizer.location = website;
}
function middleWindow(website) {
   var heightspeed = 100; // vertical scrolling speed (higher = slower)
   var widthspeed = 7; // horizontal scrolling speed (higher = slower)
   var leftdist = 100; // distance to left edge of window
   var topdist = 100; // distance to top edge of window
   var winwidth = 760
   var winheight = 600
   var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=800,height=800,scrollbars=yes,status=yes");
   //for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
   //sizer.resizeTo("1", sizeheight);
   //}
   //for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
   //sizer.resizeTo(sizewidth, sizeheight);
   //}
   sizer.resizeTo(winwidth,winheight)
   sizer.location = website;
}
function expandingWindow(website) {
   var heightspeed = 2; // vertical scrolling speed (higher = slower)
   var widthspeed = 7; // horizontal scrolling speed (higher = slower)
   var leftdist = 0; // distance to left edge of window
   var topdist = 0; // distance to top edge of window
   var winwidth = window.screen.availWidth - leftdist;
   var winheight = window.screen.availHeight - topdist;
   var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=800,height=800,scrollbars=yes,status=yes");
   //for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
   //sizer.resizeTo("1", sizeheight);
   //}
   //for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
   //sizer.resizeTo(sizewidth, sizeheight);
   //}
   sizer.resizeTo(winwidth,winheight)
   sizer.location = website;
}

function ltrim(str)
{
    var i;
    for(i=0;i<str.length;i++)
    {
        if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break;
    }
    str=str.substring(i,str.length);
    return str;
}
function rtrim(str)
{
    var i;
    for(i=str.length-1;i>=0;i--)
    {
        if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break;
    }
    str=str.substring(0,i+1);
    return str;
}
function trim(str)
{
    return ltrim(rtrim(str));
}