/**
 * @author groening
 */


function isInArray(needle, haystack)
{
	for (x=0; x < haystack.length; x++)
	{
		if (haystack[x] == needle)
		{
			return true;
		}
	}
	return false;
}

function cookieCheck(){
	if (document.getElementById('cookie_check')) {
		if (navigator.cookieEnabled == true) {
			document.getElementById('cookie_check').value = 1;
		}
		else {
			document.getElementById('cookie_check').value = 0;
			//document.getElementById('cookie_check')
		}
	}
}

function placeDiv(div_id){
	//alert(div_id + ' ' + $(window).scrollTop());
	$('#' + div_id).css('top', $(window).scrollTop() + 300 + 'px');
}

function pageOffset(win){	
	
	
	
	if (!win) 
		win = window;
	var pos = {
		left: 0,
		top: 0
	};
	
	if (typeof win.pageXOffset != 'undefined') {
		// Mozilla/Netscape
		pos.left = win.pageXOffset;
		pos.top = win.pageYOffset;
	}
	else {
		var obj = (win.document.compatMode && win.document.compatMode == "CSS1Compat") ? win.document.documentElement : win.document.body || null;
		
		pos.left = obj.scrollLeft;
		pos.top = obj.scrollTop;
	}
	
	return pos;
}


function NewWindow(mypage,myname,w,h,status,scroll,resize)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',status=' + status + ',scrollbars=' + scroll + ',resizable=' + resize;
	var win = window.open(mypage,myname,settings);
}

function einblenden(name)
{
	if (document.getElementById)
  	{
    	document.getElementById(name).style.display = "block";
    }
  	else if (document.all)
    	document.all(name).style.display = "block";
  	else if (document.layers)
    	document.layers[name].display = "block";
}

function ausblenden(name)
{
	if( document.getElementById(name) ) {
		document.getElementById(name).style.display = "none";
	}
  	else if(parent.document.getElementById)
    	parent.document.getElementById(name).style.display = "none";
  	else if (parent.document.all)
    	parent.document.all(name).style.display = "none";
  	else if (parent.document.layers)
    	parent.document.layers[name].display = "none";
}

