// JavaScript Core//*************************************// alg_core Namespace// alle hier definierten funktionen sind über alg_core.funktionsname ansprechbar//*************************************function algCoreNamespace() {	/*	Globale Eigenschaften in alg_core       */	this.finder_status = "closed";	this.aktuell_status = "closed";	this.entdecken_status = "closed";	this.dropdown_status = "";	this.toggleDropdownMenu = function(menu) {		if( alg_core.dropdown_status != "" )		{			blind_target = $(alg_core.dropdown_status);			blind_target.style.display='none';			alg_core.dropdown_status='';			if( alg_core.dropdown_status == menu ) {				menu='';			}		}		if( alg_core.dropdown_status != menu )		{			blind_target = $(menu);			blind_target.style.display='block';			/*new Effect.BlindDown(blind_target, {duration:0.25}); */			alg_core.dropdown_status=menu;		}	}	/* Funktion zum einfachen austauschen von Bildern über "src" */	this.changeImgSrc = function(element,newsrc) {		element = $(element);		element.src = newsrc;	}	/* fading von Elementen erreichen */	this.toggleBlindElement = function(element, mid) {		blind_target = $(element);		if (blind_target.style.display) {			new Effect.BlindDown(blind_target, {duration:0.25});			if (!isNaN(mid))				new Ajax.Request('/components/current/ajaxcontrols.php?get=save_box_state&boxid='+mid+'&state=1');			return 1;		} else {			new Effect.BlindUp(blind_target, {duration:0.25});			if (!isNaN(mid))				new Ajax.Request('/components/current/ajaxcontrols.php?get=save_box_state&boxid='+mid+'&state=0');			return 0;		}	}	this.toggleElement = function(element)	{	    if ($(element).style.display == 'block') {            $(element).style.display = 'none';	        return 0;	    } else {            $(element).style.display = 'block';            return 1;	    }	}	this.showElement = function(element){		$(element).style.display = 'block';        return 1;	}	this.toggleFinder = function() {		blind_target = $("finder_medium");		if (alg_core.finder_status == "closed") {			/*new Effect.BlindDown(blind_target, {duration:0.25});*/			blind_target.style.display = "block";			alg_core.finder_status = "open";		} else {			/*new Effect.BlindUp(blind_target, {duration:0.25});*/			blind_target.style.display = "none";			alg_core.finder_status = "closed";		}	}	this.toggleAktuell = function() {		blind_target = $("aktuell_leiste");		if (alg_core.aktuell_status == "closed") {			new Effect.BlindDown(blind_target, {duration:0.25});			alg_core.aktuell_status = "open";		} else {			new Effect.BlindUp(blind_target, {duration:0.25});			alg_core.aktuell_status = "closed";		}	}	this.toggleEntdecken = function(image_off, image_on) {		blind_target = $("entdecken_leiste");		if (alg_core.entdecken_status == "closed") {			new Effect.BlindDown(blind_target, {duration:0.25});			alg_core.entdecken_status = "open";			$('alg-entdecken-img').src='/images/'+image_on;		} else {			new Effect.BlindUp(blind_target, {duration:0.25});			alg_core.entdecken_status = "closed";			$('alg-entdecken-img').src='/images/'+image_off;		}	}	this.toggleEntdeckenImage = function(image) {		blind_target = $("entdecken_leiste");		$('alg-entdecken-img').src='/images/'+image;	}	this.changeBoxStatus = function(element) {		op_target = $(element);		if(op_target) {			if (op_target.style.display != "none") {				new Effect.BlindUp(op_target, {duration:0.25});			}		}	}}  // Ende des Namespace Objekts ----> Diese Klammer NICHT ENTFERNEN!!!!//*************************************// Ende des alg_core Namespace// Initialisieren des Namespace Objektsvar alg_core = new algCoreNamespace;function formfieldClearContent( formname, elementname, initialContent ){  if( document.forms[formname].elements[elementname].value == initialContent )  {    document.forms[formname].elements[elementname].value = '';  }}function insertInto( field, value, hidden, hiddenvalue ){  if( hidden != '' )  {    if( document.forms['regForm'].elements[hidden].value == '' )  	{      document.forms['regForm'].elements[hidden].value = hiddenvalue;  	}  	else  	{      document.forms['regForm'].elements[hidden].value += ', '+hiddenvalue;  	}  }  if( document.forms['regForm'].elements[field].value == '' )  {    document.forms['regForm'].elements[field].value = value;  }  else  {    document.forms['regForm'].elements[field].value += ', '+value;  }}function nl2br(notice) {    if(typeof(notice)=="string") new_notice(notice.replace(/(\r\n)|(\n\r)|\r|\n/g,"<BR>"));    else new_notice(notice);}function delete_notice(notice_id,count){    new Ajax.Request('/components/current/ajaxcontrols.php?get=delete_notice&id='+notice_id, {onSuccess: function(t){$('notices').innerHTML = t.responseText;}});    if ( count == 5 ) {        document.getElementById('show').style.display="none";    }else{        document.getElementById('show').style.display="block";        document.notice.foo.value="";    }}function new_notice(notice_text){    new Ajax.Request('/components/current/ajaxcontrols.php?get=new_notice&notice='+notice_text, {onSuccess: function(t){$('notices').innerHTML = t.responseText.evalScripts(); $('foobar').value = '';}});}function hide_notice(count){    if ( count == 5 ) {        document.getElementById('show').style.display="none";        new Ajax.Request('/components/current/ajaxcontrols.php?get=delete_notice', {onSuccess: function(t){$('notices').innerHTML = t.responseText;}});        document.notice.foo.value="";    }else{        new Ajax.Request('/components/current/ajaxcontrols.php?get=delete_notice', {onSuccess: function(t){$('notices').innerHTML = t.responseText;}});        document.notice.foo.value="";    }}function show_new_bookmark(){    if ( document.getElementById('new_bookmark').style.display == "block" ){        document.getElementById('new_bookmark').style.display="none";    }else document.getElementById('new_bookmark').style.display="block";}function edit_bookmark(external, folder){    f = folder;    edit = external.replace('http://','');    edit = edit.replace('www.','');    name = edit.substring(0,20);    if ( external.substring(0,7) != 'http://' ){        external = 'http://'+external;    }    if(folder == '' || folder == 'Ordner wählen oder eingeben' || folder == 'Allgemein'){	    add_custom_bookmark(external, name, 'Allgemein');	    document.getElementById('external_bookmark').value="";
	    folder = 'Allgemein';	}else{		add_custom_bookmark(external, name, folder);		$('external_bookmark').value="";	}
	new Ajax.Updater('linksBody', '/components/myalg/ajax.php?get=bookmarks&uid=&folder='+folder);}function linkInsert(id, value){	$(id).value = value;}function add_bookmark(external, name){    new Ajax.Request('/components/current/ajaxcontrols.php?get=new_bookmark&bookmark='+external+'&name='+name, {onSuccess: function(t){$('ext_bookmarks').innerHTML += t.responseText}});    $('add_link').style.display="none";	/* $('bookmarks').innerHTML +=  '<div id="'+ id +'"><a target="_blank" href="'+ external +'" class="aktuell">'+ name +'</a> <a href="javascript: void(0);" style="background-image:url(images/empty.png); background-position:right center; background-repeat:no-repeat; padding-right:19px;" onclick="new Ajax.Request(\'/components/current/ajaxcontrols.php?get=delete_bookmark&id='+ id +'\', {onSuccess: function(t){$(\''+ id +'\').style.display = none;}});"></a></div>'; */    /* $('bookmarkExternal').innerHTML = $('bookmarkExternal').innerHTML.replace('Keine Bookmarks vorhanden.',''); */}function add_custom_bookmark(external, name, cat){    new Ajax.Request('/components/current/ajaxcontrols.php?get=new_bookmark&bookmark='+external+'&name='+name+'&cat='+cat, {onSuccess: function(t){$(cat).innerHTML += t.responseText}});    $('add_link').style.display="none";}function new_internal_bookmark(url,title){    /*url = url.replace(/&/g,'%26');    uri = uri.replace(/&/g,'%26');*/    new Ajax.Request('/components/current/ajaxcontrols.php?get=new_internal_bookmark&bookmark='+url+'&name='+title, {onSuccess: function(t){$('bookmarks').innerHTML += t.responseText}});    /*document.getElementById('footer_bookmark').innerHTML="Bookmark gesetzt";    if ( $('nobookmarks').innerHTML != '' ){        $('nobookmarks').innerHTML = $('nobookmarks').innerHTML.replace('Keine Bookmarks vorhanden.','');    }*/}function img_show(start,userid,actid){  new Ajax.Request( '/components/img/ajaxcontrols.php',					{ method: 'post',					  postBody: 'action=getshort&start='+start+'&userid='+userid+'&actid='+actid,                      onSuccess: function(t)              					{              						$('image_array_short_content').innerHTML = t.responseText;              					}              	    } );}function change_place(fname, imgid, oldplace){  formname = "form_" + fname;  place_new = $(fname).value;  new Ajax.Request( '/components/current/ajaxcontrols.php?get=save_image_place',					{ method: 'post',					  postBody: 'newplace='+place_new+'&oldplace='+oldplace+'&imgid='+imgid,                      onSuccess: function(t)              					{              					  if(t.responseText == "0")              					  {              					  	$(fname).value = oldplace;              					  	alert("Der Ort ist in der Datenbank nicht vorhanden!");              					  }              					  else              					  {              					  	$(fname).value = t.responseText;              					  	alert("Ort wurde gespeichert!");              					  }              					}              	    } );}function PAYselectBrand( brand ){  document.ccform2.BRAND.value = brand;  new Effect.BlindUp( 'ccform' );  new Effect.Appear( 'cc2form' );  /*if( brand == 'VISA' )  {    $('expdate').innerHTML = '<p>CVC: <input type="text" name="CVC"></p>';    $('expdate').innerHTML = $('expdate').innerHTML + '\n<input type="hidden" value="Y" name="AUTH_3DS">';  }  else if( brand == 'MASTERCARD' )  {    $('expdate').innerHTML = $('expdate').innerHTML + '\n<input type="text" value="" name="CVC">';    $('expdate').innerHTML = $('expdate').innerHTML + '\n<input type="hidden" value="Y" name="AUTH_3DS">';  }  else  {*/    $('expdate').innerHTML = '<p>Wenn auf Ihrer Karte kein Ablaufdatum angeführt ist, wählen Sie bitte \'12\' als Ablaufdatum.</p>';  /* } */}function savemylocation( location ){  new Ajax.Request( '/components/current/ajaxcontrols.php?get=newlocation&location='+location,					{ method: 'get',					  onSuccess: function(t)              					{              					  $('newlocation').style.display = 'block';              					  $('newlocation').innerHTML = t.responseText;              					  $('newlocationmsg').style.display = 'none';              					}              		} );}function showNewLocation( location ){  //$('newlocationmsg').innerHTML = '<form name="mylocation"><input type="text" name="geotag" id="city" value=""><div class="auto_complete" id="city_auto_complete"></div><script type="text/javascript">new Ajax.Autocompleter(\'city\', \'city_auto_complete\', \'/components/blog/ajaxcontrols.php?cityAutoComplete\', {minChars:3, paramName: "city"})</script>&nbsp;<input type="button" value="Speichern" onClick="savemylocation( document.mylocation.geotag.value );"></form>';  $('newlocation').style.display = 'none';  new Effect.Appear( 'newlocationmsg', { duration: 0.2 } );}function insertTag( field, value ){  if( document.forms['media_upload'].elements[field].value == '' )  {    document.forms['media_upload'].elements[field].value = value;  }  else  {    document.forms['media_upload'].elements[field].value += ', '+value;  }}function add_upload_input(num){	str = num + ": <input type=\"file\" name=\"file_"+num+"\"  id=\"upload_file_" + num + "\" class=\"formfield wfull\"/> <br/><br/>\n";	$('spc_file_'+num).innerHTML = str;	if(num <5)	{		num++;		$('upload_form_input_add').innerHTML = '<a href="javascript:void(0)" onclick="add_upload_input(' + num + ')">Datei Hinzuf&uuml;gen</a>';	}	else		$('upload_form_input_add').innerHTML = '';}function check_media_upload(){	type=$('upload_type').value;    fehler=0;	if( $('upload_guarantee').checked == false)	{		alert(unescape("Bitte best%E4tigen Sie dass die Medien rechtm%E4%DFig hochgeladen werden d%FCrfen%21"));		fehler=1;	}	else if($('upload_file_1').value == "")	{		fehler=1;		alert(unescape("Bitte w%E4hlen Sie mindestens eine Datei aus!"));	}	if(type == "image")	{		/*		if ( ($('link_ressort') != null) )		{			//if (($('place') != null) && ($('place').value != ""))			//{				new Ajax.Request( '/components/media_upload/ajax.php?get=check_geotag',							{ method: 'post',							  postBody: 'geotag='+$('place').value,							  onSuccess: function(t)		              					{		              					  if(t.responseText == "0")		              					  {												alert(unescape("Der Geotag wurde in der Datenbank nicht gefunden%21"));												fehler=1;										  }		              					}		              		} );			//}		*/			if ( ($('link_ressort') != null) && ($('link_ressort').value != "") )			{				new Ajax.Request( '/components/media_upload/ajax.php?get=check_ressort',						{ method: 'post',						  postBody: 'ressort='+$('link_ressort').value,						  onSuccess: function(t)	              					{	              					  if(t.responseText == "0")	              					  {											alert(unescape("Das Ressort wurde in der Datenbank nicht gefunden%21"));											fehler = 1;									  }	              					}	              		} );			}	    //}	}	//alerttxt="Der upload deiner Medien wird durchgef%FChrt. Bei gro%DFen Bildern und vielen Benutzern kann dieser Vorgang eine Weile dauern. Bitte um etwas Geduld.<br/><br/>\n DU DARFST DIESES FENSTER W%C4HREND DES UPLOADS NICHT SCHLIESSEN!<br/><br/>Du kannst aber jederzeit ein neues Browserfenster %F6ffnen um Alpengluehen.com in der Zwischenzeit zu nutzen.<br/><center><img src=\"../../../../images/loading.gif\"/></center>";	if(fehler == "0")	{		//Bubble( " ", " ", 1, unescape(alerttxt), "Upload...", 300, 200 );		$('upload_progress_info').style.display='block';		$('media_upl').submit();	}}function change_upload_form(type){	ajaxGet("media_upload_form", "../../../../../components/media_upload/ajax.php?get=ajax_box&type="+type+"&id=media_upload_form&box=upload_form");	ajaxGet("media_upload_leftboxBody", "../../../../../components/media_upload/ajax.php?get=left_box&type="+type);	if(type == "image")	{		$('media_upload_linking').style.display='block';		ajaxGet("media_upload_linkingBody", "../../../../../components/media_upload/ajax.php?get=link_form&type="+type);	}	else	{		$('media_upload_linking').style.display='none';	}	//ajaxGet("media_upload_leftbox", "../../../../../components/media_upload/ajax.php?get=ajax_box&type="+type+"&id=media_upload_leftbox&box=upload_leftbox");	//ajaxGet("media_upload_linking", "../../../../../components/media_upload/ajax.php?get=ajax_box&type="+type+"&id=media_upload_linking&box=linking");}function change_slide(id,mtype,stype,sid,count,page){	new Ajax.Request( '/components/media/ajax.php?get=slide&id='+id+'&mtype='+mtype+'&stype='+stype+'&sid='+sid+'&count='+count+'&page='+page,					{ method: 'get',					  onSuccess: function(t)              					{              						$(id).innerHTML = t.responseText;              					}              		} );}function change_blog_slide(id,mtype,stype,sid,count,page){	new Ajax.Request( '/components/media/ajax.php?get=blog_slide&id='+id+'&mtype='+mtype+'&stype='+stype+'&sid='+sid+'&count='+count+'&page='+page,					{ method: 'get',					  onSuccess: function(t)              					{              						$(id).innerHTML = t.responseText;              					}              		} );}function media_add_comment(){  comment = document.mediaform_comment.entry.value;  id = document.mediaform_comment.imgid.value;  new Ajax.Request( '/components/media/ajax.php?get=newcomment',					{ method: 'post',					  postBody: 'id='+id+'&comment='+comment,                      onSuccess: function(t)              					{								  $('media_detail_commentary').innerHTML = t.responseText;              					}              	    } );}function media_remove_comment(cid){  new Ajax.Request( '/components/media/ajax.php?get=removecomment',					{ method: 'post',					  postBody: 'cid='+cid,                      onSuccess: function(t)              					{								  $('media_detail_commentary').innerHTML = t.responseText;              					}              	    } );}function media_add_favourite(id){	new Ajax.Request( '/components/media/ajax.php?get=addfavourite&id='+id,					{ method: 'get',                      onSuccess: function(t)              					{              					  Bubble( " ", " ", 1, t.responseText+"<br/><br/><input type='image' src='../../../images/pink/bn_ok.png' onclick='Windows.focusedWindow.close();'/></center>", "Favoriten", 200, 100 );              					}              	    } );}function media_delete(id){	refer="";	ids = new Array();	if(id.indexOf("_") == -1)		ids[0] = id;	else	{		ids = id.split("_");	}	media_bubble_loading();	for(i=0; i<ids.length; i++)	{		new Ajax.Request( '/components/media/ajax.php?get=media_delete&id='+ids[i],						{ method: 'get',						  evalScripts:'true',	                      onSuccess: function(t)	              					{	              						refer=t.responseText;	              						window.location.href=refer;									  	//$('mediaContentBody').innerHTML += t.responseText;	              					}	              	    } );	}}function delete_sponsor(id){	//media_bubble_loading();	new Ajax.Request( '/components/media/ajax.php?get=sponsor_delete&id='+id,			{ method: 'get',			  evalScripts:'true',              onSuccess: function(t)   					{   					if(t.responseText == "OK")   					{					  	$('sp_img_'+id).style.display='none';					  	$('sp_txt_'+id).style.display='none';					 }					 else					 {					 	infoBubble("Sponsor konnte nicht gel�scht werden!");					 }					  	//Windows.focusedWindow.close();        			}	         } );}function delete_portrait(pid){	new Ajax.Request( '/components/media/ajax.php?get=portrait_delete&id='+pid,					{ method: 'post',                      onSuccess: function(t)              					{								  	$('portrait_old').style.display="none";              					}              	    } );}function addSponsor(){	if ( $('sp_name').value != "" && $('sp_link').value != "" )		$('media_upl').submit();	else		infoBubble("Es muss ein Name und ein Link des Sponsors angegeben werden");}function media_organize_load(){	if($('media_select_layer').style.display == "none")	{		$('media_organize_load_select').style.backgroundImage="url(/images/media_organize_load_up.gif)";		new Ajax.Request( '/components/media/ajax.php?get=finder_organize',						{ method: 'get',						  evalScripts:'true',	                      onSuccess: function(t)	              			{	              				$('media_organize_load_select').style.borderBottom="none";								$('media_select_layer').innerHTML = t.responseText;	              				Effect.toggle('media_select_layer', 'blind', {duration:0.5});	              	    	}} );	}	else	{		Effect.toggle('media_select_layer', 'blind', {duration:0.5});		$('media_organize_load_select').style.backgroundImage="url(/images/media_organize_load_down.gif)";		$('media_organize_load_select').style.borderBottom="1px solid gray";	}}function media_edit_load(){	if($('media_edit_select_layer').style.display == "none")	{		$('media_edit_select').style.backgroundImage="url(/images/media_organize_load_up.gif)";		new Ajax.Request( '/components/media/ajax.php?get=finder_organize_edit',						{ method: 'get',						  evalScripts:'true',	                      onSuccess: function(t)	              			{	              				$('media_edit_select').style.borderBottom="none";								$('media_edit_select_layer').innerHTML = t.responseText;	              				Effect.toggle('media_edit_select_layer', 'blind', {duration:0.5});	              	    	}} );	}	else	{		Effect.toggle('media_edit_select_layer', 'blind', {duration:0.5});		$('media_edit_select').style.backgroundImage="url(/images/media_organize_load_down.gif)";		$('media_edit_select').style.borderBottom="1px solid gray";	}}function media_organize_add_all(idlist){	ids = new Array();	if(idlist.indexOf("_") == -1)		ids[0] = idlist;	else		ids = idlist.split("_");	for(i=0;i<ids.length;i++)	{		media_batch_add(ids[i]);	}}function media_rotate(id,degrees){	refer="";	ids = new Array();	if(id.indexOf("_") == -1)		ids[0] = id;	else		ids = id.split("_");	media_bubble_loading();	new Ajax.Request( '/components/media/ajax.php?get=media_rotate&id='+id+'&degrees='+degrees,						{ method: 'get',						  evalScripts:'true',	                      onSuccess: function(t)	              					{	              						if(t.responseText != "0")	              						{	              							if($('image_detail_layer') == null)	              							{			              						//media_organize_clear();			              						for(i=0; i<ids.length; i++)			              						{			              							$('imgthumb_'+ids[i]).firstChild.firstChild.firstChild.src=$('imgthumb_'+ids[i]).firstChild.firstChild.firstChild.src+"?"+t.responseText;			              							$('media_dropped_'+ids[i]).src=$('media_dropped_'+ids[i]).src+"?"+t.responseText;			              							//alert($('imgthumb_'+ids[i]).firstChild.src);			              						}			              					}			              					else			              					{			              						$('image_detail_layer').src = $('image_detail_layer').src + "?" + t.responseText;			              						$('slide_thumb_'+id).src = $('slide_thumb_'+id).src + "?" + t.responseText;			              					}		              						Windows.focusedWindow.close();		              					}	              					}	              	    } );/*	for(i=0; i<ids.length; i++)	{	}	window.location.href=refer;*/}function delete_album(aid){	new Ajax.Request( '/components/media/ajax.php?get=album_delete&aid='+aid,					{ method: 'get',                      onSuccess: function(t)              					{								  	$('album_'+aid).style.display="none";              					}              	    } );}function delete_slideshow(sid){	new Ajax.Request( '/components/media/ajax.php?get=slideshow_delete&sid='+sid,					{ method: 'get',                      onSuccess: function(t)              					{								  	$('slideshow_'+sid).style.display="none";              					}              	    } );}function add_slideshow_save(id,album,albumnew){		id = document.forms[0].imgid.value;		slink = document.forms[0].link_slideshow.value;		snew = document.forms[0].link_slideshow_new.value;		if($('slideshow_add_add'))			sreplace = $('slideshow_add_add').checked		else			sreplace=0;		//alert("ID: " + id + " - SLINK: " + slink + " - SNEW: " + snew);		new Ajax.Request( '../../../components/media/ajax.php?get=detail_add_slideshow&iid='+id+'&sid='+slink+'&snew='+snew+'&replace='+sreplace,					{ method: 'get',                      onSuccess: function(t)              					{								  	//alert(t.responseText);								  	Windows.focusedWindow.close();              					}              	    } );}function add_album_save(){		id = document.forms[0].imgid.value;		alink = document.forms[0].link_album.value;		anew = document.forms[0].link_album_new.value;		new Ajax.Request( '../../../components/media/ajax.php?get=detail_add_album&iid='+id+'&aid='+alink+'&anew='+anew+'&replace='+$('album_add_add').checked,					{ method: 'get',                      onSuccess: function(t)              					{								  	//alert(t.responseText);								  	Windows.focusedWindow.close();              					}              	    } );}function edit_save(){		eid = document.forms[0].edit_id.value;		etitle = document.forms[0].edit_title.value;		edesc = document.forms[0].edit_description.value;		etags = document.forms[0].edit_tags.value;		media_bubble_loading();		new Ajax.Request( '../../../components/media/ajax.php?get=edit_save',					{ method: 'post',					  postBody: 'iid='+eid+'&ititle='+etitle+'&idesc='+edesc+'&itags='+etags,                      onSuccess: function(t)              					{              						if(t.responseText == 0)              							alert("Bitte gib einen Titel an!");              						else if(t.responseText == 1)              							Windows.focusedWindow.close();              						media_organize_clear();              					}              	    } );}function permissions_save(){		var pervar = "";		if(document.forms[0].permissions[0].checked == true)			pervar=1;		else if(document.forms[0].permissions[1].checked == true)			pervar=0;		pid = document.forms[0].pid.value;		media_bubble_loading();		new Ajax.Request( '../../../components/media/ajax.php?get=permissions_save',					{ method: 'post',					  postBody: 'iid='+pid+'&permission='+pervar,                      onSuccess: function(t)              					{           							Windows.focusedWindow.close();              						media_organize_clear();              					}              	    } );}function media_lab(){	images = getDroppedMedia();	if( images == 0 )	InfoBubble( 'Bitte Bilder auswählen' );	else	new Ajax.Updater( 'media_list', '/components/media/ajax.php?get=media_lab', { method:'post', postBody:'ids='+images} );}function getDroppedMedia(){	if($('media_drop').childNodes.length == 0)		return 0;	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	return images;}function change_super_footer(id, f_txt){	//alert($('sb_footer_'+id+'_news_type').innerHTML);	//alert("id: " + id + "\nTxt.: " + f_txt);	//alert($('sb_footer_'+id+'_title').innerHTML);	var ftxt = f_txt.split("%%%%%");	//alert(ftxt[0] + "\n" + ftxt[1] + "\n" + ftxt[2] + "\n" + ftxt[3] + "\n" + ftxt[4] + "\n" + ftxt[5]);	if($('sb_footer_'+id+'_title'))	{		$('sb_footer_'+id+'_title').innerHTML = ftxt[0];		$('sb_footer_'+id+'_description').innerHTML = ftxt[1];		$('sb_footer_'+id+'_uimg').innerHTML = ftxt[2];		$('sb_footer_'+id+'_ulink').innerHTML = ftxt[3];	}	if($('sb_footer_'+id+'_news_type'))	{		$('sb_footer_'+id+'_news_type').innerHTML = ftxt[4];		$('sb_footer_'+id+'_news').innerHTML = ftxt[5];	}}function change_super_footer_old(id, type, resInfo, news){		if(news == "undefined")			news="";		new Ajax.Updater( type+'_media_super_footer' ,'/components/media/ajax.php?get=superfooter&id='+id+'&resInfo='+resInfo+'&news='+news					/*{ method: 'get',                      onSuccess: function(t)              					{									$(type+'_media_super_footer').innerHTML=t.responseText;              					}              	    } */);}function change_super_footer_arrow(id, type){	$(type+'_superFooterArrow').className="arrow"+id;}function change_slideshow(id,tid,play){	new Ajax.Request('/components/media/ajax.php?get=slideshow&type=newest&active='+id+'&play='+play,					{ evalScripts:'true',					  method: 'get',					  onSuccess: function(t)              					{									var back = t.responseText.split("%%%%%");									//alert(back[1]);									$('slideshow_small').innerHTML=back[0];									$('slideshow_desc').innerHTML=back[2];									$('slideshow_footer').innerHTML=back[3];									//Effect.Fade('slideshow_effect');									$('slideshow_img').innerHTML=back[1];									//Effect.Appear('slideshow_effect');              					}              	    } );}function change_slideshow_layer(id,tid,play){	new Ajax.Request('/components/media/ajax.php?get=slideshow_layer&type=slideshow&tid='+tid+'&active='+id+'&play='+play,					{ evalScripts:'true',					  method: 'get',					  onSuccess: function(t)              					{									var back = t.responseText.split("%%%%%");									//alert(back[1]);									$('slideshow_small').innerHTML=back[0];									$('slideshow_desc').innerHTML=back[2];									$('slideshow_footer').innerHTML=back[3];									//Effect.Fade('slideshow_effect');									$('slideshow_img').innerHTML=back[1];									//Effect.Appear('slideshow_effect');              					}              	    } );}function change_slideshow_ressort(id,tid,play){	new Ajax.Request('/components/media/ajax.php?get=slideshow&type=ressort&tid='+tid+'&active='+id+'&play='+play,					{ evalScripts:'true',					  method: 'get',					  onSuccess: function(t)              					{									var back = t.responseText.split("%%%%%");									//$('slideshow_small').innerHTML=back[0];									//$('slideshow_desc').innerHTML=back[2];									$('slideshow_footer').innerHTML=back[3];									//Effect.Fade('slideshow_effect');									$('slideshow_img').innerHTML=back[1];									//Effect.Appear('slideshow_effect');              					}              	    } );}function change_slideshow_play(id){	new Ajax.Request('/components/media/ajax.php?get=slideshow&type=newest&active='+id+'&play=3',					{ evalScripts:'true',					  method: 'get',					  onSuccess: function(t)              					{									var back = t.responseText.split("%%%%%");									//alert(back[1]);									$('slideshow_small').innerHTML=back[0];									$('slideshow_desc').innerHTML=back[2];									$('slideshow_footer').innerHTML=back[3];									//Effect.Fade('slideshow_effect');									$('slideshow_img').innerHTML=back[1];									//Effect.Appear('slideshow_effect');              					}              	    } );}function change_slideshow_pause(id){	new Ajax.Request('/components/media/ajax.php?get=slideshow&type=newest&active='+id+'&play=0',					{ evalScripts:'true',					  method: 'get',					  onSuccess: function(t)              					{									var back = t.responseText.split("%%%%%");									//alert(back[1]);									$('slideshow_small').innerHTML=back[0];									$('slideshow_desc').innerHTML=back[2];									$('slideshow_footer').innerHTML=back[3];									//Effect.Fade('slideshow_effect');									$('slideshow_img').innerHTML=back[1];									//Effect.Appear('slideshow_effect');              					}              	    } );}function sendImage(url){	PMSFadeOutBubbles(0,0);	PMSBubble( '/images/bn_absenden.gif', '/images/bn_abbrechen.gif', '0', '../../../../components/contactcenter/pms/ajax.php?get=PMSNewMsgWriterFormImage&box=inbox&pmssite=0&addImage='+url, 'Neue Nachricht','375','400');	//Bubble(' ',' ',0,'../../../../components/contactcenter/pms/ajax.php?get=PMSNewMsgWriterForm&box=inbox&pmssite=0','Neue Nachricht',375,400);	//var newtext=document.createTextNode(url);	//Bubble(' ',' ',1,' ','Neue Nachricht',375,400);	//new Ajax.Updater('alg_buttons_content', '../../../../components/contactcenter/pms/ajax.php?get=PMSNewMsgWriterForm&box=inbox&pmssite=0', {onComplete:function(){ $('PMSNewMsgContento').appendChild(newtext);}});/*	for(i=0;i<150;i++)		{		}*/	//Windows.focusedWindow.getElementsByName('PMSNewMsgContent')[0].appendChild(newtext);	//alert( 	document.getElementById('PMSNewMsgContento' ).value );	//document.getElementsByName('PMSNewMsgContent')[0].value=url;}function PMSBubble( okButton, cancelButton, contentType, content, title, width, height ){  if( contentType == 0 )    content = {url: content, options: {method: 'get', evalScripts: true}}  else    content = content;  if( arguments[7] != undefined )  var zid = arguments[7];  else  var zid = Math.round(Math.random()*10);  Dialog.confirm(  content,  {   className:"alg",   buttonClass:"alg_button",   id: "alg_buttons_"+zid,   width:width,   height:height,   okLabel: okButton,   cancelLabel: cancelButton,   recenterAuto: false,   title: "<span style=\"color:#E10B68; font-family:Tahoma,Arial,sans-serif; font-size:18px;\">" + title + "</span>",   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   destroyOnClose: true,   onOk:function(win){     ajaxurl = document.forms[0].actionURL.value;     formser = Form.serialize(document.forms[0]);     new Ajax.Request( ajaxurl, { method: 'post', postBody: formser, onComplete:     function(t) {     				switch( t.responseText )     				{     				  case 'false':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */    				    $('statusmsg').innerHTML = 'Übermittelte Daten sind ungültig';     				  break;     				  case 'rcpt':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */     				    $('statusmsg').innerHTML = 'Empfänger ist ungültig';     				  break;     				  case 'title':					    /* new Effect.Shake(Windows.focusedWindow.getId()); */     				    $('statusmsg').innerHTML = 'Kein Betreff angegeben';    				  break;    				  case 'nosender':					    /* new Effect.Shake(Windows.focusedWindow.getId()); */     				    $('statusmsg').innerHTML = 'Fehler beim Senden, nicht mehr eingeloggt!';    				  break;					  case 'cleartrashboxok':     					$('statusmsg').hide();     					ajaxGet('PMSBoxConstructBody', '/components/contactcenter/pms/ajax.php?get=PMSBoxConstruct&box=trashbox');     					Windows.focusedWindow.setDestroyOnClose();     					Windows.focusedWindow.close();					  break;					  case 'ok':     					/* new Effect.Shake(Windows.focusedWindow.getId()); */     					$('statusmsg').hide();     					Windows.focusedWindow.setDestroyOnClose();     					Windows.focusedWindow.close();     				  break;     				}					Windows.focusedWindow.updateHeight();     			  }     } );     /* Windows.focusedWindow.close(); */     return false;     }   }   );}/* *  Function used at Contactcenter * */function CCSBubble( okButton, cancelButton, contentType, content, title, width, height ){  if( contentType == 0 )    content = {url: content, options: {method: 'get'}}  else    content = content;  var zid = Math.round(Math.random()*10);  Dialog.confirm(  content,  {   className:"alg",   buttonClass:"alg_button",   id: "alg_buttons_"+zid,   width:width,   height:height,   okLabel: okButton,   cancelLabel: cancelButton,   recenterAuto: false,   title: "<span style=\"color:#E10B68; font-family:Tahoma,Arial,sans-serif; font-size:18px;\">" + title + "</span>",   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   destroyOnClose: true,   onOk:function(win){   	 ajaxurl = document.forms[0].actionURL.value;     formser = Form.serialize(document.forms[0]);     new Ajax.Request( ajaxurl, { method: 'post', postBody: formser, onComplete:     function(t) {			        var responseArray = new Array();     				if (t.responseText.search('#') != -1)     				{     					responseArray = t.responseText.split('#');     				}     				else     				{     					responseArray[0] = t.responseText;     				}     				switch( responseArray[0] )     				{     				  case 'error':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */    				    $('statusmsg').innerHTML = '<br /><div class="error">Fehler</div>';     				    break;     				  case 'user':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */     				  	$('statusmsg').innerHTML = responseArray[1];     				  	break;     				  case 'mail':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */     				  	$('statusmsg').innerHTML = '<br /><div class="error">Dieser User wurde bereits ins Alpengluehen-Netzwerk eingeladen</div>';     				  	break;     				  case 'mailFormat':   				        /* new Effect.Shake(Windows.focusedWindow.getId()); */     				  	$('statusmsg').innerHTML = '<br /><div class="error">Bitte \u00fcberpr\u00fcfen sie die Emailadresse</div>';     				  	break;					  case 'ok':					  case ' ok':					  	/* new Effect.Shake(Windows.focusedWindow.getId()); */     					$('statusmsg').hide();     					Windows.focusedWindow.setDestroyOnClose();     					Windows.focusedWindow.close();     					break;     				  case 'delAll':					  	/* new Effect.Shake(Windows.focusedWindow.getId()); */					  	//alert('delAll');     					$('statusmsg').hide();     					//Windows.focusedWindow.setDestroyOnClose();     					//Windows.focusedWindow.close();     					location.reload();     					break;					  default:					  	/* new Effect.Shake(Windows.focusedWindow.getId()); */     					$('statusmsg').hide();     					temp = t.responseText.split(",");						id1 = temp[0];						file1 = temp[1];						id2 = temp[2];						file2 = temp[3];						if (temp[4] && temp[4] != '')						{							//alert('temp4:'+temp[4]);							document.getElementById(temp[4]).parentNode.removeChild(document.getElementById(temp[4]));							document.getElementById(temp[4]+'-blog').parentNode.removeChild(document.getElementById(temp[4]+'-blog'));						}     					// alert(id1+' , '+file1+' , '+id2+' , '+file2); //DEBUG     					Windows.focusedWindow.setDestroyOnClose();     					Windows.focusedWindow.close();	     				reloadStyleBox(id1, file1);     					reloadStyleBox(id2, file2);     				  break;     				}					Windows.focusedWindow.updateHeight();     			  }     } );     /* Windows.focusedWindow.close(); */     return false;     }   }   );}/* *  Function used at Contactcenter * */function CCSInfoBubble( contentType, content, title, width, height ){  if( contentType == 0 )    content = {url: content, options: {method: 'get'}}  //var zid = Math.round(Math.random()*10);  Dialog.info(  content,  {   className:"alg",   width:width,   height:height,   title: "<span style=\"color:#E10B68; font-family:Tahoma,Arial,sans-serif; font-size:18px;\">" + title + "</span>",   recenterAuto: false,   showProgress: true,   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   destroyOnClose: true   }   );}function RatingBubble( okButton, cancelButton, contentType, content, title, width, height ){  if( contentType == 0 ) 	content = {url: content, options: {method: 'post', evalScripts: true}} /*new Ajax.Request( content,					{ method: 'post',					  evalScripts: true,					  onComplete: function(t){content=t.responseText}              		} );*/  else    content = content;  var zid = Math.round(Math.random()*10);  Dialog.confirm(  content,  {   className:"alg",   buttonClass:"alg_button",   id: "alg_buttons_"+zid,   width:width,   height:height,   okLabel: okButton,   cancelLabel: cancelButton,   recenterAuto: false,   title: "<span style=\"color:#E10B68; font-family:Tahoma,Arial,sans-serif; font-size:18px;\">" + title + "</span>",   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   destroyOnClose: true,   onOk:function(win){   	 ajaxurl = document.forms[0].actionURL.value;     formser = Form.serialize(document.forms[0]);     new Ajax.Request( ajaxurl, { method: 'post', postBody: formser, onComplete:     function(t) {	     			if(t.responseText == 'ok' || t.responseText == ' ok'){	     				Windows.focusedWindow.setDestroyOnClose();	     			  	Windows.focusedWindow.close();	     			}else{	     				new Effect.Shake(Windows.focusedWindow.getId());	    				$('statusmsg').innerHTML = 'Fehler';	     			}     			  }     } );     return false;     }   }   );}function WaitBubble( okButton, cancelButton, contentType, content, title, width, height ){  if( contentType == 0 )    content = {url: content, options: {method: 'post'}}  else    content = content;  var zid = Math.round(Math.random()*10);  ajaxurl = document.forms[0].actionURL.value;  formser = Form.serialize(document.forms[0]);  new Ajax.Request( ajaxurl, { method: 'post', postBody: formser, onComplete:     function(t) {	     			$('statusmsg').innerHTML = t.responseText;     			  }     } );  ajaxurl = ajaxurl+'?get=state';  pu = new Ajax.PeriodicalUpdater('alg_message', ajaxurl, {asynchronous:true, method: 'post', postBody: formser, frequency:2, Evalscripts: true, insertion:function(t){alert('foo');}  });  Dialog.confirm(  content,  {   className:"alg",   buttonClass:"alg_button",   id: "alg_buttons_"+zid,   width:width,   height:height,   okLabel: okButton,   cancelLabel: cancelButton,   recenterAuto: false,   title: "<span style=\"color:#E10B68; font-family:Tahoma,Arial,sans-serif; font-size:18px;\">" + title + "</span>",   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   destroyOnClose: true   }   );}

function cancelMembership()
{
    infoBubble('Bist du dir sicher, dass du deine Mitgliedschaft im Premiumclub beenden willst?<br /><br /><a href="javascript:void(0)" onClick="new Ajax.Request(\'/components/registration2/ajax.php?get=cancelMembership\', { onComplete: function(t) { window.location.reload(); } })" style="display:block;float:left">Ja, Mitgliedschaft <strong>sofort</strong> beenden.</a><a href="javascript:void(0)" class="bold right" onClick="Windows.focusedWindow.close();">Nein, abbrechen.</a>', 'Abo kündigen', '350,60');
}
function testpay(form){    formser = Form.serialize(form);    infoBubble('Der Bezahlvorgang wird momentan überprüft.<br /> Bitte um Geduld, dieser Vorgang kann 5-20 Sekunden dauern. <br/><br/>Vielen Dank dein A.L.G. Team', 'Bezahlvorgang');    new Ajax.Request( '/components/registration/pay_conf.php?status=pay', { method: 'post', evalScripts: true, postBody: formser, onComplete: tpconfirm});}

function tpconfirm(t){    Windows.focusedWindow.close();    if (t.responseText == 'ok') {    	$('cc2form').style.display = 'none';  	    $('succ').style.display = 'block';    } else if (t.responseText.indexOf('http') != -1) {  	    location.href = t.responseText;    } else {  	    $('err').innerHTML = t.responseText;    }  /*if( t.responseText.indexOf('rd') != -1 )  {    tlink = t.responseText.split('#');    location.href=tlink['1'];	alert(t.responseText);  }  else  {  // Error in div schreiben    $('err').innerHTML =t.responseText;    //alert(t.responseText);  }*/}function pay(){	infoBubble('Der Bezahlvorgang wird momentan Überprüft.<br /> Bitte um Geduld, dieser Vorgang kann 5-20 Sekunden dauern. <br/><br/>Vielen Dank dein A.L.G. Team', 'Bezahlvorgang');	ajaxurl = document.forms[0].actionURL.value;	formser = Form.serialize(document.forms[0]);	new Ajax.Request( ajaxurl, { method: 'post', postBody: formser,						onComplete:function(f){							if(f.responseText == ''){								ajaxurl = ajaxurl+'?get=state';							  	pu = new Ajax.PeriodicalUpdater('modal_dialog_message', ajaxurl, {							  			asynchronous:true,							  			method: 'post',							  			postBody: formser,							  			frequency:2,							  			Evalscripts: true,							  			insertion:							  			function(t){							  				if(t.responseText != 'false'){							  					$('payarea').style.display = 'none';							  					$('err').style.display = 'none';							  					pu.stop();							  					$('succ').style.display = 'block';							  					Windows.focusedWindow.close();							  				}							  			}							  	});							}if(f.responseText == 'true'){ //passt mail sent								$('payarea').style.display = 'none';			  					$('err').style.display = 'none';			  					$('succ').style.display = 'block';			  					Windows.focusedWindow.close();							} else if( f.responseText.indexOf('rd') != -1 ) {							    linkt = f.responseText.split('#');							    window.location=linkt['1'];							}else{							  	$('err').innerHTML = f.responseText;							  	Windows.focusedWindow.close();							}						}	});}function Bubble( okButton, cancelButton, contentType, content, title, width, height ){  if( contentType == 0 )    content = {url: content, options: {method: 'get'}}  else    content = content;	Dialog.confirm(  content,  {   className:"alg",   buttonClass:"alg_button",   id: "alg_buttons",   width:width,   height:height,   okLabel: okButton,   cancelLabel: cancelButton,   recenterAuto: false,   title: title,   overlayShowEffectOptions: { duration: 0.1 },   overlayShowHideOptions: { duration: 0.1 },   closeable: true,   onOk:function(win){     /*ajaxurl = document.forms[0].actionURL.value;     formser = Form.serialize(document.forms[0]);     new Ajax.Request( ajaxurl, { method: 'post', postBody: formser, onComplete: function(t) { Windows.focusedWindow.setHTMLContent( t.responseText ); } } );*/     Windows.focusedWindow.updateHeight();     new Effect.Shake(Windows.focusedWindow.getId());     /* Windows.focusedWindow.close(); */     return false;     }   }   );}function infoBubble( content, title ){  /*if( arguments[2] != undefined && arguments[2] == 0 )    var content = {url: content, options: {method: 'get', evalScripts: true } }  else  if( content.indexOf( "http:" ) != -1 )    var content = {url: content, options: {method: 'get', evalScripts: true } };*/  if( content.indexOf( "[img]" ) != -1 ) {  	content_split = content.split("[img]");    var content = '<img src="'+content_split['1']+'" />';  }  else 	var content = content;  if(  arguments[2] != undefined && arguments[2] != 0 )  {    var agrs = arguments[2].split(',');    var width = agrs['0'];    var height = agrs['1'];  }  else  {    var width = 250;    var height = 100;  }  Dialog.info(  content,  {    className:"alg",    width:width,    height:height,    title: title,    showProgress: true,    closeable: true  }   );}/* *  Function used at Profile * */function infoBubbleConfirm( content, title ){  /*if( arguments[2] != undefined && arguments[2] == 0 )    var content = {url: content, options: {method: 'get', evalScripts: true } }  else*/    var content = content;  if( content.indexOf( "[img]" ) != -1 )  {    content_split = content.split("[img]");    var content = '<img src="'+content_split['1']+'" />';  }  if(  arguments[2] != undefined && arguments[2] != 0 )  {    var agrs = arguments[2].split(',');    var width = agrs['0'];    var height = agrs['1'];  }  else  {    var width = 250;    var height = 100;  }  var zid = Math.round(Math.random()*10);  Dialog.info2(  content,  {    className:"alg",    buttonClass:"alg_button",    id: "alg_buttons_"+zid,    width:width,    height:height,    title: title,    okLabel: "/images/pink/bn_ok.png",    showProgress: true,    closeable: true  }   );}function infoBubble2( content, title ){  var content = {url: content, options: {method: 'get', evalScripts: true } }  /*if( content.indexOf( "[img]" ) != -1 )  {    content_split = content.split("[img]");    var content = '<img src="'+content_split['1']+'" />';  }*/  if(  arguments[2] != undefined && arguments[2] != 0 )  {    var agrs = arguments[2].split(',');    var width = agrs['0'];    var height = agrs['1'];  }  else  {    var width = 250;    var height = 100;  }  Dialog.info(  content,  {    className:"alg",    width:width,    height:height,    title: title,    showProgress: true,    closeable: true  }   );}function save_edit_form(type){	edits = document.getElementsByName('edit_form');	count=0;	fehler=0;	for(i=0; i<edits.length; i++)	{		new Ajax.Request( '/components/media_upload/ajax.php?get=save_media',					{ method: 'post',					  postBody: 'type='+type+'&id='+edits[i].e_id.value+'&title='+edits[i].e_title.value+'&description='+edits[i].e_description.value+'&tags='+edits[i].e_tags.value,					  onSuccess: function(t)              					{              					  count = count + 1;              					  if(t.responseText != "1")              						  	fehler=1;              					   if(count == edits.length)              					   {              					   		if(fehler == 0)              					   		{              					   		    url = document.URL;              					   		    /*pos = url.search(/\./);              					   		    test = url.substr(0, pos);*/              					   		    if (matches = url.match(/^(http:\/\/)mein\.([^\/]*)/))              					   		    {              					   		        staticUrl = "http://"+matches[2];              					   		        //alert('a2');              					   		        almdudler =  "<br/><br/><center><input type='image' src='/images/lowa/zum_wettbewerb.jpg' onclick='window.location.href=\""+staticUrl+"/Lowa\"'/></center>";              					   		        //alert('a3');              					   		        bHeight = 310;              					   		    }              					   		    else              					   		    {              					   		        almdudler = "";              					   		        bHeight = 100;              					   		    }											//alert(unescape("Alle %C4nderungen wurden erfolgreich gespeichert%21"));											Bubble( " ", " ", 1, unescape("<br/><span class=\"pink\">Alle %C4nderungen wurden erfolgreich gespeichert%21</span><br/><br/><center><input type='image' src='../../../images/almdudler/bn_weiter-zum-fotoarchiv.png' onclick='window.location.href=\"/Medien\"'/></center>"), "<span class=\"pink\"><b>Gespeichert...</b></span>", 280, bHeight );											//window.location.href="/Medien";										}										else											Bubble( " ", " ", 1, unescape("<br/><span class=\"pink\">Nicht alle %C4nderungen konnten gespeichert werden.\nBei jedem Bild ist zumindest ein Titel notwendig%21</span><br/><br/><center><a href='javascript:void(0)' onclick=\"Windows.close('alg_buttons', event)\"><img src='../../../images/pink/bn_ok.png' /></a></center>"), "<span class=\"pink\"><b>Gespeichert...</b></span>", 350, 100 );											//alert(unescape("Nicht alle %C4nderungen konnten gespeichert werden.\nBei jedem Bild ist zumindest ein Titel und eine Beschreibung notwendig%21"));              					   }              					}              		} );	}}function media_blog_add(id){	//ajaxGet("media_blog_list", "../../../../../components/media/ajax.php?get=media_blog_list&type=add&id="+id);	old_media = $('blog_media_input').value;	new Ajax.Request("/components/media/ajax.php?get=media_blog_list",					{ evalScripts:'true',					  method: 'post',					  postBody: "old="+old_media+"&new="+id,					  onSuccess: function(t)              					{              						var back = t.responseText.split("%%%%%");									$('blog_media_input').value=back[0];									if(back[1] != "")										$('media_blog_list').innerHTML = back[1];									//alert($('media_blog_list').innerHTML);									//alert(t.responseText + "\n\n" + back[0] + "\n\n" + back[1]);									//alert($('blog_media_input').value);S              					}              	    } );}function media_blog_remove(id){	//ajaxGet("media_blog_list", "../../../../../components/media/ajax.php?get=media_blog_list&type=add&id="+id);	old_media = $('blog_media_input').value;	new Ajax.Request("/components/media/ajax.php?get=media_blog_remove",					{ evalScripts:'true',					  method: 'post',					  postBody: "old="+old_media+"&id="+id,					  onSuccess: function(t)              					{              						var back = t.responseText.split("%%%%%");									$('blog_media_input').value=back[0];									$('media_blog_list').innerHTML = back[1];									//alert(t.responseText + "\n\n" + back[0] + "\n\n" + back[1]);									//alert($('blog_media_input').value);S              					}              	    } );}function addRessort(username, referrer, uid) {	var val = document.getElementById('currentcity').value;	var ni = document.getElementById('foobar');	var numi = document.getElementById('theValue');	var num = (document.getElementById('theValue').value -1)+ 2;	numi.value = num;	var newdiv = document.createElement('div');	var divIdName = 'my'+ num +'Div';	newdiv.setAttribute('id',divIdName);	if($('foobar').innerHTML.match(val) == null ){		new Ajax.Request("/components/myalg/ajax.php?get=setRessort",						{method: 'post',						 postBody: "name="+document.getElementById('currentcity').value,
                     	 onComplete: function() {
                     	     new Ajax.Updater('ressortsmBody', 'components/profile/ajax.php?get=mpRessorts&uid='+uid, { evalScripts: true });
                     	 }						});		var link = '<a href="javascript:void(0);" onClick="removeRessortElement(\''+ divIdName +'\');" class="right"><img src="images/pink/ico_minus.png" border="0" /></a>' +document.getElementById('currentcity').value;		newdiv.innerHTML= link;		ni.appendChild(newdiv);		var he = document.createElement('input');		he.setAttribute('type', 'hidden');		he.setAttribute('id', 'ressortids[]');		he.setAttribute('name', 'ressortids[]');		he.setAttribute('value', val);		document.getElementById(divIdName).appendChild(he);		document.getElementById('currentcity').value = '';
		infoBubble( 'du bist jetzt Mitglied in der '+ val +' Community. Du bist mit deinem Profil, deinem Blog und deinen Fotos direkt mit '+ val +' verknüpft und kannst auch mit allen anderen Community Mitgliedern aus '+ val +' Kontakt aufnehmen.<br /><br /><a href="'+ referrer +'/'+ val.replace(/ /g, '-') +'" style="float: left">Weiter zur '+ val +' Community</a> <a href="javascript:Windows.focusedWindow.close()" style="float: right">Zurück zu mein.Alpenglühen</a>', username+',', '400,100');	}}function removeRessortElement(divNum, uid) {		new Ajax.Request("/components/myalg/ajax.php?get=removeRessort",					{method: 'post',					 postBody: "name="+$(divNum).textContent,					 onSuccess: function(){$('foobar').removeChild( $(divNum) );},
					 onComplete: function() {
		                new Ajax.Updater('ressortsmBody', 'components/profile/ajax.php?get=mpRessorts&uid='+uid, { evalScripts: true });
				     }					});}function addInterest() {	new Ajax.Request("/components/myalg/ajax.php?get=setInterest", {
	    evalScripts: true,
	    method: 'post',
	    postBody: Form.serialize(document.frm_interests)
	    }
	);}function removeInterestElement(divNum) {		new Ajax.Request("/components/myalg/ajax.php?get=removeInterest",					{method: 'post',					 postBody: "name="+$(divNum).textContent,					 onSuccess: function(){$('l_interests').removeChild( $(divNum) );}					});}function addAdventure(username, referrer, uid) {	var val  = document.getElementById('adventure').value;	var ni   = document.getElementById('l_adventures');	var numi = document.getElementById('theValue');	var num  = (document.getElementById('theValue').value -1)+ 2;	numi.value = num;	var newdiv = document.createElement('div');	var divIdName = 'ad'+ num +'Div';	newdiv.setAttribute('id',divIdName);	if ($('l_adventures').innerHTML.match(val) == null ) {		new Ajax.Request("/components/myalg/ajax.php?get=setAdventure",						{method: 'post',						 postBody: "name="+document.getElementById('adventure').value,
						 onComplete: function() {
						     new Ajax.Updater('echannelsBody', 'components/profile/ajax.php?get=mpAdventures&uid='+uid, { evalScripts: true });
						 }						});		var link = 'onClick="removeAdventureElement(\''+ divIdName +'\');" class="right"><img src="images/pink/ico_minus.png" border="0" /></a>'+document.getElementById('adventure').value;		newdiv.innerHTML="<a " + link;		ni.appendChild(newdiv);		document.getElementById('adventure').value = '';
		infoBubble( 'du bist jetzt Mitglied in der '+ val +' Community. Du bist mit deinem Profil, deinem Blog und deinen Fotos direkt mit dem Erlebnischannel '+ val +' verknüpft und kannst auch mit allen anderen Community Mitgliedern des Channels '+ val +' Kontakt aufnehmen.<br /><br /><a href="'+ referrer +'/'+ val.replace(/ /g, '-') +'" style="float: left">Weiter zur '+ val +' Community</a> <a href="javascript:Windows.focusedWindow.close()" style="float: right">Zurück zu mein.Alpenglühen</a>', username+',', '400,100');	}}function removeAdventureElement(divNum, uid) {		new Ajax.Request("/components/myalg/ajax.php?get=removeAdventure",					{method: 'post',					 postBody: "name="+$(divNum).textContent,					 onSuccess: function() {
					     $('l_adventures').removeChild( $(divNum) );
					 },
					 onComplete: function() {
		                new Ajax.Updater('echannelsBody', 'components/profile/ajax.php?get=mpAdventures&uid='+uid, { evalScripts: true });
				     }					});}function setBarRating(field, value){//alert(parseInt($('tot').innerHTML) -$(field).value + value);	if(parseInt($('tot').innerHTML) -$(field).value + value <= 50){		$('tot').innerHTML = parseInt($('tot').innerHTML) -$(field).value + value;		$(field).value = value;		$('curr_'+field).style.width = value*8+"px";		$('starbar').style.width = parseInt($('tot').innerHTML)/60*5*17+"px";		$('all').value = parseInt($('tot').innerHTML)/60*5;	}}function setRating(field, value){	$(field).value = value;	$('curr_'+field).style.width = value*17+"px";}function setLoveRating(field, value){	$(field).value = value;	$(field+'starbar').style.width = value*15/60*4*20+"px";}function save_sugg( sugg ){  alert( sugg );}function media_delete_more(){	images="";	if($('media_drop').childNodes.length == 0)		return 0;	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_delete_popup&id='+images,'Löschen',350,70);}function media_rotate_more(){	if($('media_drop').childNodes.length == 0)		return 0;	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_rotate_popup&id='+images,'Drehen',350,100);}function media_edit_more(){	if($('media_drop').childNodes.length == 0)		return 0;	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	//alert(images);	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_edit_popup&id='+images,'Bearbeiten',450,170);}function media_permissions_more(){	if($('media_drop').childNodes.length == 0)		return 0;	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	//alert(images);	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_permissions_popup&id='+images,'Berechtigungen',300,160);}function media_batch_album_add(){	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	//alert(images);	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_add_album_popup&id='+images,'Zu Album hinzuf&uuml;gen',350,170);}function media_batch_slideshow_add(){	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	//alert(images);	Bubble(' ',' ',0,'../../../components/media/ajax.php?get=detail_add_slideshow_popup&id='+images,'Zu Slideshow hinzuf&uuml;gen',370,160);}function slideshow_show(stype,sid){	//Dialog.info({url: '../../../components/media/ajax.php?get=slideshow_popup&sid='+sid, options: {method: 'get',evalScripts:true}}, {className: "alphacube", width:580, height:640});	Dialog.info("", {className: "alphacube", width:740, height:700, top:2, recenterAuto:false});	new Ajax.Updater("modal_dialog_message", '../../../components/media/ajax.php?get=slideshow_popup&stype='+stype+'&sid='+sid, {evalScripts: true});}function show_slideshow_info(){	$('slideshow_info_button').style.display='none';	$('slideshow_info_info').style.display='block';}function getImage(id, size){	new Ajax.Request("/components/media/ajax.php?get=getImage&iid="+id+"&size="+size,					{					 onSuccess: function(t){return t.responseText;}					});}function media_load_album(aid){	new Ajax.Request("/components/media/ajax.php?get=getAlbumContent&aid="+aid,	{		evalScripts: 'true',		onSuccess: function(t)		{			response=t.responseText.split("_____");			$('media_drop').innerHTML = response[0];			response[1].evalScripts();			//$('media_drop_delete').innerHTML = "Zieh' die Bilder hier her, um sie automatisch aus dem Album zu entfernen";		}	});}function media_load_slideshow(sid){	new Ajax.Request("/components/media/ajax.php?get=getSlideshowContent&sid="+sid,	{		evalScripts: 'true',		onSuccess: function(t)		{			response=t.responseText.split("_____");			$('media_drop').innerHTML = response[0];			response[1].evalScripts();			//$('media_drop_delete').innerHTML = "Zieh' die Bilder hier her, um sie automatisch aus der Slideshow zu entfernen";		}	});}var counter=0;function media_batch_add(element){	if(!element.id)	{		addid=element;		imgcont=$('imgthumb_'+element);	}	else	{		addid=element.id;		imgcont=element;	}	//alert(imgcont.firstChild.firstChild.firstChild.src);	var jetzt = new Date();	if (!$('media_dropped_'+addid))				{					if(counter == 8)					{						$('media_drop').style.height = parseInt($('media_drop').style.height) +75 + "px";					}//					$('media_drop').innerHTML += '<img id="media_dropped_'+addid+'" class="imgdrag_2" onclick="media_batch_delete(media_dropped_'+addid+')" style="margin:2px;z-index:100;" src="' + imgcont.firstChild.firstChild.firstChild.src.replace(/size2/, "size1") + '" />';$('media_drop').innerHTML += '<img id="media_dropped_'+addid+'" class="imgdrag_1" onclick="media_batch_delete(media_dropped_'+addid+')" src="' + imgcont.firstChild.firstChild.firstChild.src.replace(/size2/, "size1") + '" />';					// VERSUCH mit addChild und createElement					// Problem ONCLICK-Handler???					/*					var img_add = document.createElement("img");					img_add.className = "imgdrag_2";					img_add.id = "media_dropped_"+addid;					img_add.style.margin ="2px"					img_add.style.zIndex = "100";					img_add.src=imgcont.firstChild.firstChild.firstChild.src.replace(/size2/, "size1");					$('media_drop').appendChild(img_add);					*/					// Source kommt aber, auch kann man ab und zu auf die leere Fl�che rechtsklicken und dann Bild Anzeigen machen					//$('wen_was').value = imgcont.firstChild.firstChild.firstChild.src.replace(/size2/, "size1");					// Wenn dieser Alert aktiviert ist, funktionierts im IE6???					//alert(img_add);					counter = counter + 1;				}}function media_batch_delete(element){	counter = counter - 1;	if(counter == 8)	{		//$('media_drop').innerHTML += '<br/>';		$('media_drop').style.height = parseInt($('media_drop').style.height) -75 + "px";	}	iid=element.id.split("_");	iid=iid[3];	//if($('media_drop_delete').innerHTML.indexOf("Album") > -1)	//	new Ajax.Request("/components/media/ajax.php?get=media_clear&col=album&id="+iid);	//else if($('media_drop_delete').innerHTML.indexOf("Slideshow") > -1)	//	new Ajax.Request("/components/media/ajax.php?get=media_clear&col=slideshow&id="+iid);	$(element.id).style.display='none';	for(i=0;i<$('media_drop').childNodes.length; i++)	        		{	        			//alert(i + ": " + $('media_drop').childNodes[i]);	        			if(element.id == $('media_drop').childNodes[i].id)	        			{							$('media_drop').removeChild($('media_drop').childNodes[i]);						}					}}function media_organize_clear(){	//alert("CLEAR");	//alert($('media_drop').innerHTML);	$('media_drop').innerHTML = "";}function media_bubble_loading(){	//new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_geotag_edit&id='+images, {evalScripts: true});	bheight=parseInt($('alg_buttons_content').style.height);	bmargin=bheight/2-25;	$('alg_buttons_content').innerHTML="<div style=\"text-align:center;margin-top:"+bmargin+"px'\"><img src='/images/loading.gif'/><br/>Bitte warten</div>";}function media_geotag_edit_more(){	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[3];		else			images += "_" + imgid[3];	}	//show_popup('/components/media/ajax.php?get=media_geotag_edit&id='+images,'600','600');	Bubble(' ',' ',1,' ','Geotag ändern',500,500);	new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_geotag_edit&id='+images, {evalScripts: true});	//Dialog.info("", {className: "alphacube", width:580, height:640});	//new Ajax.Updater("modal_dialog_message", '../../../components/media/ajax.php?get=slideshow_popup&stype='+stype+'&sid='+sid, {evalScripts: true});}function media_geotag_edit(iid){	Bubble(' ',' ',1,'','Bearbeiten',500,500);	new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_geotag_edit&id='+iid, {evalScripts: true});}function media_ressort_edit(){	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	Bubble(' ',' ',1,' ','Ressort ändern',300,150);	new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_ressort_edit&id='+images, {evalScripts: true});}function media_ressort_save_more(id){	resname=$('ressort').value;	respage=$('link_ressort_page').checked;	media_bubble_loading();	new Ajax.Request("/components/media/ajax.php?get=save_ressort",					{method: 'post',					 postBody: "id="+id+"&ressort="+resname+"&ressort_page="+respage,					 onSuccess: function(t)					 	{					 		if(t.responseText == "OK")					 			Windows.focusedWindow.close();					 		else					 			alert("Fehler beim Speichern des Ressorts, es können nur Ressorts aus der Datenbank gewählt werden!");						}					});}function media_micro_edit(){	images="";	for(i=0; i<$('media_drop').childNodes.length; i=i+1)	{		imgid=$('media_drop').childNodes[i].id.split("_");		if(imgid == "")			continue;		if(images == "")			images=imgid[2];		else			images += "_" + imgid[2];	}	Bubble(' ',' ',1,' ','Microchannel ändern',300,150);	new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_micro_edit&id='+images, {evalScripts: true});}function media_micro_save_more(id){	mvalue=$('link_micro').value;	mpage=$('link_micro_page').checked;	media_bubble_loading();	new Ajax.Request("/components/media/ajax.php?get=save_micro",					{method: 'post',					 postBody: "id="+id+"&micro="+mvalue+"&micro_page="+mpage,					 onSuccess: function(t)					 	{					 		if(t.responseText == "OK")					 			Windows.focusedWindow.close();					 		else					 			alert("Fehler beim Speichern!");						}					});}function show_cropper_popup(id){	//show_popup('/components/media/ajax.php?get=media_crop_popup&id='+id,400,700);	Bubble(' ',' ',1,' ','Bild zuschneiden',470,450);	new Ajax.Updater("alg_buttons_content", '/components/media/ajax.php?get=media_crop_popup&id='+id, {evalScripts: true});}function final_crop(){	id=$('crop_imgid').value;	x1=$('cropval_x1').value;	y1=$('cropval_y1').value;	x2=$('cropval_x2').value;	y2=$('cropval_y2').value;	//alert(x1+"/"+y1+" - "+x2+"/"+y2);	new Ajax.Request("/components/media/ajax.php?get=crop_image",					{method: 'post',					 postBody: "id="+id+"&x1="+x1+"&y1="+y1+"&x2="+x2+"&y2="+y2,					 onSuccess: function(t)					 	{					 		$('image_detail_layer').src=t.responseText;					 		Windows.focusedWindow.close();						}					});}function getCal(link){	new Ajax.Request(link,					{					 onSuccess: function(t){$('calendar').innerHTML = t.responseText;}					});}/*function pickDate(year, month, day){     tmp = new Date(year, month-1, day+1, 0,0,0);     time = tmp.getTime()/1000.0;    if( $('datet').value == '0'  )        $('datef').value = time;    if( time < $('datef').value ){        $('datef').value = time;    }    else{        $('datet').value = time;    }}*/function cleanAll(){    for(i=1; i<32; i++)        if( document.getElementById(i) )        document.getElementById(i).className = 'weekday';}function pickDate(year, month, day){var valid = true;     tmp = new Date(year, month-1, day+1, 0,0,0);     time = tmp.getTime()/1000.0;    day = document.getElementById(day);//trigger highlight    if(day.className == 'datepicker')        day.className = 'weekday';    else        day.className = 'datepicker';    //range    if($('datef').value != 0){                i = parseInt(day.id)-1;        while(valid && document.getElementById(i).className != 'datepicker'){            document.getElementById(i).className = 'datepicker';            i--;            if(! document.getElementById(i))            	valid = false;        }    }    if( time == $('datet').value ){        $('datet').value = 0;        $('datef').value = 0;                cleanAll();    }    if( time == $('datef').value ){        $('datef').value = 0;        $('datet').value = 0;        cleanAll();    }    if( time > $('datef').value  && time < $('datef').value){        $('datef').value = 0;        $('datet').value = 0;        cleanAll();    }    if( $('datet').value == '0'  && day.className=='datepicker' ){        //alert(day.className);        $('datef').value = time;    }    if( time < $('datef').value && day.className=='datepicker'){        $('datef').value = time;        cleanAll();    }else{        if( day.className=='datepicker')            $('datet').value = time;    }}function pickMediaDate(year, month, day){var valid = true;     tmp = new Date(year, month-1, day+1, 0,0,0);     time = tmp.getTime()/1000.0;	alert(year + " - " + month + " - " + day);	$targeturl="";	new Ajax.Request("/components/media/ajax.php?get=getDateUrl",					{method: 'post',					 postBody: 'date='+year+"-"+month+"-"+day,					 onSuccess: function(t)					 	{					 		alert(t.responseText);					 		//window.location.href=t.responseText;						}					});}/* Functions for GeoTagging *//* *  Function gets Coords for Ressort from #__geodata calls refLoc *  @param int type contains type of search ( 1 => img, 2 => blog ) */function getSugCords( value, text ){	new Ajax.Request( '/components/ressorts/ajax.php?get=getRessortsCords', { postBody: 'ressort='+value+'&text='+text, onComplete: refLoc } );}/* * Function gets Coords from Ressort and recenters google map and marker * @param string value contains lat,long */function refLoc( value ){	rett = value.responseText.toString();	rett = rett.split(',');	var lat = rett[0].substr( 0, rett[0].length );	var long = rett[1].substr( 0, rett[1].length - 1 );    var text = rett[2];	map.setCenter( new GLatLng( lat, long ), '12' );	marker.setPoint( new GLatLng( lat, long ) );	marker.openInfoWindowHtml( text );}/* * Function * @param string url contains url for Ajax.Request in form "''" * @param string text contains text for marker.openInfoWindowHtml */function getCords( url ){	if( url.indexOf('#') > 0 )	{	  urlt = url.split('#');	  $(urlt['0']).value=urlt['1']+','+urlt['2'];	}	else	{	  new Ajax.Request( url, { asynchronous: true, evalScripts: true });	}	marker.openInfoWindowHtml( 'Die Position wurde gespeichert.<br /><a href=\"javascript:void(0);\" onClick=\"marker.closeInfoWindow();Windows.close(\'alg_buttons\',event);\">close</a>');}