function navigation(item) {

 if (document.getElementById(item).style.display=='none') 
 	 document.getElementById(item).style.display='block'; 
 else document.getElementById(item).style.display='none';
 
}

function username(theUsername) {
  addText(theUsername + " ", "", false, document.bbform);
}

function clear() {
  document.bbform.message.value='';
}

function PopUp() {
  var breite = 600;
  var hoehe = 550;
  var positionX =((screen.availWidth / 2) - breite / 2);
  var positionY =((screen.availHeight / 2) - hoehe / 2);
  var url = 'shoutbox.php?action=history'
  pop=window.open('','','width='+breite+',height='+hoehe+',scrollbars=yes,resizable=yes,top=10000,left=10000');
  pop.resizeTo(breite,hoehe);
  pop.moveTo(positionX,positionY);
  pop.location=url;
}

function rating(userid) {
 window.open("misc.php?action=userrating&userid="+userid+"", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=350,height=205");
}

function tax() {
 window.open("guthaben.php?action=tax", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=850,height=750");
}

function career(userid) {
 window.open("lebenslauf.php?userid="+userid+"", "moo", "scrollbars=yes,resizable=no,width=425,height=370");
}

function knuddel(userid) {
 window.open("profile.php?action=knuddeln&amp;userid"+userid+"","moo", "toolbar=no,scrollbars=no,resizable=yes,width=200,height=150");
}

function kiss(userid) {
 window.open("profile.php?action=kisses&amp;userid="+userid+"","moo", "toolbar=no,scrollbars=no,resizable=no,width=200,height=150");
}


//<![CDATA[
var stylePreviewImages = new Array();
stylePreviewImages[0] = 'online\/profile_style_preview_1.png';
stylePreviewImages[1] = 'online\/profile_style_preview_2.png';
stylePreviewImages[2] = 'online\/profile_style_preview_3.png';
stylePreviewImages[3] = 'online\/profile_style_preview_4.png';								
function showStylePreviewImage(styleSelect) {
	
	// remove image
	var stylePreviewImageContainer = document.getElementById('stylePreviewImageContainer');
	for (var i = stylePreviewImageContainer.childNodes.length - 1; i >= 0; i--) {
		stylePreviewImageContainer.removeChild(stylePreviewImageContainer.childNodes[i]);
	}
																
	if (styleSelect.selectedIndex != -1) {
		var r_profileid = styleSelect.options[styleSelect.selectedIndex].value
		if (stylePreviewImages[r_profileid]) {
			var image = document.createElement('img');
			stylePreviewImageContainer.appendChild(image);
			image.src = 'images/' + stylePreviewImages[r_profileid];
		}
	}
	}
								
	onloadEvents.push(function() { showStylePreviewImage(document.getElementById('r_profileid')) });
//]]>

