function Start(str,getparams)
{ 
    words = new String("limit;lines;finish;complete;In;Out")
    var swords = words.split(";")
    var params = new String(getparams);
	arrparam=params.split("-");
	for (var i in arrparam) {
		if((i % 2) == true) {
		      j= i-1;
			j=j;
	/*window.alert(arrparam[j] + " " + arrparam[i]);*/
    GetData(this.value,arrparam[j],arrparam[i]);
	/*window.alert(arrparam[j] + " " + arrparam[i]);*/
			j=j;
		}
	}
}

function GetData(str,getfile,strtarget)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=getfile
xmlHttp.onreadystatechange=function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(strtarget).innerHTML=xmlHttp.responseText
 } 
}
//alert(url)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}






function stateChanged(str) 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(str).innerHTML=xmlHttp.responseText
 } 
}






function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}



function MoveOption(objSourceElement, objTargetElement)
    {
        var aryTempSourceOptions = new Array();
        var x = 0;
        
        //looping through source element to find selected options
        for (var i = 0; i < objSourceElement.length; i++) {
            if (objSourceElement.options[i].selected) {
                //need to move this option to target element
                var intTargetLen = objTargetElement.length++;
                objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
                objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
            }
            else {
                //storing options that stay to recreate select element
                var objTempValues = new Object();
                objTempValues.text = objSourceElement.options[i].text;
                objTempValues.value = objSourceElement.options[i].value;
                aryTempSourceOptions[x] = objTempValues;
                x++;
            }
        }
        
        //resetting length of source
        objSourceElement.length = aryTempSourceOptions.length;
        //looping through temp array to recreate source select element
        for (var i = 0; i < aryTempSourceOptions.length; i++) {
            objSourceElement.options[i].text = aryTempSourceOptions[i].text;
            objSourceElement.options[i].value = aryTempSourceOptions[i].value;
            objSourceElement.options[i].selected = false;
        }
    }

function base64enc(inp,m)
{

 if (inp=="") return("");

 var b64ch=(m==1)?b64str:b64str_m;

 for (i=0;i<inp.length;i++)
 {
   //if (inp.charCodeAt(i)>255) alert("i:"+i+" code:"+inp.charCodeAt(i)+" ch:"+inp.charAt(i));
   if (inp.charCodeAt(i)>255) alert("i:"+i+" code:"+inp.charCodeAt(i)+" code:"+inp.charCodeAt(i+1));
   //alert(inp.charCodeAt(i)+inp.charAt(i));
 }

 if (typeof(btoa)=="function")
  {
    alap=btoa(inp);
    if (m!=1)
    {
     alap=alap.replace(/\x2B/g,"-");
     alap=alap.replace(/\x2F/g,"_");
    }
    return alap;
  }

    var out = ""; //This is the output
    var chr1, chr2, chr3 = ""; //These are the 3 bytes to be encoded
    var enc1, enc2, enc3, enc4 = ""; //These are the 4 encoded bytes
    var i = 0; //Position counter

    do
    { //Set up the loop here
        chr1 = inp.charCodeAt(i++); //Grab the first byte
        chr2 = inp.charCodeAt(i++); //Grab the second byte
        chr3 = inp.charCodeAt(i++); //Grab the third byte

        //Here is the actual base64 encode part.
        //There really is only one way to do it.
        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;

        if (isNaN(chr2))
        {
          enc3 = enc4 = 64;
        }
         else if (isNaN(chr3))
         {
            enc4 = 64;
         }

        //Lets spit out the 4 encoded bytes
        out = out + b64ch.charAt(enc1) + b64ch.charAt(enc2) + b64ch.charAt(enc3) + b64ch.charAt(enc4);

        // OK, now clean out the variables used.
        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";

    } while (i < inp.length); //And finish off the loop

    //Now return the encoded values.
    return out;
}

function popUp(URL,width,height) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left = 420,top = 225');");
}
