// JavaScript Document
  iWidth  = 640;
  iHeight = 420;

  function zoom(pic,type){
    window.open("/content/zoom.php?pic="+pic+"&type="+type, "Zoom", "width="+iWidth+",height="+iHeight+",toolbar=no,directories=no,status=no,toolbar=0,resizable=1,scrollbars=1,menubar=0");
  }

  /*function zoom_immo(pic){
    window.open("/content/zoomImmo.php?pic="+pic, "Zoom2", "width="+iWidth+",height="+iHeight+",toolbar=no,directories=no,status=no,toolbar=0,resizable=1,scrollbars=1,menubar=0");
  }*/
  
  function zoom_immo(pic, title){
	  zoomTitle = '';
	  try{ if (typeof(title)!="undefined") zoomTitle = title; } catch(e){zoomTitle = '';};
    window.open("/content/zoomImmo.php?pic="+pic+"&title="+encodeIt(zoomTitle), "Zoom2", "width="+iWidth+",height="+iHeight+",toolbar=no,directories=no,status=no,toolbar=0,resizable=1,scrollbars=1,menubar=0");
  }
  
	function encodeIt(str) {
		 if (!str || str == '') return '';
		 encodedHtml = encodeURI(str);
		 encodedHtml = encodedHtml.replace(/\//g,"%2F");
		 encodedHtml = encodedHtml.replace(/\?/g,"%3F");
		 encodedHtml = encodedHtml.replace(/=/g,"%3D");
		 encodedHtml = encodedHtml.replace(/&/g,"%26");
		 encodedHtml = encodedHtml.replace(/@/g,"%40");
		return encodedHtml;
	}
  
  function googleMap(city){
    window.open("http://w006fa4e.dd18032.kasserver.com/thirdparty/googlemaps/?query="+city, "City", "width="+iWidth+",height="+iHeight+",toolbar=no,directories=no,status=no,toolbar=0,resizable=1,scrollbars=1,menubar=0");
  }

  function printWin(ct_id){
    iWidth  = 700;
    iHeight = 500;
    sX = screen.availWidth;
    sY = screen.availHeight;
    iX = (screen.availWidth-iWidth)/2;
    iY = (screen.availHeight-iHeight)/2;
    win1 = window.open("/content/printWin.php?ct_id="+ct_id, "PrintWindow", "height="+iHeight+",width="+iWidth+",toolbar=no,directories=no,status=no,screenX="+iX+",screenY="+iY+",toolbar=0,resizable=1,scrollbars=1,menubar=0");
    win1.moveTo(iX,iY);
  }

  function sendWin(ct_id){
    iWidth  = 660;
    iHeight = 420;
    sX = screen.availWidth;
    sY = screen.availHeight;
    iX = (screen.availWidth-iWidth)/2;
    iY = (screen.availHeight-iHeight)/2;
    win2 = window.open("/content/sendWin.php?ct_id="+ct_id, "SendWindow", "height="+iHeight+",width="+iWidth+",toolbar=no,directories=no,status=no,screenX="+iX+",screenY="+iY+",toolbar=0,resizable=1,scrollbars=1,menubar=0");
    win2.moveTo(iX,iY);
  }

  function printImmo(object,type){
    iWidth  = 660;
    iHeight = 420;
    sX = screen.availWidth;
    sY = screen.availHeight;
    iX = (screen.availWidth-iWidth)/2;
    iY = (screen.availHeight-iHeight)/2;
    win3 = window.open("/content/printImmo.php?object="+object+"&type="+type, "PrintAmmon", "height="+iHeight+",width="+iWidth+",toolbar=no,directories=no,status=no,screenX="+iX+",screenY="+iY+",toolbar=0,resizable=1,scrollbars=1,menubar=0");
    win3.moveTo(iX,iY);
  }

  function sendImmo(object){
    iWidth  = 660;
    iHeight = 420;
    sX = screen.availWidth;
    sY = screen.availHeight;
    iX = (screen.availWidth-iWidth)/2;
    iY = (screen.availHeight-iHeight)/2;
    win4 = window.open("/content/sendImmo.php?object="+object, "SendAmmon", "height="+iHeight+",width="+iWidth+",toolbar=no,directories=no,status=no,screenX="+iX+",screenY="+iY+",toolbar=0,resizable=1,scrollbars=1,menubar=0");
    win4.moveTo(iX,iY);
  }

  function recommendImmo(url,c,sc,ct,object){
    iWidth  = 660;
    iHeight = 420;
    sX = screen.availWidth;
    sY = screen.availHeight;
    iX = (screen.availWidth-iWidth)/2;
    iY = (screen.availHeight-iHeight)/2;
    win4 = window.open("/content/recommendImmo.php?url="+url+"&c="+c+"&sc="+sc+"&ct="+ct+"&object="+object, "RecommendAmmon", "height="+iHeight+",width="+iWidth+",toolbar=no,directories=no,status=no,screenX="+iX+",screenY="+iY+",toolbar=0,resizable=1,scrollbars=1,menubar=0");
    win4.moveTo(iX,iY);
  }

  function forwardToNews(){
    ct = parent.frames[1].document.news.news_ct.value;
	location.href="/content/index.php?"+ct;
  }

  function setNavi(ct){
    parent.frames[1].highliteNavi(ct);
  }
  
  function adresse(name, domain, tld){
		var email = "<a href='mailto:"+name+"@"+domain+"."+tld+"'>"+name+"@"+domain+"."+tld+"</a>";
		document.write(email);
}

function addAddress(){
  if(document.getElementById('addAddressButton').value=="on"){
    document.getElementById("addressField1").style.display = 'block';
    document.getElementById('addAddressButton').value ="off";
    document.getElementById("butTxt").innerHTML = 'Meine Adresse ausblenden';
  }else{
    document.getElementById("addressField1").style.display = 'none';
    document.getElementById('addAddressButton').value ="on";
    document.getElementById("butTxt").innerHTML = 'Meine Adresse angeben';
  }
}

function changeVermarktungsart(text) {
	el = document.getElementById('vermarktungsart_quicksearch');
	el.value = text;
}

function submitCardSearchForm(form_name,new_action) {

form = document.getElementById(form_name);

form.action = new_action;
form.submit();

var s = window.parent.Shadowbox;
	s.open({
	player:     'iframe',
	content:    '/gruene_karte_dev.php',
	width:      720,
	height:     650
	});
}

function setOrtAndSubmitSearchForm(fname, ort) {
	form = document.getElementById(fname);
	//form = window.parent.getElementById(fname);
	
	//form.geokm.value = 10;
	form.ort.value = ort;
	
	form.submit();
}

function setPLZAndSubmitSearchForm(fname, plz) {
	form = document.getElementById(fname);
	//form = window.parent.getElementById(fname);
	
	form.geokm.value = 10;
	form.plz.value = plz;
	
	form.submit();
}


function submitSearchForm(start_val) {
	form = document.getElementById('suchergebnisse');
	form.start_hiddenField.value = start_val;
	form.submit();
}
