function extra(url,id)
{
 fenster = window.open(url,id,"width=850,height=660,scrollbars=yes,resizable=yes");
 fenster.focus();
}
function extra2(url,id,width,height)
{
	width=parseInt(width);
	height=parseInt(height);
	width=width+30;
	if(width<550) width=550;
	height=height+95;
	if(height<300) height=300;
	if(typeof fenster != 'undefined')
	{
	  fenster.close();
	}
	width=width.toString();
	height=height.toString();
  fenster = window.open(url,id,"width="+width+",height="+height+",scrollbars=no,resizable=no,status=no");
 fenster.focus();
}

function popup(url,width,height)
{
	fenster = window.open(url,"popup","width="+width+",height="+height+",scrollbars=no,resizable=no,status=no");
 	fenster.focus();
}

function LetSub(cid,select,inf)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest('getGallery','cid='+cid,'l='+select.value,inf);
}

function Go(req,cid,uid,let,gal,t100,act,page,inf)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,cid,uid,let,gal,t100,act,page,inf);
}
function Go0(req)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req);
}
function Go1(req,p1)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1);
}
function Go2(req,p1,p2)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2);
}
function Go3(req,p1,p2,p3)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3);
}
function Go4(req,p1,p2,p3,p4)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4);
}
function Go5(req,p1,p2,p3,p4,p5)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5);
}
function Go6(req,p1,p2,p3,p4,p5,p6)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5,p6);
}
function Go7(req,p1,p2,p3,p4,p5,p6,p7)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5,p6,p7);
}
function Go8(req,p1,p2,p3,p4,p5,p6,p7,p8)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5,p6,p7,p8);
}
function Go9(req,p1,p2,p3,p4,p5,p6,p7,p8,p9)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5,p6,p7,p8,p9);
}
function Go10(req,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10)
{
	document.body.style.cursor='wait';
	ajaxEngine.sendRequest(req,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
}

function ArrowChanger()
{
  this.ajaxUpdate = function(ajaxResponse) {
			document.body.style.cursor='default';
			window.scrollTo(0,0);
  }
}

var tmpDiv = "";
var linkArr = new Array();
var done_name = 0;
var done_pass = 0;

function clear_name(item)
{
	if(done_name == 0)	
	{
		item.value = '';
		done_name = 1;
	}
}
function clear_pass(item)
{
	if(done_pass == 0)	
	{
		item.value = '';
		done_pass = 1;
	}
}


function nix()
{
}

function makeEditable()
{
	ajaxEngine.registerRequest('setOrder','modules/pics.php?ajax&setorder');
	Position.includeScrollOffsets = true;
	Sortable.create("Gallery",{tag:'a',constraint:false,overlap:'horizontal'});
	
	var Anzahl = document.getElementById("Gallery").childNodes.length;

	for (var i = 0; i < Anzahl; i++)
	{
		var key = document.getElementById("Gallery").childNodes[i].id;
		linkArr[i] = new Array();
		linkArr[i]["key"] = key;
		linkArr[i]["val"] = document.getElementById("Gallery").childNodes[i].href;
		document.getElementById("Gallery").childNodes[i].href="JavaScript:nix()";
	}
}

function finishEditing(gal)
{
	var Anzahl = linkArr.length;
	for (i=0;i<Anzahl;i++)
	{
		var key = linkArr[i]["key"];
		var val = linkArr[i]["val"];
		document.getElementById(key).href=val;
	}
	
//	document.getElementById("SubNavigationDiv").innerHTML=tmpDiv;
	ajaxEngine.sendRequest('setOrder',Sortable.serialize("Gallery"));
	Sortable.destroy("Gallery");

	Go1('getGallery',gal);
}
function Check()
{
	var x = window.confirm("Wirklich?");
 	return x;
}