// JavaScript Document for hannemann-immobilien.de
hideAll = function() {
		$('.content_col').hide();
	}
	
showContent = function(id) {
		hideAll();
		$(id).show();
	}
removeCurrent = function() {
	$('#navlist a').removeClass('current');
}

/*
$(document).ready(function(){
						   
	showContent('#col_main_1');	  
	
	$("#nav_1").click(function () {
		removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_1');
    });

$("#nav_2").click(function () {
    removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_2');
    });

$("#nav_3").click(function () {
    removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_3');
    });
$("#nav_4").click(function () {
    removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_4');
    });
$("#nav_5").click(function () {
    removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_5');
    });
$("#nav_6").click(function () {
    removeCurrent();
      $(this).addClass("current");
	  showContent('#col_main_6');
    });
});
*/

function doIframe(){
	o = document.getElementsByTagName('iframe');
	for(i=0;i<o.length;i++){
		if (/\bautoHeight\b/.test(o[i].className)){
			setHeight(o[i]);
			addEvent(o[i],'load', doIframe);
		}
	}
}

function setHeight(e){
	if(e.contentDocument){
		e.height = e.contentDocument.body.offsetHeight + 35;
	} else {
		e.height = e.contentWindow.document.body.scrollHeight;
	}
}

function addEvent(obj, evType, fn){
	if(obj.addEventListener)
	{
	obj.addEventListener(evType, fn,false);
	return true;
	} else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
	return r;
	} else {
	return false;
	}
}

if (document.getElementById && document.createTextNode){
 addEvent(window,'load', doIframe);	
}


function sizeIFrame() {
var helpFrame = $("#maklerserver");
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
helpFrame.height(innerDoc.body.scrollHeight + 35);
}

