// <![CDATA[
var XMLHTTP = null;
var divbox = null;
var loading = false;
var temp;
var changelocation;
var followfunction;
var followval1;

if(window.XMLHttpRequest)
{
	XMLHTTP = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
	try
	{
		var XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(ex)
	{
		try
		{
			var XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");	
		}
		catch(ex)
		{
		}
	}
}
// ]]>

function Ausgabe()
{	
	if(!loading)
	{
		loading = true;
		divbox.innerHTML = '';
		divbox.style.backgroundImage = 'url(images/loading.gif)';
	}
	
	if(XMLHTTP.readyState == 4)
	{
		loading = false;
		divbox.style.backgroundImage = '';
		divbox.innerHTML = XMLHTTP.responseText;
		if(changelocation)
		{
			self.location.href=changelocation;
			scrolltotop();
		}
	}
}

function SaveVar()
{	
	if(XMLHTTP.readyState == 4)
	{
		temp = XMLHTTP.responseText;
	}
}

function load_info (divid, article_id)
{
	divbox = document.getElementById(divid);
	
	
	
	XMLHTTP.open("POST", "/admin/shop/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=load_info&art_id="+article_id);
	
	//document.getElementById('list_switch').className = 'button_right';
}

function load_details (divid, article_id)
{
	divbox = document.getElementById(divid);

	XMLHTTP.open("POST", "/admin/shop/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=load_details&art_id="+article_id);
	
	//document.getElementById('list_switch').className = 'button_right';
}

function partner_create_new_user(create_user, neu_user_name, neu_user_r_name, neu_Anschrift, neu_PLZ, neu_Ort, neu_Land, neu_Telefon, neu_Telefax, neu_Mobil, neu_user_email, neu_user_pass1, neu_user_pass2)
{
	//alert(create_user+"\n"+neu_user_name+"\n"+neu_user_r_name);
	
	divbox = document.getElementById(create_user);
	divbox.style.display="block";
	document.getElementById('partner_user_rights_div').style.display="none";
	
	XMLHTTP.open("POST", "/admin/cmds/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=partner_create_new_user&neu_user_name="+neu_user_name+"&neu_user_r_name="+neu_user_r_name+"&neu_Anschrift="+neu_Anschrift+"&neu_PLZ="+neu_PLZ+"&neu_Ort="+neu_Ort+"&neu_Land="+neu_Land+"&neu_Telefon="+neu_Telefon+"&neu_Telefax="+neu_Telefax+"&neu_Mobil="+neu_Mobil+"&neu_user_email="+neu_user_email+"&neu_user_pass1="+neu_user_pass1+"&neu_user_pass2="+neu_user_pass2);
}

function partner_show_global_rights(create_user)
{
	divbox = document.getElementById(create_user);
	divbox.style.display="block";
	
	XMLHTTP.open("POST", "/admin/cmds/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=partner_show_global_rights");
}

function partner_show_global_user_rights(create_user)
{
	divbox = document.getElementById(create_user);
	divbox.style.display="block";
	
	XMLHTTP.open("POST", "/admin/cmds/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=partner_show_global_user_rights");
}

function partner_show_user_rights(create_user,id)
{
	divbox = document.getElementById(create_user);
	divbox.style.display="block";
	document.getElementById('partner_create_user_div').style.display="none";
	
	XMLHTTP.open("POST", "/admin/cmds/ajax.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send("action=partner_show_user_rights&id="+id);
}

function show_user_format(target, uid)
{
	divbox = document.getElementById('formate');
	divbox.style.display='block';
	
	XMLHTTP.open("POST", "ajax_upload.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send('action=get_formats&target='+target+'&uid='+uid);
}

function load_format_informations(id)
{
	divbox = document.getElementById('edit_div');
	divbox.style.display='block';
	
	XMLHTTP.open("POST", "ajax_upload_editbox.php");
	XMLHTTP.onreadystatechange = Ausgabe;
	XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHTTP.send('action=get_infos&id='+id);
}