(function() 
{
	CorpsA = {
		
		url: "",
		user_id: ""
	}
})();


function validate(url, id)
{
	new Ajax.Request(url, {
		parameters: "id=" + id+
					"&value="+$(id).value
					+"&flag=1"
					+"&choose=0"
					+"&reviewAdd=0"
					+"&isRated=0"
					+"&rate=0",
		onSuccess: function(resp) { 
		 var idErr="err"+id;
		 var idTabel=id+"Td";
		 if($(idErr)==null)
		 {
		 if($(idTabel).lastChild.nodeType!=1)
			$(idTabel).lastChild.previousSibling.firstChild.nodeValue="";
		 new Insertion.After(id, '<span id='+idErr+' style="color:red">  '+resp.responseText+'</span>');
		 }
		 else
		 {
			Element.replace(idErr, '<span id='+idErr+' style="color:red">  '+resp.responseText+'</span>');
		 }
		 } 
		 
	});
} 

function getPaginatedInboxMails(baseUrl, url, pageId, maxRes)
{ 
	new Ajax.Request(url , { 
	parameters:
		"baseUrl="+baseUrl+ "&url="+url+ "&pageId="+pageId+ "&maxRes="+maxRes,
	 onSuccess:function(resp)
	 { 
		var text =resp.responseText; 
		var responses = text.split('###'); 
		$('scroll-show').innerHTML = responses[0]; 
		$('messagePage').innerHTML = responses[1];
		$('messagePage1').innerHTML = responses[1];
	 }
	});
}
function getPaginatedDraftMails(baseUrl, url, pageId, maxRes)
{
	new Ajax.Request(url , { 
	parameters:
		"baseUrl="+baseUrl+ "&url="+url+ "&pageId="+pageId+ "&maxRes="+maxRes,
	onSuccess:function(resp)
	{ 
		var text =resp.responseText; 
		var responses = text.split('###'); 
		$('scroll-show').innerHTML = responses[0]; 
		$('messagePage').innerHTML = responses[1];
		$('messagePage1').innerHTML = responses[1];
	}
	});
}
function getPaginatedTrashMails(baseUrl, url, pageId, maxRes)
{
	new Ajax.Request(url , { 
	parameters:
		"baseUrl="+baseUrl+ "&url="+url+ "&pageId="+pageId+ "&maxRes="+maxRes, onSuccess:function(resp)
	{ 
		var text =resp.responseText; 
		var responses = text.split('###'); 
		$('scroll-show').innerHTML = responses[0]; 
		$('messagePage').innerHTML = responses[1];
		$('messagePage1').innerHTML = responses[1];
		}
	});
}
function getPaginatedSentMails(baseUrl, url, pageId, maxRes)
{ 
	new Ajax.Request(url , { 
	parameters:
		"baseUrl="+baseUrl+ "&url="+url+ "&pageId="+pageId+ "&maxRes="+maxRes, onSuccess:function(resp)
	{ 
		var text =resp.responseText; 
		var responses = text.split('###'); 
		$('scroll-show').innerHTML = responses[0]; 
		$('messagePage').innerHTML = responses[1];
		$('messagePage1').innerHTML = responses[1];}
	});
}

function rating(url, id, listingId)
{
	var node = document.getElementsByName(id)[0];
	new Ajax.Request(url, {
		parameters: "value=" + node.firstChild.nodeValue+
					+"&listingId=" + listingId
					+"&flag=0"
					+"&choose=0"
					+"&reviewAdd=0"
					+"&isRated=1"
					+"&rate=1",
		onSuccess: function(resp) {
		 var length=node.firstChild.nodeValue;
		 for(i=1; i<=length; i++)
		 {
		  document.getElementsByName("star"+i)[0].setAttribute("class", "post-star-"+i);
		  document.getElementsByName("star"+i)[0].className= "post-star-"+i;
		  document.getElementsByName("star"+i)[0].setAttribute("onclick", "return false;");
		 }
		 for(j=parseInt(length)+1; j<=5; j++)
		 {
		  document.getElementsByName("star"+j)[0].setAttribute("class", "post-down-star-"+j);
		  document.getElementsByName("star"+j)[0].className= "post-down-star-"+j;
		  document.getElementsByName("star"+j)[0].setAttribute("onclick", "return false;");
		 }
		 var temp = new Array();
		 temp = resp.responseText.split(' ');
		 $("currentRatingDiv").innerHTML="";
		 var list=document.createElement("ul");
		 list.className="star-rating";
		 for(i=1; i<=5; i++)
		 {
		  if(i<=parseInt(temp[0])) 
		  { 
		   var item=document.createElement("li");
		   var link = document.createElement("a");
		   link.setAttribute("href", "#");
		   link.className="post-star-"+i;
		   link.setAttribute("onclick", "return false;");
		  }
		  if(i==temp[1] && temp[2]==1)
		  {
		   var item=document.createElement("li");
		   var link = document.createElement("a");
		   link.setAttribute("href", "#");
		   link.className="half-star-"+i;
		   link.setAttribute("onclick", "return false;");
		  }
		  else if((i==temp[1] && temp[2]==0) || i>temp[1])
		  {
		   var item=document.createElement("li");
		   var link = document.createElement("a");
		   link.setAttribute("href", "#");
		   link.className="post-down-star-"+i;
		   link.setAttribute("onclick", "return false;");
		  }
		  item.appendChild(link);
		  list.appendChild(item);
		 }
		 var textNode=document.createElement("h3");
		 textNode.appendChild(document.createTextNode("The current rating is:  "));
		 $("currentRatingDiv").appendChild(textNode);
		 $("currentRatingDiv").appendChild(list);
	    }
	});
} 

function populate(categId, url, id)
{
	new Ajax.Request(url, {
		parameters: "&categId="+categId
		+"&flag=0"
		+"&choose=0"
		+"&reviewAdd=0"
		+"&isRated=0"
		+"&rate=0",
		onSuccess: function(resp) {
		var mesaj="";
		var mesaj2="";
		var idCateg="";
		var searchResults = eval('(' + resp.responseText + ')');
		var nrIteratii=searchResults['categorii']['categ'].length;
		var node=document.createElement("option");
			node.setAttribute("value", 0);
			var textNode=document.createTextNode("Select a category");
			node.appendChild(textNode);
			$(id).appendChild(node);
		
		//$('thirdCateg').innerHTML = ''; 
		//$('thirdCateg').appendChild(node); 
		$('addCateg').disabled=true;
		$(id).innerHTML="";
		
		if($('firstCateg').childNodes[0].nodeType==1 && ($('firstCateg').childNodes[0].getAttribute("value")==0)) 
		 {
		   $('firstCateg').removeChild( $('firstCateg').childNodes[0]);
		 }
		else if($('firstCateg').childNodes[1].nodeType==1 && ($('firstCateg').childNodes[1].getAttribute("value")==0)) 
		 {
		   $('firstCateg').removeChild( $('firstCateg').childNodes[1]);
		 }
		var node=document.createElement("option");
			node.setAttribute("value", 0);
			var textNode=document.createTextNode("Select a category");
			node.appendChild(textNode);
			$(id).appendChild(node);
			
		for (i = 0; i <nrIteratii ; i++)
		{
			var node=document.createElement("option");
			node.setAttribute("value", searchResults['categorii']['categ'][i].id);
			var textNode=document.createTextNode(searchResults['categorii']['categ'][i].name);
			node.appendChild(textNode);
			$(id).appendChild(node);
		}
		}
	});
} 

function populateThird(categId, url, id)
{
		new Ajax.Request(url, {
		parameters: "&categId="+categId
		+"&flag=0"
		+"&choose=0"
		+"&reviewAdd=0"
		+"&isRated=0"
		+"&rate=0",
		onSuccess: function(resp) {
		var mesaj="";
		var idCateg="";
		var searchResults = eval('(' + resp.responseText + ')');
		$(id).innerHTML="";
		if($('secondCateg').childNodes[0].nodeType == 1 && ($('secondCateg').childNodes[0].getAttribute("value")==0) )
		{
		   $('secondCateg').removeChild( $('secondCateg').childNodes[0]);
		}
		
		else if($('secondCateg').childNodes[1].nodeType == 1 && ($('secondCateg').childNodes[1].getAttribute("value")==0))
		{		
		   $('secondCateg').removeChild( $('secondCateg').childNodes[1]);
		}
		var nrIteratii2=searchResults['categorii']['categ2'].length;
		
		var node=document.createElement("option");
			node.setAttribute("value", 0);
			var textNode=document.createTextNode("Select a category");
			node.appendChild(textNode);
			$(id).appendChild(node);
		for (i = 0; i <nrIteratii2 ; i++)
		{
			var node=document.createElement("option");
			node.setAttribute("value", searchResults['categorii']['categ2'][i].id);
			var textNode=document.createTextNode(searchResults['categorii']['categ2'][i].name);
			node.appendChild(textNode);
			$(id).appendChild(node);
		}
		}
	});
} 

function deleteFirst(selectId)
{
 if($(selectId).childNodes[0].nodeType == 1 && ($(selectId).childNodes[0].getAttribute("value")==0))
 {
   $(selectId).removeChild( $(selectId).childNodes[0]);
 }
 
 else if($(selectId).childNodes[1].nodeType == 1 && ($(selectId).childNodes[1].getAttribute("value")==0))
 {
   $(selectId).removeChild( $(selectId).childNodes[1]);
 }
 $('addCateg').disabled=false;
}
		 
function validatePass(url, id, cid)
{
    if($(id).value=='')  
	{
	validate(url, id); 
	return;
	}
	new Ajax.Request(url, {
		parameters: "id=" + id+
					"&cid=" +cid+
					"&value="+$(id).value+
					"&cvalue="+$(cid).value
					+"&reviewAdd=0"
					+"&isRated=0"
					+"&choose=0",
		onSuccess: function(resp) { 
		 var idErr="err"+id;
		 var idTabel=id+"Td";
		 if($(idErr)==null)
		 {
		 if($(idTabel).lastChild.nodeType!=1)
			$(idTabel).lastChild.previousSibling.firstChild.nodeValue="";
			new Insertion.After(id, '<span id='+idErr+' style="color:red">  '+resp.responseText+'</span>');
		 }
		 else
		 {
			Element.replace(idErr, '<span id='+idErr+' style="color:red">  '+resp.responseText+'</span>');
		 }
		 } 
		 
	});
} 


function hideElement()
{
 if( $('thirdCateg')!=null && $('thirdCateg').childNodes[0].nodeType == 1)
 {
  if($('thirdCateg').childNodes[0].getAttribute("value")==0)
  {
	$('addCateg').disabled=true;
  }
  else if($('addCateg')!=null) 
  {
   $('addCateg').disabled=false;
  }
  
 }
  else if($('thirdCateg')!=null &&  $('thirdCateg').childNodes[1].nodeType == 1)
  {
   if($('thirdCateg').childNodes[1].getAttribute("value")==0)
  {
	$('addCateg').disabled=true;
  }
   else if($('addCateg')!=null) 
  {
   $('addCateg').disabled=false;
  }
 }
 
 if($('selectList')!=null)
 {
  if($('selectList').options.length == 0)
    new Element.hide( $('chosenCategory'));
 }
}

function hideReview()
{
if($('reviewField')!=null)
 {
   new Element.hide( $('reviewField'));
 }
if ($('ratingField')!=null)
 {
   new Element.hide( $('ratingField'));
 }
}

function showReview()
{
   new Effect.SlideDown($('reviewField'));
   new Effect.SlideDown($('ratingField'));
  if($('firstRating')!=null)
     new Element.hide($('firstRating'));
}

function addUserReview(url,listingId)
{
 new Ajax.Request(url, {
		parameters: "title=" + $('titleReview').value+
		"&descr=" + $('descriptionReview').value
		+"&listId=" + listingId
		+"&flag=0"
		+"&choose=0"
		+"&reviewAdd=1"
		+"&isRated=0"
		+"&rate=0",
		onSuccess: function(resp) { 
		var temp = new Array();
		temp = resp.responseText.split(' ');
		if(temp[0] == "title")
		{
		 if($("errtitleReview")==null)
		 {
		 if($("titleReviewTd").lastChild.nodeType!=1)
			$("titleReviewTd").lastChild.previousSibling.firstChild.nodeValue="";
			new Insertion.After("titleReview", '<span id="errtitleReview" style="color:red">  Please enter a title</span>');
		 }
		 else
		 {
			Element.replace("errtitleReview", '<span id="errtitleReview" style="color:red">   Please enter a title</span>');
		 }
		}
		if(temp[1] == "description")
		{
		 if($("errdescriptionReview")==null)
		 {
		 if($("descriptionReviewTd").lastChild.nodeType!=1)
			$("descriptionReviewTd").lastChild.previousSibling.firstChild.nodeValue="";
			new Insertion.After("descriptionReview", '<span id="errdescriptionReview" style="color:red">  Please enter a description</span>');
		 }
		 else
		 {
			Element.replace("errdescriptionReview", '<span id="errdescriptionReview" style="color:red">   Please enter a description</span>');
		 }
		}
		else if(temp[0]=='' && (temp[1]=='' || temp[1]==null))
		{
		 var currentTime = new Date();
		 var titleNode=document.createElement("p");
		 titleNode.className="informations";
		 titleNode.setAttribute("class", "informations");
		 var titleNodeText=document.createTextNode($('titleReview').value);
		 titleNode.appendChild(titleNodeText);
		 var descriptionNode=document.createElement("p");
		 var month=currentTime.getMonth() + 1;
		 var day=currentTime.getDate();
		 var text=$('descriptionReview').value+" , posted on "+currentTime.getFullYear()+"-"+((month<10)?"0"+month:month)+"-"+((day<10)?"0"+day:day);
		 var descrNodeText=document.createTextNode(text);
		 descriptionNode.appendChild(descrNodeText);
		 $('userReviews').appendChild(titleNode);
		 $('userReviews').appendChild(descriptionNode);
		 $('titleReview').value='';
		 $('descriptionReview').value='';
		 
		}
		}});
}

function removeCategory()
{
 var elem=$('selectList');
 for (var i=0; i<elem.options.length; i++) 
 {
  if (elem.options[i].selected)
  {
   elem.removeChild(elem.options[i]);
   if(elem.options.length==0) 
    {
     hideElement();
     return;
    }
	--i;
  }
 }
}

function addCategory(url)
{
 var categorie=$('secondCateg');
 var chosenCateg=$('chosenCategory');
 var optionExists=false;
 var text=categorie.options[categorie.selectedIndex].text;
 var idVal=categorie.options[categorie.selectedIndex].value;
 var elem=$('selectList');
 new Ajax.Request(url, {
		parameters: "&flag=0"
		+"&choose=1",
		onSuccess: function(resp) { 
		if(idVal == 0)
		{
		  return;
		}
		
		if(chosenCateg.style.display == 'none')
		  chosenCateg.style.display = '';
		var nrOptions=$('selectList').options.length;
		
		if(nrOptions <= 9)
		{ 
		 for(var i=0; i<nrOptions; i++)
		 {
		  if(elem.options[i].value == idVal) 
		  optionExists=true;
		 }
		 if(optionExists == false)
		 {
		  var optionNode=document.createElement("option");
		  optionNode.setAttribute('value', idVal);
		  var optiune=document.createTextNode(text);
		  optionNode.appendChild(optiune);
		  $('selectList').appendChild(optionNode);
		 }
		}
		else
		{
		  var idErr="errselectList";
		  var idTabel="selectListTd";
		  if($(idErr)==null)
		  {
		  if($(idTabel).lastChild.nodeType!=1)
			$(idTabel).lastChild.previousSibling.firstChild.nodeValue="";
		  new Insertion.After('selectList', '<span id='+idErr+' style="color:red">  You have reached 10 options</span>');
		  }
		  else
		  {
			Element.replace(idErr, '<span id='+idErr+' style="color:red">  You have reached 10 options</span>');
	      }
		} 
		
		 if($('errAddCateg')!=null)
		 {
		    Element.replace($('errAddCateg'), '');
		 }
		} 
	});
}

function selectCategories()
{
 var elem=$('selectList');
 if(elem.options.length==0)
 {
  if($('errAddCateg')==null)
  {
    new Insertion.After('addCateg', '<span id="errAddCateg" style="color:red">  Please add a category</span>');
  }
  else
  {
    Element.replace($('errAddCateg'), '<span id="errAddCateg" style="color:red">  Please add a category</span>');
  }
  return false;
 }
 for (var i=0; i<elem.options.length; i++) 
 {
   elem.options[i].selected=true;
 }
}

function areBothFieldsEmpty()
{
  if($('category').value=='' && $('address').value=='')
  {
   alert('Please fill in a search criteria');
   return false;
  }
  else
  { 
   return true;
  }
}

function load(address) {
	var map = null;
    var geocoder = null;
	var marker=null;
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"),{mapTypes:[G_NORMAL_MAP]});
		geocoder = new GClientGeocoder();
		 if (geocoder) {
		  geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
			  map.addControl(new GSmallZoomControl());
              map.setCenter(point, 13);
			  /*var icon = new GIcon();
			  icon.image = "../images/marker1.png";
			  icon.iconSize = new GSize(20, 34);
			  icon.iconAnchor = new GPoint(6, 20);
		   	  icon.infoWindowAnchor = new GPoint(10, 1);*/
              marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
			  GEvent.addListener(marker, "click", function() {
			  map.setCenter(point, 13);
			marker.openInfoWindowHtml(address);
			});
			GEvent.addListener(map, "zoomend", function(){
			  map.setCenter(point);
			 });
            }
          })
		  }
      }
    }
function  changeContent(id, firstTax, secondTax, thirdTax)
{
			var whatValue = $(id);
			var displayBlock = document.getElementById('display')
	        var totalOutput = document.getElementById('totalOutput');
	        
	        var postingsQTY = parseInt(whatValue.value)

            var re = /^[0-9]*$/;
            if (!re.test(whatValue.value)) 
            {
                alert('Only numbers are allowed!');
                whatValue.value = whatValue.value.replace(/[^0-9]/g,'');
            }

	        if (whatValue.value == '') 
            {
		        totalOutput.style.display = 'none';
		        return;
	        }
			else
			{
				 totalOutput.style.display = 'block';
				var taxValue = whatValue.value;
				if(taxValue < 5)
					totalOutput.innerHTML = whatValue.value * firstTax + ' $';
				else if (taxValue >=5 && taxValue <10)
					totalOutput.innerHTML = whatValue.value * secondTax + ' $';
				else if (taxValue >=10)
					totalOutput.innerHTML = whatValue.value * thirdTax + ' $';
			}
}
function Trim(str)
{ 
	str = LTrim(str); 
	return RTrim(str);
}
function RTrim(str)
{ 
	while(str.charAt((str.length -1))==" ")
	{
		str = str.substring(0,str.length-1);
	}
	return str;
}
function LTrim(str)
{
	while(str.charAt(0)==" ")
	{
		str = str.replace(str.charAt(0),"");
	}
	return str;
}

function checkToSeeIfEmpty(id)
{
	if(Trim($(id).value) == '')
	{
		$('fieldMsg').innerHTML = 'Please fill in the number of postings.'
		Element.show('fieldMsg');
		setTimeout("hideMessage('fieldMsg')",1000);
		return false;
	}
	return true;
}

function hideMessage(id)
{
	new Effect.Fade($(id));
	
}

function showDiv(id)
{
	new Effect.Appear($(id));
	$('viewAllCitiesDiv').setAttribute('onclick', 'hideDiv(\''+id+'\')');
	$('viewAllCitiesDiv').innerHTML = 'hide';
}

function hideDiv(id)
{
	new Effect.Fade($(id));
	$('viewAllCitiesDiv').setAttribute('onclick', 'showDiv(\''+id+'\')');
	$('viewAllCitiesDiv').innerHTML = 'view all';
}

function getNrNews(baseUrl)
{
	new Ajax.Request(baseUrl+'news/', {
		parameters: "nrNews="+$('nrNews').options[$('nrNews').selectedIndex].value,
		onSuccess: function(resp) {
			$('newsDesc').style.display = 'none';
			$('news').innerHTML = resp.responseText;
		}
	});
}

function getNews(baseUrl)
{
	new Ajax.Request(baseUrl+'search-news/', {
		parameters: "categId="+$('searchNews').options[$('searchNews').selectedIndex].value,
		onSuccess: function(resp) {
			$('newsDesc').style.display = 'none';
			$('news').innerHTML = resp.responseText;
		}
	});
}
function insertNews(baseUrl)
{

//alert(tinyMCE.getInstanceById('text').getHTML());
	if($('title').value=='' || tinyMCE.getInstanceById('text').getHTML()=='')
		alert('Please enter a title and a description!');
	else
		new Ajax.Request(baseUrl+'add-news/', {
		parameters: "title="+$('title').value+
		"&text="+escape(tinyMCE.getInstanceById('text').getHTML())+
		"&categ="+$('categ').options[$('categ').selectedIndex].value,
		onSuccess: function(resp) {
			location.reload(true);
			$('newsDiv').style.display = 'none';
			$('title').value = '';
			$('text').value = '';
			getNrNews(baseUrl);
			
		}
	});
		
}

function insertEvent(baseUrl)
{

//alert(tinyMCE.getInstanceById('text').getHTML());
	if(tinyMCE.getInstanceById('text1').getHTML()=='')
		alert('Please enter a description!');
	else
		new Ajax.Request(baseUrl+'add-event/', {
		parameters: "title="+$('date-sel2').value+'-'+$('date-sel2-mm').value+'-'+$('date-sel2-dd').value+
		"&text="+escape(tinyMCE.getInstanceById('text1').getHTML())+
		"&type="+$('type').options[$('type').selectedIndex].value,
		onSuccess: function(resp) {
			location.reload(true);
			
			
		}
	});
		
}

function getMailInfo(baseUrl, id)
{
	new Ajax.Request(baseUrl+'get-mail-info/', {
		parameters: "id="+id,
		onSuccess: function(resp) {
			$('mailBody').innerHTML = resp.responseText;
		}
	});
}

function viewAsList(baseUrl)
{
	var currentNrUsers = $('nrUsers').value;

	//$('viewAsLink').innerHTML = '<a href="javascript:void(0);" onclick="viewAsSmallList(\''+baseUrl+'\')"><img src="'+baseUrl+'images/view-list.gif" />&nbsp;<img src="'+baseUrl+'images/view-thumb.gif" /></a>'
	//$('viewAsLink').innerHTML = '<a href="javascript:void(0);" onclick="viewAsSmallList(\''+baseUrl+'\')"><img src="'+baseUrl+'images/view-list.gif" /></a>&nbsp;<a href="javascript:void(0);" onclick="viewAsList(\''+baseUrl+'\')"><img src="'+baseUrl+'images/view-thumb.gif" /></a>'
	for(var i =0; i<currentNrUsers; i++)
	{
		/*var id1 = 'photoTb'+i;
		var id2 = 'photo'+i;
		var id3 = 'privateEmail'+i;
		
		$(id1).style.display  = 'none';
		$(id2).style.display  = 'inline'; 
		$(id3).style.display  = 'inline'; */
		
		$('viewList').style.display = 'none';
		$('thumbView').style.display = 'block';
	}
}

function viewAsSmallList(baseUrl)
{
	var currentNrUsers = $('nrUsers').value;
	//$('viewAsLink').innerHTML = '<a href="javascript:void(0);" onclick="viewAsSmallList(\''+baseUrl+'\')"><img src="'+baseUrl+'images/view-list.gif" /></a>&nbsp;<a href="javascript:void(0);" onclick="viewAsList(\''+baseUrl+'\')"><img src="'+baseUrl+'images/view-thumb.gif" /></a>'

	for(var i =0; i<currentNrUsers; i++)
	{
		//var id1 = 'photoTb'+i;
		//var id2 = 'photo'+i;
		//var id3 = 'privateEmail'+i;
		
		//$(id1).style.display  = 'inline';
		//$(id2).style.display  = 'none'; 
		//$(id3).style.display  = 'none'; 
		$('thumbView').style.display = 'none';
		$('viewList').style.display = 'block';
	}
}
function showLoader(loader)
{
	new Effect.Appear($(loader), {duration: 0.5});
}
	

function hideLoader(loader)
{
	new Effect.Fade($(loader), {duration: 0.5});
}


function sendMessage(baseUrl, userId)
{
	if($('subject').value != '' && $('message').value != '')
	{
		new Ajax.Request(baseUrl+'send-mail/', {
			parameters: "title="+$('subject').value+
			"&text="+$('message').value+
			"&receiverId="+userId,
			
			//onLoading: function() { $('messageDiv').style.display = 'none'; showLoader('mArchive_loader'); },
			//onComplete: function() {$('mArchive_loader').style.display = 'none'; $('messageDiv').style.display = 'none';},
			onSuccess: function(resp) {	$('subject').value=''; $('message').value=''; $('messageDiv').style.display = 'none';}
		});	
	}
	else
		alert('Please enter a subject and a message!');
}

function getNewsDesc(baseUrl, newsId)
{
	new Ajax.Request(baseUrl+'get-news/', {
		parameters: "id="+newsId,

		onSuccess: function(resp) {	
		var str = "";
		var doc = document.getElementsByTagName('span');
		for (var i = 0; i < doc.length; i++){
		   //Do Work on doc[i], this sets the border of the Div black
		   if(doc[i].id.search("newsDesc") != -1)
		   {
				doc[i].style.display = 'none';
		   }
		} 
		//$('newsDesc'+newsId).style.display = 'none';
		$('newsDesc'+newsId).innerHTML = resp.responseText; 
		new Effect.BlindDown($('newsDesc'+newsId), {duration: .2});
		}
	});	
}

function getEventDesc(baseUrl, eventId)
{
	new Ajax.Request(baseUrl+'get-event/', {
		parameters: "id="+eventId,

		onSuccess: function(resp) {	
		var str = "";
		var doc = document.getElementsByTagName('span');
		for (var i = 0; i < doc.length; i++){
		   //Do Work on doc[i], this sets the border of the Div black
		   if(doc[i].id.search("eventDesc") != -1)
		   {
				doc[i].style.display = 'none';
		   }
		} 
		//$('newsDesc'+newsId).style.display = 'none';
		$('eventDesc'+eventId).innerHTML = resp.responseText; 
		new Effect.BlindDown($('eventDesc'+eventId), {duration: .2});
		}
	});	
}

function confirmDelete()
{
	return confirm('Wirklich Löschen?');
}

/* function openSpan(spanId)
{
	$(spanId).style.display = 'block';
	var originalSpanId = 'original' + spanId;
	if($(originalSpanId) != null)
		$(originalSpanId).style.display = 'none';

	var headerSpan = spanId + 'Header';
	var contentSpan = spanId + 'Content';
	var editSpan = spanId + 'Edit';
	var footerSpan = spanId + 'Footer';
	var originalSpan = 'original'+spanId;
	$(headerSpan).style.display = 'none';
	$(editSpan).style.display = 'none';
	$(originalSpan).style.display = 'none';
	//$(headerSpan).style.styleFloat = '';
	//$(headerSpan).style.cssFloat = '';
	// aici se modifica culorile la divuri
	//$(headerSpan).style.width = "760px";
	//$(headerSpan).style.backgroundColor = "#C4DCD4";
	$(headerSpan).className = 'divHeaderAfterEdit';
	$(headerSpan).setAttribute('class', 'divHeaderAfterEdit');
	//var img			= new Image(); 
	//img.src		= 'http://www.associatemedia.com/work/corpsa/user/images/header-feature-edit.png';
	//$(headerSpan).style.backgroundImage		= "url("+img.src+")";
	
	
	$(contentSpan).className = 'divContentAfterEdit';
	$(contentSpan).setAttribute('class', 'divContentAfterEdit');
	//$(contentSpan).style.backgroundColor = "#EDF4F2";
	
	$(spanId).className = 'divFooterAfterEdit';
	$(spanId).setAttribute('class', 'divFooterAfterEdit');
	
	$(footerSpan).style.display = 'block';
	$(editSpan).style.display = 'none';
	if(spanId == 'ActiveFrom')
	{
		var originalSpanId2 = 'originalActiveTo';
		$(originalSpanId2).style.display = 'none';
		$('activeLine').style.display = 'none';
	}
} */

function openSpanHeader(spanId)
{
	$(spanId).style.display = 'block';
	var originalSpanId = 'original' + spanId;
	if($(originalSpanId) != null)
		$(originalSpanId).style.display = 'none';

	var headerSpan = spanId + 'Header';
	var contentSpan = spanId + 'Content';
	var editSpan = spanId + 'Edit';
	var footerSpan = spanId + 'Footer';
	
	//$(headerSpan).style.styleFloat = '';
	//$(headerSpan).style.cssFloat = '';
	// aici se modifica culorile la divuri
	//$(headerSpan).style.width = "760px";
	//$(headerSpan).style.backgroundColor = "#C4DCD4";
	$(headerSpan).style.display = 'block';
	$(headerSpan).className = 'divHeaderAfterEdit2';
	$(headerSpan).setAttribute('class', 'divHeaderAfterEdit2');
	
	$(contentSpan).className = 'divContentAfterEdit2';
	$(contentSpan).setAttribute('class', 'divContentAfterEdit2');
	//$(contentSpan).style.backgroundColor = "#EDF4F2";
	
	$(spanId).className = 'divFooterAfterEdit2';
	$(spanId).setAttribute('class', 'divFooterAfterEdit2');
	$(footerSpan).style.display = 'block';
	
	$(editSpan).style.display = 'none';
	if(spanId == 'ActiveFrom')
	{
		var originalSpanId2 = 'originalActiveTo';
		$(originalSpanId2).style.display = 'none';
		$('activeLine').style.display = 'none';
	}
}

function closeSpan(spanId)
{
	
	$(spanId).style.display = 'none';
	var originalSpanId = 'original' + spanId;
	if($(originalSpanId) != null)
		$(originalSpanId).style.display = 'inline';
	
	var headerSpan = spanId + 'Header';
	var contentSpan = spanId + 'Content';
	var editSpan = spanId + 'Edit';
	
	$(headerSpan).className = 'feature-left';
	$(headerSpan).setAttribute('class', 'feature-left');
	
	$(contentSpan).className = 'feature-center';
	$(contentSpan).setAttribute('class', 'feature-center');
	
	$(editSpan).style.display = 'inline';
	var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
	
	//$(spanId).className = '';
	//$(spanId).setAttribute('class', '');
	
	
	if(spanId == 'ActiveFrom')
	{
		var originalSpanId2 = 'originalActiveTo';
		$(originalSpanId2).style.display = 'inline';
		$('activeLine').style.display = 'inline';
	}
}

function closeSpanHeader(spanId)
{
	
	$(spanId).style.display = 'none';
	var originalSpanId = 'original' + spanId;
	if($(originalSpanId) != null)
		$(originalSpanId).style.display = 'inline';
	
	var headerSpan = spanId + 'Header';
	var contentSpan = spanId + 'Content';
	var editSpan = spanId + 'Edit';
	
	$(headerSpan).style.display = 'none';
	$(headerSpan).className = 'header-feature-header';
	$(headerSpan).setAttribute('class', 'header-feature-header');
	
	$(contentSpan).className = 'header-feature-left';
	$(contentSpan).setAttribute('class', 'header-feature-left');
	
	$(editSpan).className = 'header-feature-right';
	$(editSpan).setAttribute('class', 'header-feature-right');
	
	var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
	
	$(editSpan).style.display = 'inline';
	
	if(spanId == 'ActiveFrom')
	{
		var originalSpanId2 = 'originalActiveTo';
		$(originalSpanId2).style.display = 'inline';
		$('activeLine').style.display = 'inline';
	}
}
function insertKlammerung(baseUrl)	
{
	$('originalKlammerung').style.display = 'none';
	var content = '';
	var returnVal = '';
	content = $('radio1').options[$('radio1').selectedIndex].value;
	returnVal = $('radio1').options[$('radio1').selectedIndex].innerHTML;
	
	/* if($('radio1').checked) 
	{
		content = $('radio1').value;
		returnVal = 'X';
	}
	else if ($('radio2').checked) 
	{
		content = $('radio2').value;
		returnVal = 'XX';
	}
	else if ($('radio3').checked) 
	{
		content = $('radio3').value;
		returnVal = 'XXX';
	}
	else if ($('radio4').checked) 
	{
		content = $('radio4').value;
		returnVal = 'FM';
	}	 */
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+content+
		"&id=Klammerung",

		onSuccess: function(resp) {
			if(returnVal != '')
				$('originalKlammerung').innerHTML = '(' +returnVal + ')';
			else
				$('originalKlammerung3').innerHTML = '';
			$('Klammerung').style.display = 'none';
			$('originalKlammerung').style.display = 'inline';	
		}
	});	
}

function insertKlammerung2(baseUrl)	
{
	$('originalKlammerung2').style.display = 'none';
	var content = '';
	var returnVal = '';
	content = $('radio2').options[$('radio2').selectedIndex].value;
	if($('radio2').selectedIndex!=0)
		returnVal = $('radio2').options[$('radio2').selectedIndex].innerHTML;
	/* if($('radio20').checked) 
	{
		content = $('radio20').value;
		returnVal = 'X';
	}
	else if ($('radio21').checked) 
	{
		content = $('radio21').value;
		returnVal = 'XX';
	}
	else if ($('radio22').checked) 
	{
		content = $('radio22').value;
		returnVal = 'XXX';
	}
	else if ($('radio23').checked) 
	{
		content = $('radio23').value;
		returnVal = 'FM';
	}	 */
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+content+
		"&id=Klammerung2",

		onSuccess: function(resp) {
			if(returnVal != '')
				$('originalKlammerung2').innerHTML = '(' +returnVal + ')';
			else
				$('originalKlammerung3').innerHTML = '';
			//$('Klammerung2').style.display = 'none';
			$('originalKlammerung2').style.display = 'inline';	
		}
	});	
}

function insertKlammerung3(baseUrl)	
{
	$('originalKlammerung3').style.display = 'none';
	var content = '';
	var returnVal = '';
	content = $('radio3').options[$('radio3').selectedIndex].value;
	if($('radio3').selectedIndex!=0)
		returnVal = $('radio3').options[$('radio3').selectedIndex].innerHTML;
	/* if($('radio20').checked) 
	{
		content = $('radio20').value;
		returnVal = 'X';
	}
	else if ($('radio21').checked) 
	{
		content = $('radio21').value;
		returnVal = 'XX';
	}
	else if ($('radio22').checked) 
	{
		content = $('radio22').value;
		returnVal = 'XXX';
	}
	else if ($('radio23').checked) 
	{
		content = $('radio23').value;
		returnVal = 'FM';
	}	 */
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+content+
		"&id=Klammerung3",

		onSuccess: function(resp) {
			if(returnVal != '')
				$('originalKlammerung3').innerHTML = '(' +returnVal + ')';
			else
				$('originalKlammerung3').innerHTML = '';
			//$('Klammerung2').style.display = 'none';
			$('originalKlammerung3').style.display = 'inline';	
		}
	});	
}

function insertPosition(baseUrl)	
{
	$('originalPosition').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('positionText').value+
		"&id=Position",

		onSuccess: function(resp) {
			var spanId = 'Position';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
			
			$(editSpan).style.display = 'inline';
			var footerSpan = spanId + 'Footer';
			$(footerSpan).style.display = 'none';
	
			$('originalPosition').innerHTML = resp.responseText;
			$('Position').style.display = 'none';
			$('originalPosition').style.display = 'inline';	
		}
	});	
}

function insertAcademicTitle(baseUrl)	
{
	$('originalAcademicTitle').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('academicTitleText').value+
		"&id=AcademicTitle",

		onSuccess: function(resp) {
		
			var spanId = 'AcademicTitle';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalAcademicTitle').innerHTML = resp.responseText;
			$('originalAcademicTitle1').innerHTML = resp.responseText;
			$('academicTitleText1').value = resp.responseText;
			$('AcademicTitle').style.display = 'none';
			$('originalAcademicTitle').style.display = 'inline';	
		}
	});	
}

function insertAcademicTitle1(baseUrl)	
{
	$('originalAcademicTitle1').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('academicTitleText1').value+
		"&id=AcademicTitle",

		onSuccess: function(resp) {
			var spanId = 'AcademicTitle1';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
			$(editSpan).style.display = 'inline';

			$('originalAcademicTitle1').innerHTML = resp.responseText;
			$('originalAcademicTitle').innerHTML = resp.responseText;
			$('academicTitleText').value = resp.responseText;
			$('AcademicTitle1').style.display = 'none';
			$('originalAcademicTitle1').style.display = 'inline';	
		}
	});	
}

function insertActiveFrom(baseUrl)
{
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('yearActiveFrom').options[$('yearActiveFrom').selectedIndex].value+'-'+$('monthActiveFrom').options[$('monthActiveFrom').selectedIndex].value+
		"&id=ActiveFrom",

		onSuccess: function(resp) {
			
			$('originalActiveFrom').innerHTML = resp.responseText;
			$('active_date_span').style.display = 'none';	
		}
	});	
}

function insertActiveTo(baseUrl)
{
	
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('yearActiveTo').options[$('yearActiveTo').selectedIndex].value+'-'+$('monthActiveTo').options[$('monthActiveTo').selectedIndex].value+
		"&id=ActiveTo",

		onSuccess: function(resp) {
			$('originalActiveTo').innerHTML = resp.responseText;
			$('active_date_span').style.display = 'none';	
			$('active_date').style.display = 'inline';	
			//$('ActiveTo').style.display = 'none';
			//$('originalActiveTo').style.display = 'inline';	
		}
	});	
}

function insertPrivatePhone(baseUrl)	
{
	$('originalPrivatePhone').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privatePhoneText').value+
		"&id=PrivatePhone",

		onSuccess: function(resp) {
			var spanId = 'PrivatePhone';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
			$(editSpan).style.display = 'inline';
			
			$('originalPrivatePhone').innerHTML = resp.responseText;
			$('originalPrivatePhone1').innerHTML = resp.responseText;
			$('privatePhoneText1').value= resp.responseText;
			$('PrivatePhone').style.display = 'none';
			$('originalPrivatePhone').style.display = 'inline';	
		}
	});	
}

function insertPrivatePhone1(baseUrl)	
{
	$('originalPrivatePhone1').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privatePhoneText1').value+
		"&id=PrivatePhone",

		onSuccess: function(resp) {
		
			var spanId = 'PrivatePhone1';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalPrivatePhone1').innerHTML = resp.responseText;
			$('originalPrivatePhone').innerHTML = resp.responseText;
			$('privatePhoneText').value= resp.responseText;
			$('PrivatePhone1').style.display = 'none';
			$('originalPrivatePhone1').style.display = 'inline';	
		}
	});	
}

function insertMobilePhone(baseUrl)	
{
	$('originalMobilePhone').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('mobilePhoneText').value+
		"&id=MobilePhone",

		onSuccess: function(resp) {
			var spanId = 'MobilePhone';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
			
			$(editSpan).style.display = 'inline';
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalMobilePhone').innerHTML = resp.responseText;
			$('originalMobilePhone1').innerHTML = resp.responseText;
			$('mobilePhoneText1').value = resp.responseText;
			$('MobilePhone').style.display = 'none';
			$('originalMobilePhone').style.display = 'inline';	
		}
	});	
}

function insertMobilePhone1(baseUrl)	
{
	$('originalMobilePhone1').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('mobilePhoneText1').value+
		"&id=MobilePhone",

		onSuccess: function(resp) {
			var spanId = 'MobilePhone1';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalMobilePhone1').innerHTML = resp.responseText;
			$('originalMobilePhone').innerHTML = resp.responseText;
			$('mobilePhoneText').value = resp.responseText;
			$('MobilePhone1').style.display = 'none';
			$('originalMobilePhone1').style.display = 'inline';	
		}
	});	
}

function insertPrivateAddr(baseUrl)	
{
	$('originalPrivateAddr').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privateAddrText').value+
		"&id=PrivateAddr",

		onSuccess: function(resp) {
			var spanId = 'PrivateAddr';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
			
			$(editSpan).style.display = 'inline';
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalPrivateAddr').innerHTML = resp.responseText;
			$('PrivateAddr').style.display = 'none';
			$('originalPrivateAddr').style.display = 'inline';	
		}
	});	
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privateAddrText').value+
		"&id=PrivateAddress",

		onSuccess: function(resp) {
			$('privateAddrText').value = resp.responseText;
			$('privateAddressText').value = resp.responseText;
			$('originalPrivateAddress').innerHTML = resp.responseText;
			
		}
	});	
}

function insertReceptionDate(baseUrl)	
{
	//$('originalReceptionDate').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('day').options[$('day').selectedIndex].value+'/'+$('month').options[$('month').selectedIndex].value+'/'+$('year').options[$('year').selectedIndex].value+
		"&id=ReceptionDate",

		onSuccess: function(resp) {
			
			$('reception_date').innerHTML = resp.responseText;
			$('reception_date_span').style.display = 'none';
			$('reception_date').style.display = 'inline';	
		}
	});	
}

function insertPrivateAddress(baseUrl)	
{
	$('originalPrivateAddress').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privateAddressText').value+
		"&id=PrivateAddress",

		onSuccess: function(resp) {
			var spanId = 'PrivateAddress';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalPrivateAddress').innerHTML = resp.responseText;
			$('PrivateAddress').style.display = 'none';
			$('originalPrivateAddress').style.display = 'inline';	
		}
	});	
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privateAddressText').value+
		"&id=PrivateAddr",

		onSuccess: function(resp) {
			$('privateAddrText').value = resp.responseText;
			$('privateAddressText').value = resp.responseText;
			$('originalPrivateAddr').innerHTML = resp.responseText;
			
		}
	});	
}

function insertPrivateEmail(baseUrl)	
{
	$('originalPrivateEmail').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('privateEmailText').value+
		"&id=PrivateEmail",

		onSuccess: function(resp) {
			var spanId = 'PrivateEmail';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalPrivateEmail').innerHTML = resp.responseText;
			$('PrivateEmail').style.display = 'none';
			$('originalPrivateEmail').style.display = 'inline';	
		}
	});	
}

function insertKann(baseUrl)	
{
	$('originalKann').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('kannText').value+
		"&id=Kann",

		onSuccess: function(resp) {
			// de aici
			var spanId = 'Kann';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
			//pana aici
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalKann').innerHTML = resp.responseText;
			$('Kann').style.display = 'none';
			$('originalKann').style.display = 'inline';	
		}
	});	
}

function insertOrganisation(baseUrl)	
{
	$('originalOrganisation').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('organisationText').value+
		"&id=Organisation",

		onSuccess: function(resp) {
			var spanId = 'Organisation';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$('originalOrganisation').innerHTML = resp.responseText;
			$('Organisation').style.display = 'none';
			$('originalOrganisation').style.display = 'inline';	
		}
	});	
}

function addEducation(baseUrl)
{
	new Ajax.Request(baseUrl+'new-education/', {
		onSuccess: function(resp) {
			$('educationSpanNew').innerHTML = resp.responseText;
			
		}
	});
}

function addEducationAdmin(baseUrl)
{	
	new Ajax.Request(baseUrl+'new-education-admin/', {
		parameters: 'currentNr='+nrEducations,
		onSuccess: function(resp) {
			$('educationSpanNew').innerHTML += resp.responseText;
			nrEducations++;
		}
	});
}

function addMess(baseUrl)
{	
	new Ajax.Request(baseUrl+'new-mess/', {
		onSuccess: function(resp) {
			$('messSpanNew').innerHTML = resp.responseText;	
				
		}
	});
}

function addMessAdmin(baseUrl)
{	
	new Ajax.Request(baseUrl+'new-mess-admin/', {
		parameters: 'currentNr='+nrMess,
		onSuccess: function(resp) {
			$('messSpanNew').innerHTML += resp.responseText;	
			nrMess++;
		}
	});
}
function editEducation(baseUrl, edId)
{
	var origId = 'originalEducation'+edId;
	$(origId).style.display = 'none';
	new Ajax.Request(baseUrl+'edit-education/', {
		parameters: "edId="+edId, 
		onSuccess: function(resp) {
			
			var spanId = 'educationSpan'+edId;
			$(spanId).innerHTML = resp.responseText;	
			
		}
	});
}

function editEducationAdmin(baseUrl, edId, nr)
{
	new Ajax.Request(baseUrl+'edit-education-admin/', {
		parameters: "edId="+edId+"&nr="+nr, 
		onSuccess: function(resp) {
			var spanId1 = 'educationSpan'+edId;
			$(spanId1).innerHTML = resp.responseText;
			
		}
	});
}

function editMess(baseUrl, edId)
{
	new Ajax.Request(baseUrl+'edit-mess/', {
		parameters: "messId="+edId, 
		onSuccess: function(resp) {
			var spanId = 'messSpan'+edId;
			$(spanId).innerHTML = resp.responseText;	
		}
	});
}

function editMessAdmin(baseUrl, edId, nr)
{
	new Ajax.Request(baseUrl+'edit-mess-admin/', {
		parameters: "messId="+edId+"&nr="+nr, 
		onSuccess: function(resp) {
			var spanId = 'messSpan'+edId;
			$(spanId).innerHTML = resp.responseText;	
		}
	});
}

function saveSchool(baseUrl, edId)
{	
	
	new Ajax.Request(baseUrl+'save-education/', {
		parameters: "schoolName="+$('schoolName').value+"&monthActiveFromSchool="+$('monthActiveFromSchool').options[$('monthActiveFromSchool').selectedIndex].value+
	   	"&yearActiveFromSchool="+$('yearActiveFromSchool').options[$('yearActiveFromSchool').selectedIndex].value+
	   	"&monthActiveToSchool="+$('monthActiveToSchool').options[$('monthActiveToSchool').selectedIndex].value+
	   	"&yearActiveToSchool="+$('yearActiveToSchool').options[$('yearActiveToSchool').selectedIndex].value+
	   	"&subjectArea="+$('subjectArea').value+"&highlights="+$('highlights').value+
	   	"&akademischerGrad="+$('akademischerGrad').value+"&edId="+edId, 
		onSuccess: function(resp) {
			var spanId = 'originalEducation'+edId;
			var spanId1 = 'educationSpan'+edId;
			//$(spanId).innerHTML = resp.responseText;	
			$(spanId).innerHTML = resp.responseText;
			$(spanId).style.display = 'inline';
			$(spanId1).innerHTML = '';
		}
	});
}

function saveMess(baseUrl, edId)
{	
	new Ajax.Request(baseUrl+'save-mess/', {
		parameters: "network="+$('network').value+
	   	"&id="+$('id').value+"&edId="+edId, 
		onSuccess: function(resp) {
			var spanId = 'originalMess'+edId;
			var spanId1 = 'messSpan'+edId;
			//$(spanId).innerHTML = resp.responseText;	
			$(spanId).innerHTML = resp.responseText;
			$(spanId1).innerHTML = '';
		}
	});
}

function insertAktivenGeneration(baseUrl)	
{
	$('originalAktivenGeneration').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('aktivenGenerationText').value+
		"&id=AktivenGeneration",

		onSuccess: function(resp) {
			var spanId = 'AktivenGeneration';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
			$('originalAktivenGeneration').innerHTML = resp.responseText;
			$('AktivenGeneration').style.display = 'none';
			$('originalAktivenGeneration').style.display = 'inline';	
		}
	});	
}

function insertBirthDate(baseUrl)
{
	
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('day1').options[$('day1').selectedIndex].value+'/'+$('month1').options[$('month1').selectedIndex].value+'/'+$('year1').options[$('year1').selectedIndex].value+
		"&id=BirthDate",

		onSuccess: function(resp) {
		
			$('birth_date').innerHTML = resp.responseText;
			$('birth_date_span').style.display = 'none';
			$('birth_date').style.display = 'inline';	
		}
	});	
}

function insertSchool(baseUrl)
{
	new Ajax.Request(baseUrl+'insert-school/', {
	
   	parameters: "schoolName="+$('schoolName').value+"&monthActiveFromSchool="+$('monthActiveFromSchool').options[$('monthActiveFromSchool').selectedIndex].value+
   	"&yearActiveFromSchool="+$('yearActiveFromSchool').options[$('yearActiveFromSchool').selectedIndex].value+
   	"&monthActiveToSchool="+$('monthActiveToSchool').options[$('monthActiveToSchool').selectedIndex].value+
   	"&yearActiveToSchool="+$('yearActiveToSchool').options[$('yearActiveToSchool').selectedIndex].value+
   	"&subjectArea="+$('subjectArea').value+"&highlights="+$('highlights').value+
   	"&akademischerGrad="+$('akademischerGrad').value,
   	onSuccess: function(resp){
   			//var spanId = 'originalEducation'+edId;
			//$(spanId).innerHTML = resp.responseText;	
			//$(spanId).innerHTML = resp.responseText;
			var spanId1 = 'educationSpanNew';
			
			$(spanId1).innerHTML = '';
   	}
   	});
}

function insertMess(baseUrl)
{
	new Ajax.Request(baseUrl+'insert-mess/', {
	
   	parameters: "network="+$('network').value+"&id="+$('id').value,
   	onSuccess: function(resp){
   			//var spanId = 'originalEducation'+edId;
			//$(spanId).innerHTML = resp.responseText;	
			//$(spanId).innerHTML = resp.responseText;
			var spanId1 = 'messSpanNew';
			
			$(spanId1).innerHTML = '';
   	}
   	});
}

function insertLeibfuchsMineNew(baseUrl)
{
	
	new Ajax.Request(baseUrl+'update-leibfuchs-new/', {
	
   	parameters: "id1="+$('leibfuchs1').value+"&id2="+$('leibfuchs2').value+
   	"&id3="+$('leibfuchs3').value+"&id4="+$('leibfuchs4').value+
   	"&id5="+$('leibfuchs5').value,
   	onSuccess: function(resp){
   			
			
   			$('leibfuchs').innerHTML = resp.responseText;
   			$('leibfuchs_span').style.display = 'none';
   			$('leibfuchs').style.display = 'inline';
   		}
   	});
}
function insertLeibfuchs(baseUrl)
{
	if($('leibfuchsText').value == '') $('leibfuchsTextHidden').value =0;
	if($('leibfuchsText10').value == '') $('leibfuchsText10Hidden').value =0;
	if($('leibfuchsText11').value == '') $('leibfuchsText11Hidden').value =0;
	if($('leibfuchsText12').value == '') $('leibfuchsText12Hidden').value =0;
	if($('leibfuchsText13').value == '') $('leibfuchsText13Hidden').value =0;
	new Ajax.Request(baseUrl+'update-leibfuchs/', {
	
   	parameters: "id1="+$('leibfuchsTextHidden').value+"&id2="+$('leibfuchsText10Hidden').value+
   	"&id3="+$('leibfuchsText11Hidden').value+"&id4="+$('leibfuchsText12Hidden').value+
   	"&id5="+$('leibfuchsText13Hidden').value,
   	onSuccess: function(resp){
   			var innerHTMLLeibfuchs = $('leibfuchsText').value;
			if($('leibfuchsText10').value != '')
				innerHTMLLeibfuchs += ', '+$('leibfuchsText10').value;
			if($('leibfuchsText11').value != '')
				innerHTMLLeibfuchs += ', '+$('leibfuchsText11').value;
			if($('leibfuchsText12').value != '')
				innerHTMLLeibfuchs += ', '+$('leibfuchsText12').value;
			if($('leibfuchsText13').value != '')
				innerHTMLLeibfuchs += ', '+$('leibfuchsText13').value;
   			var spanId = 'Leibfuchs';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
   			$('originalLeibfuchs').innerHTML = innerHTMLLeibfuchs;
   			$('Leibfuchs').style.display = 'none';
   			$('originalLeibfuchs').style.display = 'inline';
   		}
   	});
}

function insertCorps(baseUrl)
{
	if($('corpsText20').value == '') $('corpsText20Hidden').value =0;
	if($('corpsText21').value == '') $('corpsText21Hidden').value =0;
	if($('corpsText22').value == '') $('corpsText22Hidden').value =0;
	if($('corpsText23').value == '') $('corpsText23Hidden').value =0;
	if($('corpsText24').value == '') $('corpsText24Hidden').value =0;
	new Ajax.Request(baseUrl+'update-corps/', {
	
   	parameters: "id1="+$('corpsText20Hidden').value+"&id2="+$('corpsText21Hidden').value+
   	"&id3="+$('corpsText22Hidden').value+"&id4="+$('corpsText23Hidden').value+
   	"&id5="+$('corpsText24Hidden').value,
   	onSuccess: function(resp){
			var innerHTMLCorps = $('corpsText20').value;
			if($('corpsText21').value != '')
				innerHTMLCorps += ', '+$('corpsText21').value;
			if($('corpsText22').value != '')
				innerHTMLCorps += ', '+$('corpsText22').value;
			if($('corpsText23').value != '')
				innerHTMLCorps += ', '+$('corpsText23').value;
			if($('corpsText24').value != '')
				innerHTMLCorps += ', '+$('corpsText24').value;
			var spanId = 'Corps';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
   			$('originalCorps').innerHTML = innerHTMLCorps;
   			$('Corps').style.display = 'none';
   			$('originalCorps').style.display = 'inline';
   		}
   	});
}

function insertQualification(baseUrl)
{
	
	new Ajax.Request(baseUrl+'update-qualification/', {
	
   	parameters: "id1="+$('qualificationText50').value+"&id2="+$('qualificationText51').value+
   	"&id3="+$('qualificationText52').value+"&id4="+$('qualificationText53').value+
   	"&id5="+$('qualificationText54').value,
   	onSuccess: function(resp){
			var innerHTMLCorps = $('qualificationText50').value;
			if($('qualificationText51').value != '')
				innerHTMLCorps += ', '+$('qualificationText51').value;
			if($('qualificationText52').value != '')
				innerHTMLCorps += ', '+$('qualificationText52').value;
			if($('qualificationText53').value != '')
				innerHTMLCorps += ', '+$('qualificationText53').value;
			if($('qualificationText54').value != '')
				innerHTMLCorps += ', '+$('qualificationText54').value;
			
			var spanId = 'Qualification';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
				
   			$('originalQualification').innerHTML = innerHTMLCorps;
   			$('Qualification').style.display = 'none';
   			$('originalQualification').style.display = 'inline';
   		}
   	});
}

function insertLanguage(baseUrl)
{
	
	new Ajax.Request(baseUrl+'update-language/', {
	
   	parameters: "id1="+$('languageText50').options[$('languageText50').selectedIndex].value+"&id2="+
   	$('languageText51').options[$('languageText51').selectedIndex].value+
   	"&id3="+$('languageText52').options[$('languageText52').selectedIndex].value+
   	"&id4="+$('languageText53').options[$('languageText53').selectedIndex].value+
   	"&id5="+$('languageText54').options[$('languageText54').selectedIndex].value+
   	"state1="+$('languageText50').options[$('languageText50').selectedIndex].value+
   	"&state2="+$('languageText51').options[$('languageText51').selectedIndex].value+
   	"&state3="+$('languageText52').options[$('languageText52').selectedIndex].value+
   	"&state4="+$('languageText53').options[$('languageText53').selectedIndex].value+
   	"&state5="+$('languageText54').options[$('languageText54').selectedIndex].value,
   	onSuccess: function(resp){
   			var innerHTMLCorps = ''
   			if($('languageText50').options[$('languageText50').selectedIndex].value != '0')
				innerHTMLCorps = $('languageText50').options[$('languageText50').selectedIndex].innerHTML;
			if($('languageText51').options[$('languageText51').selectedIndex].value != '0')
				innerHTMLCorps += ', '+$('languageText51').options[$('languageText51').selectedIndex].innerHTML;
			if($('languageText52').options[$('languageText52').selectedIndex].value != '0')
				innerHTMLCorps += ', '+$('languageText52').options[$('languageText52').selectedIndex].innerHTML;
			if($('languageText53').options[$('languageText53').selectedIndex].value != '0')
				innerHTMLCorps += ', '+$('languageText53').options[$('languageText53').selectedIndex].innerHTML;
			if($('languageText54').options[$('languageText54').selectedIndex].value != '0')
				innerHTMLCorps += ', '+$('languageText54').options[$('languageText54').selectedIndex].innerHTML;
				
			var spanId = 'Language';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';	
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
   			$('originalLanguage').innerHTML = innerHTMLCorps;
   			$('Language').style.display = 'none';
   			$('originalLanguage').style.display = 'inline';
   		}
   	});
}

function insertLeibbursch(baseUrl)
{
	  new Ajax.Request(baseUrl+'update-leibbursch/', {
   	parameters: "listId="+$('leibburschTextHidden').value,
   	onSuccess: function(resp){
			var spanId = 'Leibbursch';
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			$(headerSpan).className = 'feature-left';
			$(headerSpan).setAttribute('class', 'feature-left');
			
			$(contentSpan).className = 'feature-center';
			$(contentSpan).setAttribute('class', 'feature-center');
			
			$(spanId).className = '';
			$(spanId).setAttribute('class', '');
			$(editSpan).style.display = 'inline';
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
   			$('originalLeibbursch').innerHTML = resp.responseText;
   			$('Leibbursch').style.display = 'none';
   			$('originalLeibbursch').style.display = 'inline';
   		}
   	});
}

function insertStudium(baseUrl)
{
	  new Ajax.Request(baseUrl+'update-studium/', {
   	parameters: "listId="+$('studiumTextHidden').value,
   	onSuccess: function(resp){
			var spanId = 'Studium';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
   		$('originalStudium').innerHTML = resp.responseText;
   		$('Studium').style.display = 'none';
   		$('originalStudium').style.display = 'inline';
   	}
   	});
}

function getSelectionId2(text, li) {
   //alert(li.innerHTML);
   /*new Ajax.Request('http://www.slicehtml.com/work/update-leibbursch/', {
   	parameters: "listId="+li.id,
   	onSuccess: function(resp){
   			$('originalLeibbursch').innerHTML = $(li.id).innerHTML;
   			$('Leibbursch').style.display = 'none';
   			$('originalLeibbursch').style.display = 'inline';
   		}
   	});*/
	var thisId = text.id+'Hidden';
   	
   	$(thisId).value = li.id;
}
function getSelectionId(text, li) {
   // alert (li.id);
   /*new Ajax.Request('http://localhost/corpsa/update-leibfuchs/', {
   	parameters: "listId="+li.id,
   	onSuccess: function(resp){
   		$('originalLeibfuchs').innerHTML = $(li.id).innerHTML;
   		$('Leibfuchs').style.display = 'none';
   		$('originalLeibfuchs').style.display = 'inline';
   	}
   	});*/
   	var thisId = text.id+'Hidden';
   	
   	$(thisId).value = li.id;
}

function getSelectionId3(text, li) {
   // alert (li.id);
   /*new Ajax.Request('http://localhost/corpsa/update-corps/', {
   	parameters: "listId="+li.id,
   	onSuccess: function(resp){
  	 	$('originalCorps').innerHTML = $(li.id).innerHTML;
   		$('Corps').style.display = 'none';
   		$('originalCorps').style.display = 'inline';
   	}
   	});*/
   	var thisId = text.id+'Hidden';
   	
   	$(thisId).value = li.id;
}
function getSelectionId4(text, li) {
   // alert (li.id);
      	
   	var thisId = text.id+'Hidden';
   	
   	$(thisId).value = li.id;
}
function insertCategory(baseUrl)	
{
	$('originalCategory').style.display = 'none';
	var content = '';
	var returnVal = '';
	
	content = $('radio5').options[$('radio5').selectedIndex].value;
	returnVal = $('radio5').options[$('radio5').selectedIndex].innerHTML;
	
	/* else if ($('radio6').checked) 
	{
		content = $('radio6').value;
		returnVal = 'CB';
	}
	else if ($('radio7').checked) 
	{
		content = $('radio7').value;
		returnVal = 'Fuchs';
	}
	else if ($('radio8').checked) 
	{
		content = $('radio8').value;
		returnVal = 'IaCB';
	}	
	else if ($('radio9').checked) 
	{
		content = $('radio9').value;
		returnVal = 'IdCS';
	}	
	else if ($('radio10').checked) 
	{
		content = $('radio10').value;
		returnVal = 'IIdCS';
	}	 */
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+content+
		"&id=Category",

		onSuccess: function(resp) {
			$('originalCategory').innerHTML = returnVal;
			$('Category').style.display = 'none';
			$('originalCategory').style.display = 'inline';	
		}
	});	
}

function insertEmployer(baseUrl)
{
	$('originalEmployer').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('employerText').value+
		"&id=Employer",

		onSuccess: function(resp) {
			var spanId = 'Employer';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			$(editSpan).style.display = 'inline';
			$('originalEmployer').innerHTML = resp.responseText;
			$('Employer').style.display = 'none';
			$('originalEmployer').style.display = 'inline';	
		}
	});	
}
function insertBussinessAddr(baseUrl)
{
	$('originalBussinessAddr').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('bussinessAddrText').value+
		"&id=BussinessAddr",

		onSuccess: function(resp) {
			var spanId = 'BussinessAddr';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
			
			$(editSpan).style.display = 'inline';
			$('originalBussinessAddr').innerHTML = resp.responseText;
			$('BussinessAddr').style.display = 'none';
			$('originalBussinessAddr').style.display = 'inline';	
		}
	});	
}

function insertBussinessEmail(baseUrl)
{
	$('originalBussinessEmail').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('bussinessEmailText').value+
		"&id=BussinessEmail",

		onSuccess: function(resp) {
			var spanId = 'BussinessEmail';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
	
			$('originalBussinessEmail').innerHTML = resp.responseText;
			$('BussinessEmail').style.display = 'none';
			$('originalBussinessEmail').style.display = 'inline';	
		}
	});	
}

function insertBussinessPhone(baseUrl)
{
	$('originalBussinessPhone').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('bussinessPhoneText').value+
		"&id=BussinessPhone",

		onSuccess: function(resp) {
			var spanId = 'BussinessPhone';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
	
			$('originalBussinessPhone').innerHTML = resp.responseText;
			$('BussinessPhone').style.display = 'none';
			$('originalBussinessPhone').style.display = 'inline';	
		}
	});	
}
function insertUniversity(baseUrl)
{
	$('originalUniversity').style.display = 'none';
	
	new Ajax.Request(baseUrl+'my-account/save/', {
		parameters: "content="+$('universityText').options[$('universityText').selectedIndex].value+
		"&id=University",

		onSuccess: function(resp) {
			var spanId = 'University';
			$(spanId).style.display = 'none';
			var originalSpanId = 'original' + spanId;
			if($(originalSpanId) != null)
				$(originalSpanId).style.display = 'inline';
			
			var headerSpan = spanId + 'Header';
			var contentSpan = spanId + 'Content';
			var editSpan = spanId + 'Edit';
			
			$(headerSpan).style.display = 'none';
			$(headerSpan).className = 'header-feature-header';
			$(headerSpan).setAttribute('class', 'header-feature-header');
			
			$(contentSpan).className = 'header-feature-left';
			$(contentSpan).setAttribute('class', 'header-feature-left');
			
			$(editSpan).className = 'header-feature-right';
			$(editSpan).setAttribute('class', 'header-feature-right');
			
				var footerSpan = spanId + 'Footer';
	$(footerSpan).style.display = 'none';
	
			$('originalUniversity').innerHTML = resp.responseText;
			$('University').style.display = 'none';
			$('originalUniversity').style.display = 'inline';	
		}
	});	
}

function insertInterests(baseUrl)
{
	$('originalInterests').style.display = 'none';
	var weinVal = 0;
	var jagdVal = 0;
	var operVal = 0;
	var segelnVal = 0;
	var footballVal = 0;
	var netzwerkenVal = 0;
	var politikVal = 0;
	var tauchenVal = 0;
	var skilaufenVal = 0;
	var reitenVal = 0;
	var reisenVal = 0;
	
	if($('wein').checked) weinVal = $('wein').value; 
	if($('jagd').checked) jagdVal = $('jagd').value; 
	if($('oper').checked) operVal = $('oper').value; 
	if($('segeln').checked) segelnVal = $('segeln').value; 
	if($('football').checked) footballVal = $('football').value; 
	if($('netzwerken').checked) netzwerkenVal = $('netzwerken').value; 
	if($('politik').checked) politikVal = $('politik').value; 
	if($('tauchen').checked) tauchenVal = $('tauchen').value; 
	if($('skilaufen').checked) skilaufenVal = $('skilaufen').value; 
	if($('reiten').checked) reitenVal = $('reiten').value; 
	if($('reisen').checked) reisenVal = $('reisen').value; 
	new Ajax.Request(baseUrl+'my-account/save-interests/', {
		parameters: "weinVal="+weinVal+"&jagdVal="+jagdVal+"&operVal="+operVal+"&segelnVal="+segelnVal+
		"&footballVal="+footballVal+"&netzwerkenVal="+netzwerkenVal+"&politikVal="+politikVal+
		"&tauchenVal="+tauchenVal+"&skilaufenVal="+skilaufenVal+"&reitenVal="+reitenVal+"&reisenVal="+reisenVal+
		"&id=Interests",
		onSuccess: function(resp) {
			$('originalInterests').innerHTML = resp.responseText;
			$('Interests').style.display = 'none';
			$('originalInterests').style.display = 'inline';	
		}
	});	
}

function sendMessageAndHighlight(url,id)
{
	sendMessage(url, id); 
	$('messageDiv').style.display = 'none';
	$('messageDiv1').style.display = 'block';
	new Effect.Highlight('messageDiv1', {startcolor:'#FF8080', endcolor:'#FFDFDF'});
}

function deleteInput(categ, id, inputId, categ2)
{
	var spanId = 'new'+categ+id;
	var inputId3 = categ2+'Text'+inputId+'Hidden';
	var inputId2 = categ2+'Text'+inputId;
	$(spanId).style.display = 'none';
	
	$(inputId2).value = '';
	$(inputId3).value = 0;
}


 function DeactivateLink()
{	
			
	var url = CorpsA.url+'deactivate/';
	Deactivate(url, CorpsA.user_id);
		
}
function ActivateLink()
{	
	var url = CorpsA.url+'activate/';
	Activate(url, CorpsA.user_id);
		
}

	function Activate(url, user_id)
		{
			
			new Ajax.Request(url, {
			 parameters: "user_id=" + user_id,
			  onSuccess: function(msg) {
			   	if (msg.responseText != "0")
					{
						var currentRowId = 'item'+user_id;
						var currentLinkId = 'activateLink'+user_id;
						
						CorpsA.user_id = user_id;
						document.getElementById(currentLinkId).setAttribute('onclick', DeactivateLink);
						document.getElementById(currentLinkId).onclick = DeactivateLink; 
						document.getElementById(currentLinkId).innerHTML = '<img border="none" src="'+CorpsA.url+'images/icon_accept.gif" alt="deactivate" />';
						document.getElementById(currentLinkId).id = 'deactivateLink'+user_id;
						
							
						
							
					}
			  }
			});
		}
		
		function Deactivate(url, user_id)
		{
		
			if(confirm('Are you sure you want to delete this person\'s admin rights?'))
			{
			new Ajax.Request(url, {
			 parameters: "user_id=" + user_id,
			  onSuccess: function(msg) {
			   	if (msg.responseText != "0")
					{
						if(msg.responseText == 2)
						{
							window.location = CorpsA.url + 'inbox/';
						}
						else
						{
							var currentLinkId = 'deactivateLink'+user_id;
							CorpsA.user_id = user_id;
							document.getElementById(currentLinkId).setAttribute('onclick', ActivateLink);
							document.getElementById(currentLinkId).onclick = ActivateLink;
							document.getElementById(currentLinkId).innerHTML = '<img border="none" src="'+CorpsA.url+'images/icon_deactivate.gif" alt="activate" />';
							document.getElementById(currentLinkId).id = 'activateLink'+user_id;
						}
					}
			  }
			});
			}
		}
	function disableFields()
	{
		if($('isAlive').checked)
		{
			$('deathDate').disabled = false;
			$('deathDateM').disabled = false;
			$('deathDateY').disabled = false;
				
			
			$('privateAddr').disabled = true;
			$('privateEmail').disabled = true;		
			var elems = document.getElementsByName('privatePhone');
			for(i=0; i<elems.length; i++)
			{
				elems[i].disabled = true;
				elems[i].style.backgroundColor = 'rgb(205, 205, 205)';
			}
			$('privateAddr').style.backgroundColor = 'rgb(205, 205, 205)';
			$('privateEmail').style.backgroundColor = 'rgb(205, 205, 205)';
		}
		else
		{
			$('deathDate').disabled = true;
			$('deathDateM').disabled = true;
			$('deathDateY').disabled = true;
			
			$('privateAddr').disabled = false;
			$('privateEmail').disabled = false;
			var elems = document.getElementsByName('privatePhone');
			for(i=0; i<elems.length; i++)
			{
				elems[i].disabled = false;
				elems[i].style.backgroundColor = 'rgb(204, 225, 247)';
			}
			$('privateAddr').style.backgroundColor = 'rgb(204, 225, 247)';
			$('privateEmail').style.backgroundColor = 'rgb(204, 225, 247)';
		}
	}
	
	function loadMail(url, id, categ)
{ new Ajax.Request(url, { parameters: "categ=" + categ + "&id="+id, onSuccess: function(resp) { var responses = resp.responseText.split('#####'); var mailId = "mail"+id; $(mailId+"sender").innerHTML = responses[0]; $(mailId+"subject").innerHTML = responses[1]; $(mailId+"date").innerHTML = responses[2]; $('messageBody').innerHTML = responses[3]; $('mailLinkDelete').innerHTML = responses[4]; }
});}
function loadMailSent(url, id, categ)
{ new Ajax.Request(url, { parameters: "categ=" + categ + "&id="+id, onSuccess: function(resp) { var responses = resp.responseText.split('#####'); var mailId = "mail"+id;  $('messageBody').innerHTML = responses[3]; $('mailLinkDelete').innerHTML = responses[4]; }
});}
function showAddressWin(url)
{ section = 'mail'; createAlbum = ''; new LITBox(url + 'mail/address-book/', { type: 'window', overlay: true, top: 10, height: 750, width: 600, resizable: false, opacity: 1
});}

function addFriendsMail()
{ 
	var nrIterations = $('numberFriends').value; 
	var parentElem = document.getElementById('dest'); 
	var oldText = Trim(parentElem.value); 
	if(oldText.length>0 && oldText.charAt(oldText.length) != ',')
		{ parentElem.value += ', ';}
		for(i=0; i< nrIterations; i++)
		{ 
			if($('c'+i).checked)
			{ 
				$('memberEmails').value += $('c'+i).value+' '; parentElem.value += $('c'+i).value+', ';
			}
		
		}
	$('feedback').style.display = 'block'; setTimeout("hideMessageAddAddressMail()",1000);
}
	

function hover(elem)
{
	elem.className = 'tableHover';
}
function unhover(elem, pos)
{	
	if(pos % 2 == 0)
		elem.className = 'tableEven';
	else
		elem.className = 'tableNotEven';
}

function hideMessageDraft()
{ 
	new Effect.Fade($('draftMsg'));
}
function saveDraft(url)
{
	new Ajax.Request(url+'mail/save-draft/', 
		{
			parameters: "dest=" + $('dest').value + "&subject="+ $('subject').value+ "&message="+ $('message').value+ "&email=" + $('emailId').value+"&isReply="+$('isReply').value,
			onSuccess: function(resp) 
			{ 
				$('emailId').value = resp.responseText;
				window.location = url+'mail/draft/'
			}
		});
	//$('draftMsg').style.display = 'block';
	//setTimeout('hideMessageDraft()', 1000);
}

function selectAllCheckboxes(elem, id)
{
		//alert('sdfsdf');

		if(elem.checked == true)
		{
			var elems = $(id).getElementsByTagName('input');
			for(i=0; i<elems.length; i++)
			{
				if(elems[i].getAttribute('type') == 'checkbox')
				{	
					//alert(elems[i].getAttribute('checked'));
					elems[i].checked = 'true';
				}
			}	
		}
		else
		{
			var elems = $(id).getElementsByTagName('input');
			for(i=0; i<elems.length; i++)
			{
				if(elems[i].getAttribute('type') == 'checkbox')
				{	
					//alert(elems[i].getAttribute('checked'));
					elems[i].checked = false;
				}
			}	
		}
}

function checkSubject()
{
	if($('subject').value == '')
	{
		alert('Please fill in the subject.');
		return false;
	}
	return true;
}

var map = null;
var geocoder = null;

function initialize(address) {
      if (GBrowserIsCompatible()) {
		
        map = new GMap2(document.getElementById("map-holder"));
		
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
		geocoder = new GClientGeocoder();
		showAddress(address);
      }
    }

function showAddress(address) {

     map.checkResize();
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
            
             // marker.openInfoWindowHtml();
            }
          }
        );
      }
    }
	
function addFaq(baseUrl)
{
	
	new Ajax.Request(baseUrl+'new-faq-admin/', {
		parameters: 'currentNr='+nrFaq,
		onSuccess: function(resp) {
			$('faqSpanNew').innerHTML += resp.responseText;	
			nrFaq++;
		}
	});
}
function openSpan(id)

{

	document.getElementById(id).style.display = 'block';

	var linkId = id + 'Open';

	var linkId2 = id + 'Close';
	
	if($(linkId) != null)
		$(linkId).style.display = 'none';
	if($(linkId2) != null)
		$(linkId2).style.display = 'block';
	
	var headerSpan = id + 'Header';
	var contentSpan = id + 'Content';
	var editSpan = id + 'Edit';
	var footerSpan = id + 'Footer';
	var originalSpan = 'original'+id;
	if($(headerSpan) != null)
		$(headerSpan).style.display = 'none';
	if($(editSpan) != null)
		$(editSpan).style.display = 'none';
	if($(originalSpan) != null)
		$(originalSpan).style.display = 'none';
	

	//document.getElementById(linkId).style.display = 'none';

	//document.getElementById(linkId2).style.display = 'inline';

}



function closeSpan(id)

{
	document.getElementById(id).style.display = 'none';
	
	var linkId = id + 'Open';

	var linkId2 = id + 'Close';
	
	if($(linkId) != null)
		$(linkId).style.display = 'block';
	if($(linkId2) != null)
		$(linkId2).style.display = 'none';

	//document.getElementById(linkId2).style.display = 'none';

	//document.getElementById(linkId).style.display = 'inline';
	
	var headerSpan = id + 'Header';
	var contentSpan = id + 'Content';
	var editSpan = id + 'Edit';
	var footerSpan = id + 'Footer';
	var originalSpan = 'original'+id;
	if($(headerSpan) != null)
		$(headerSpan).style.display = 'inline';
	if($(editSpan) != null)
		$(editSpan).style.display = 'inline';
	if($(originalSpan) != null)
		$(originalSpan).style.display = 'inline';

}
function addNewDocument()
{
	var currentDocument = document.getElementById('currentDocument').value;
	document.getElementById('documentDiv'+currentDocument).style.display = "block";
	document.getElementById('currentDocument').value = parseInt(currentDocument) + 1;
}
function removeNewDocument(id)
{
	var currentDocument = document.getElementById('currentDocument').value;
	document.getElementById('documentDiv'+id).style.display = "none";
	if(parseInt(currentDocument) - 1 == parseInt(id))
		document.getElementById('currentDocument').value = parseInt(currentDocument) - 1;
	var allNone = true;
	for(i = 1; i < 50; i++)
		if(document.getElementById('documentDiv'+i).style.display == "block")
			allNone = false;
	if(allNone)
		document.getElementById('currentDocument').value = 1;
}
function checkTitles()
{
	var isGood = true;
	if(document.getElementById('titleImage').value == "")
	{
		isGood = false;
		document.getElementById('titleImage').style.borderColor = "red";
	}
	for(i = 1; i < 50; i++)
		if(document.getElementById('documentDiv'+i).style.display == "block")
		{
			if(document.getElementById('titleDocument'+i).value == "")
			{
				isGood = false;
				document.getElementById('titleDocument'+i).style.borderColor = "red";
			}
		}
	return isGood;
}
function validateKontact()
{
	
	var isOk = true;
	document.getElementById('email').style.borderColor = "#CCCCCC";
	document.getElementById('vorname').style.borderColor = "#CCCCCC";
	document.getElementById('nachname').style.borderColor = "#CCCCCC";
	document.getElementById('strabe').style.borderColor = "#CCCCCC";
	document.getElementById('PLZ').style.borderColor = "#CCCCCC";
	
	if(document.getElementById('email').value == '')
	{
		document.getElementById('email').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('vorname').value == '')
	{
		document.getElementById('vorname').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('nachname').value == '')
	{
		document.getElementById('nachname').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('strabe').value == '')
	{
		document.getElementById('strabe').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('PLZ').value == '')
	{
		document.getElementById('PLZ').style.borderColor = "#FF0000";
		isOk = false;
	}
	return isOk;
}

addEvent(window,'load', addListeners, false);

function addEvent(elm, evType, fn, useCapture){
	 if (elm.addEventListener){
			 elm.addEventListener(evType, fn, useCapture);
			 return true;
		 } else if (elm.attachEvent){
					 var r = elm.attachEvent('on' + evType, fn);
					 return r;
				} else {
					 elm['on' + evType] = fn;
			}
	}
	
function about_corpsa_func()
{
	Effect.BlindUp('universitat_about', {duration:0.4});
	Effect.BlindUp('main_frankfurt', {duration:0.4});
	Effect.BlindUp('the_aktuelles', {duration:0.4});
	//Effect.BlindUp('the_faq', {duration:0.4});
	Effect.BlindUp('the_welcomeEN', {duration:0.4});
	
	Effect.toggle('corpsa_about','blind',{duration:0.4}); 
	document.getElementById('about_corpsa').blur();
}
function about_universitat_func()
{
	Effect.BlindUp('corpsa_about', {duration:0.4});
	Effect.BlindUp('main_frankfurt', {duration:0.4});
	Effect.BlindUp('the_aktuelles', {duration:0.4});
	//Effect.BlindUp('the_faq', {duration:0.4});
	Effect.BlindUp('the_welcomeEN', {duration:0.4});
	
	Effect.toggle('universitat_about','blind',{duration:0.4}); 
	document.getElementById('about_universitat').blur();
}
function frankfurt_main_func()
{
	Effect.BlindUp('corpsa_about', {duration:0.4});
	Effect.BlindUp('universitat_about', {duration:0.4});
	Effect.BlindUp('the_aktuelles', {duration:0.4});
	//Effect.BlindUp('the_faq', {duration:0.4});
	Effect.BlindUp('the_welcomeEN', {duration:0.4});
	
	Effect.toggle('main_frankfurt','blind',{duration:0.4}); 
	document.getElementById('frankfurt_main').blur();
}
function aktuelles_func()
{
	Effect.BlindUp('corpsa_about', {duration:0.4});
	Effect.BlindUp('universitat_about', {duration:0.4});
	Effect.BlindUp('main_frankfurt', {duration:0.4});
	//Effect.BlindUp('the_faq', {duration:0.4});
	Effect.BlindUp('the_welcomeEN', {duration:0.4});
	
	Effect.toggle('the_aktuelles','blind',{duration:0.4}); 
	document.getElementById('aktuelles').blur();
}
function faq_func()
{
	Effect.BlindUp('corpsa_about', {duration:0.4});
	Effect.BlindUp('universitat_about', {duration:0.4});
	Effect.BlindUp('main_frankfurt', {duration:0.4});
	Effect.BlindUp('the_aktuelles', {duration:0.4});
	Effect.BlindUp('the_welcomeEN', {duration:0.4});
	
	Effect.toggle('the_faq','blind',{duration:0.4}); 
	//document.getElementById('faq').blur();
}

function welcomeEN_func()
{
	Effect.BlindUp('corpsa_about', {duration:0.4});
	Effect.BlindUp('universitat_about', {duration:0.4});
	Effect.BlindUp('main_frankfurt', {duration:0.4});
	Effect.BlindUp('the_aktuelles', {duration:0.4});
	//Effect.BlindUp('the_faq', {duration:0.4});
	
	Effect.toggle('the_welcomeEN','blind',{duration:0.4}); 
	document.getElementById('welcomeEN').blur();
}
	
function addListeners()
{
	
	addEvent($("about_corpsa"),'click', about_corpsa_func, false);
	addEvent($("about_universitat"),'click', about_universitat_func, false);
	addEvent($("frankfurt_main"),'click', frankfurt_main_func, false);
	addEvent($("aktuelles"),'click', aktuelles_func, false);
	//addEvent($("faq"),'click', faq_func, false);
	addEvent($("welcomeEN"),'click', welcomeEN_func, false);
	/*
	$("corpsa_about").style.display='none';
	$("universitat_about").style.display='none';
	$("main_frankfurt").style.display='none';
	$("the_aktuelles").style.display='none';
	$("the_faq").style.display='none';
	*/
}

function testComments()
{
	var isOk = true;
	document.getElementById('the_name').style.borderColor = "#CCCCCC";
	document.getElementById('the_email').style.borderColor = "#CCCCCC";
	document.getElementById('the_content').style.borderColor = "#CCCCCC";
	
	if(document.getElementById('the_email').value == '')
	{
		document.getElementById('the_email').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('the_name').value == '')
	{
		document.getElementById('the_name').style.borderColor = "#FF0000";
		isOk = false;
	}
	if(document.getElementById('the_content').value == '')
	{
		document.getElementById('the_content').style.borderColor = "#FF0000";
		isOk = false;
	}
	return isOk;
}
