function mancss(object) {
try{
return man(object).style;
}catch(e){}
}
function manop(object, op) {


mancss(object).opacity = op;
mancss(object).filter = "alpha(opacity=" + (op * 100) + ")";



}


 function is_string(input){

    return typeof(input)=='string';
  }


function man(object) {
if (is_string(object)) {
return document.getElementById(object);
}else{
return object;
}
}
function hide(object) {
mancss(object).visibility = 'hidden';
}
function show(object) {
mancss(object).visibility = 'visible';
}

function gethttp(url, readyfunction) {
try {
if (window.XMLHttpRequest) {
request = new XMLHttpRequest(); 
} else if (window.ActiveXObject) {
try {
request = new ActiveXObject('Msxml2.XMLHTTP'); 
} catch (e) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP'); 
} catch (e) {}
}
}
if (!request) {
return false;
} else {
request.open('post', url, true);
request.send(null);
request.onreadystatechange = function() {
						try {
											if (request.status < 300) readyfunction(request.responseText); 
											else readyfunction("Es ist ein HTTP-Fehler aufgetreten");
											}catch(bla){}
										};
	}
} catch (bla) {}
}



var firstdata=0;
var loadinggif=""; 
var finishedstatus=false;

 function makestatus(msg) {

 infos = msg.split(",");
 
 prozent = Math.round((infos[0] / infos[1])*100);
 
 if ((prozent > 0) && (prozent < 101)) man("statusbar").style.width=( prozent) + "%";
 
 bla = ((Math.round((infos[2] / 1024) * 100))/100);
  blaa = ((Math.round((infos[1] / (1024 *1024) ) * 100))/100);
 
 if (!(isNaN(bla))) {
 man("statustext").innerHTML = bla + " kB/s (" + infos[3] + " sec)";
 man("statustextsize").innerHTML = blaa + " MB"; 
 
 newtitle = prozent + "% - " + daunlauttitle;
 
 if (document.title != newtitle)  document.title = newtitle;
 
 
  firstdata=1;
}
 if ((isNaN(bla)) && (firstdata==1)){
 
  man("statusbar").style.width="100%";
  newtitle= "100% - " + daunlauttitle;
 
  if (document.title != newtitle)  document.title = newtitle;
 
 
 if (( man("statustext").innerHTML != "Done.")) {
 man("statustext").innerHTML = "Resizing & Processing... ";
 
 if ((loadinggif == "eiskalt") &&  ( man("statustext").innerHTML.indexOf("<img") < 0)) {
  man("statustext").innerHTML =  man("statustext").innerHTML + "<img src='" + loadinggif + "' border=0>"; 
}

 }
 }
  
 }
 
 
 var ventil=0;
var ventilcount=0;

 function update_progress(id) {
 
 address="info.php?id=" + id;

 if (ventil == 0) {
 self.setTimeout("firstdata=1", 1500);
 gethttp(address, function(msg) {ventil=0;makestatus(msg);});
 ventil=1;
 ventilcount=0;
  self.setTimeout("update_progress('" + id + "')", 500);
 }else{
 ventilcount++;
 if(ventilcount > 6) {
 
 ventilcount=0;
 ventil=0;
 
 }
 self.setTimeout("update_progress('" + id + "')", 200);
}
 
 }
 
 
var draggerobjekt = null;
 function einstellerhoverinstart(el) {
 
 if (draggerobjekt == null) einstellerhoverin(el);
 }
 
  
 function einstellerhoveroutstart(el) {
 
 if (draggerobjekt == null) einstellerhoverout(el);
 }
 
 



var draggerx = 0;
var doo;
var posgerx = 0;
var offsetter;
var dragmax;
var dragmin;

function draggerinit() {

  document.onmousemove = dragger;
  document.onmouseup = draggerstop;


}

var content ="";

function showconfigs(contentt) {
mancss('configs').visibility='visible';
try {mancss('selecter').display='none';}catch(e){}
try {mancss('uploadedfile').display='none';}catch(e){}
content=contentt;


if ((content == "") || (content == undefined))  content="configs";

if (man(content).innerHTML == '') {
gethttp('configs.php', function(msg) {man(content).innerHTML = msg;});
}
return false;
}


function resetconfigs() {

gethttp('configs.php', function(msg) {man(content).innerHTML = msg;});

}

function draggerstart(max,min,element,doer) {

doo=doer;
 dragmax=max;
 dragmin=min;
  draggerobjekt = element;
  draggerx = posgerx - draggerobjekt.offsetLeft;
}


function draggerstop() {
if (draggerobjekt != null) {
einstellerhoverout(draggerobjekt) ;
  draggerobjekt=null;
}
}


function dragger(ereignis) {

  posgerx = document.all ? window.event.clientX : ereignis.pageX;
  
  gacker=(posgerx - draggerx);
  if (gacker < dragmin) gacker= dragmin;
   if (gacker > dragmax) gacker= dragmax;

  if((draggerobjekt != null)) {
    draggerobjekt.style.left = gacker + "px";
    doo(gacker);
	  try{event.preventDefault()}catch(err){}
return false;

  }

}

function getlayerx(e) {

if ((e.layerX == "") || (e.layerX == undefined)) {

return e.offsetX;

}

return e.layerX;

}



 

