function showLoginBox(url, page) {
	
	new Ajax.Request(webPath + 'cc/getloginbox.php',{method: 'post',onComplete : onComplete,postBody: 'url='+url+'&page='+page} );
	
	function onComplete(t) {
		$('loginboxOuter').update(t.responseText);
		$('loginbox').className='show';
		document.location.href = '#login';
		$('loginPasswd').focus();
		
		if (navigator.cookieEnabled == false) {
			$('login_container').style.display = 'none';
			$('js_note').style.display = 'block';
		}
	}
}
function forgotPassword() {
	$('pwvergessenlink').update('sending...');
	
	new Ajax.Request(webPath + 'cc/resendpassword.php',{method: 'post', evalScripts:true, onComplete : onComplete, postBody: 'resend=1'});
	
	function onComplete(t) {
		var t = t.responseText;
		var r = t.split(";");
		$('resendpw').update(r[1]);
		$('resendpw').className='message-'+r[0];
		$('pwvergessenlink').remove();
	}
}

function PopupFenster(pfad) {
  F = window.open(pfad,"Druckversion","width=700,height=600,scrollbars=yes,top=30,left=30,toolbar=yes,menubar=yes");
}

// Box Laden
function tellafriend(page) {
	new Ajax.Updater('content_start', 'cc/templates/tellafriend.php?pageID='+page+'&url='+self.location.href, {method:'get', asynchronous:true, evalScripts:true}); 
	new Effect.ScrollTo('content_start', {offset: -24});
	$('content_start').style.display = 'block';
}

// Box abschicken
function tellafriend_send() {
	$('tellafriend_absenden').value='Empfehlung wird gesendet...';
	$('tellafriend_absenden').disabled = true;

	new Ajax.Request('cc/tellafriend.php', {onComplete:tellafriend_check,method:'post',postBody:Form.serialize('tellafriend_form'), asynchronous:true, evalScripts:true}); 
    Form.disable('tellafriend_form'); 
	return false;
}
function tellafriend_check(t) {
	check = t.responseText; 
	if (check == 'ok') {
		Element.hide('tellafriend_error');
		Element.update('tellsurl', 'Vielen Dank, dass Sie diese Seite weiterempfohlen haben.'); 
	    Element.update('tellstatus', 'Die Seite wurde verschickt.'); 
	 	new Effect.SlideUp('tellbody'); 
	 	new Effect.Highlight('tellheader', {startcolor:'#E0EABB', endcolor:'#EEEEEE',duration: 1}) 
	}
	else {
		$('tellafriend_error').style.display = 'block';
		$('tellafriend_error').update(check);
	}
	
	Form.enable('tellafriend_form'); 
	$('tellafriend_absenden').value='Empfehlung senden';	
}

// Sidebar
function getSidebarSelection(targ,selObj,restore) {
	if (selObj.selectedIndex == 0) {
		return;
	}
	$('systemWorking').style.display = 'block';
	$('systemWorking').update('<img style="display:inline;" src="' + webPath + 'cc/img/loading-small.gif"> Loading...');
	new Ajax.Updater('systemWorking', 'sidebar/'+selObj.selectedIndex+'.html', {method:'get', evalScripts:true});
}

