/* <![CDATA[ */
$(document).ready(function () {
	
	// Fancybox
	$("a.pp450").fancybox({
		'width'			 : 450, 
		'height'		 : 380,        
		'autoDimensions' : false,
		'type'			 : 'iframe'
	});
	
	$("a.pp550").fancybox({
		'width'			 : 550, 
		'height'		 : 450,        
		'autoDimensions' : false,
		'type'			 : 'iframe'
	});
	
	$("a.pp650").fancybox({
		'width'			 : 650, 
		'height'		 : 600,        
		'autoDimensions' : false,
		'type'			 : 'iframe'
	});
	
	
	
	$("a.popup").fancybox({
		'width'		:	620, 
		'height'	:	'auto',        
		'autoDimensions' : false
	});
	
	$("a.bild").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition'  : 'inside'
	});		
});

// Kommentarbox
var aktiv;
function tagEinfuegen (tag) {
	if (!aktiv) {
		$("#komment_text").val($("#komment_text").val() + "[" + tag + "]");	
		$("#komment_text").focus();
		$("#tag_" + tag).prepend("\/");
		$("#tag_" + tag).css("backgroundColor", "#f19b97");
		aktiv = true;
	} else {
		$("#komment_text").val($("#komment_text").val() + "[\/" + tag + "]");	
		$("#komment_text").focus(); 
		$("#tag_" + tag).text(tag);
		$("#tag_" + tag).css("backgroundColor", "#eee");
		aktiv = false;
	}
	return false;
}


// Resize Iframe
function anpassen(){
	var hoehe = frames['forum'].document.getElementById('container_forum').offsetHeight;
	hoehe = (hoehe + 30)  + 'px';
	document.getElementById('forum').style.height = hoehe;
}

/*
 * Jonathan Howard
 *
 * jQuery Pause
 * version 0.2
 *
 * Requires: jQuery 1.0 (tested with svn as of 7/20/2006)
 *
 * Feel free to do whatever you'd like with this, just please give credit where
 * credit is do.
 *
 *
 *
 * pause() will hold everything in the queue for a given number of milliseconds,
 * or 1000 milliseconds if none is given.
 *
 *
 *
 * unpause() will clear the queue of everything of a given type, or 'fx' if no
 * type is given.
 */

$.fn.pause = function(milli,type) {
	milli = milli || 1000;
	type = type || "fx";
	return this.queue(type,function(){
		var self = this;
		setTimeout(function(){
			$.dequeue(self);
		},milli);
	});
};

$.fn.clearQueue = $.fn.unpause = function(type) {
	return this.each(function(){
		type = type || "fx";
		if(this.queue && this.queue[type]) {
			this.queue[type].length = 0;
		}
	});
};

// Fenster öffnen
function fenster (url, breite) {
	window.open(url, "Fenster", "height = 510, width = " + breite + ", scrollbars = yes, resizable = yes");
}

// Link href
function link (link) {
	location.href = link;
}

// Ebene (Login) aus-/einblenden
function anzeigeAus (id, id2) {
	document.getElementById(id).style.display = 'none';
	if (id2) {
		document.getElementById(id2).style.display = '';
	}
}

function anzeigeAn (id, id2) {
	document.getElementById(id).style.display = '';
	if (id2) {
		document.getElementById(id2).style.display = 'none';
	}
}

/* ]]> */
