// JavaScript Document
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

var xmlHttp = ''
function GetXmlHttpObject()
{ 
	var objXMLHttp=null
		if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}
function getSelected(form){
selected = "";
	for (i=0; i < MM_findObj(form).length; i++)
	{ 
		element = MM_findObj(form)[i];
		if (element.id == 'chkFiles'){
			if (MM_findObj(form)[i].checked){
					selected = selected + MM_findObj(form)[i].value+"#";
			}
		}
	}	
return selected;
}

var blnResult;
function IsNumeric(strString){
   var strValidChars = "0123456789";
   var strChar;
   blnResult = true;
   if (parseInt(strString.length) == 0) return false;
   for (i=0; i<parseInt(strString.length) && blnResult == true; i++){
	  strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1){
         blnResult = false;
      }
    }
   return blnResult;
}
function myFormatTime(my_seconds, myFormat) {		
				
	// hoursminssecs : HH:MM:SS
	// minssecs : MM:SS
	// secs : SS
	
	var delimeter = ":";
	var newHours, newMinutes, newSeconds = "00";
	var myFormattedString = "";
	var nohours = 0;
	var myseconds = my_seconds;
	var nominutes= 0;
	
	// calculate
	nohours		= 	Math.floor(myseconds/3600); 
	myseconds	-=	(Math.floor(myseconds/3600))*3600; 
	nominutes	=	Math.floor(myseconds/60); 
	myseconds	-=	(Math.floor(myseconds/60))*60; 
	myseconds	=	(Math.round(myseconds));

	var newHours = "00";
	var newMinutes = "00";
	var newSeconds = "00";
	
	//alert("my_seconds IN : " + my_seconds + "   nohours "  + nohours  +" secs : " + myseconds  +" nomins : " + nominutes);
	
	// display
	if (nohours < 10) {(newHours = "0" + nohours)};
	if (nohours == 0) {(newHours = "00")};
	if (nominutes < 10) {newMinutes = String(nominutes)};
	if (nominutes > 9) {newMinutes = String(nominutes)};
	
	if (nominutes == 0) {(newMinutes = "0")};
	if (myseconds < 10) {(newSeconds = "0" + myseconds)};
	if (myseconds == 0) {(newSeconds = "00")};
	if (myseconds > 9) {(newSeconds = myseconds)};
	
	
	switch (myFormat) {
		case "hoursminssecs" :	myFormattedString = String(newHours + delimeter + newMinutes + delimeter + newSeconds);	
								break; 
		case "minssecs" : 		myFormattedString = String(newMinutes + delimeter + newSeconds);	
								break; 
		case "secs" : 			myFormattedString = String(newSeconds);	
								break; 
		default :				myFormattedString = String(newSeconds);	
								break; 
	}
	return myFormattedString;
}





























