
function decode(text1, text2, text3)
{
document.write('<a href="' + 'mailto:' + text1 + '@' + text2 + '.' + text3 + '">' + text1 + '@' + text2 + '.' + text3 + '</a>');
}

function search_mod()
{
var m = document.forms.searchform.search_herst.value;
location.href='geb-gebrauchtwagen.php?' + m;
}

function search_mod_pro()
{
var m = document.forms.searchform.search_herst.value;
location.href='gw-profisuche.php?' + m;
}

function mess_herst()
{
   alert("Bitte wählen Sie zuerst einen Hersteller aus!");
   document.searchform.search_herst.focus();
}

function pop_karte(l)
{
f=window.open('../allgemein/g-karte.php?l='+l ,'Kartenansicht','status=no, toolbar=no, scollbars=no, resizable=yes, directores=no, menubar=no, width=650, height=450');
f.window.focus();
}

function pop_uwex()
{
f=window.open('http://kp2.my-motion.de/formular.php?user=30053&zeilen=15' ,'Gebrauchtwagen','dependent=yes,scrollbars=yes,width=650, height=770');
f.window.focus();
}
function suchdiv_off()
{
document.getElementById('such_div').style.display = 'none';
}

function pop_img()
{
f=window.open('popup_img.php','grossbild','status=no, toolbar=no, scollbars=no, resizable=yes, directores=no, menubar=no, width=700, height=620');
f.window.focus();
}


function mail_on(x)
{
f=window.open('ask.php?id=' +x ,'grossbild','status=no, toolbar=no, scollbars=no, resizable=yes, directores=no, menubar=no, width=670, height=550');
f.window.focus();
}
///////////////  Navigation /////////////////////////////////////////////////////////////////

function findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function Openme(newin) {
        flyout=window.open(newin,"table","resizable=yes,scroll=yes,width=600,height=400,top=50,left=50")

}


lastLayer = 0;

layerRef="document.getElementById";
styleRef="";

if (document.images){
	var b15_on = new Image();
        b15_on.src = "images/21b10015.gif";
        var b15_off = new Image();
        b15_off.src = "images/21b00015.gif";


        }
function on(imgName) {
	if (document.images) {
    	document[imgName].src = eval(imgName + '_on.src');
   	}
}
function off(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + '_off.src');
   	}
}

function clicked(LayerGo,LayerGo2,LayerGo3,LayerGo4) {
	layerTemp = eval(layerRef + '[LayerGo]' + styleRef);
    layerTemp2 = eval(layerRef + '[LayerGo2]' + styleRef);
    layerTemp3 = eval(layerRef + '[LayerGo3]' + styleRef);
	layerTemp4 = eval(layerRef + '[LayerGo4]' + styleRef);
	if(layerTemp.visibility=="hidden" || layerTemp.visibility=="hide") {
		if(lastLayer!=0) {
			lastLayer.visibility = "hidden";
            lastLayer2.visibility = "hidden";
            lastLayer3.visibility = "hidden";
			lastLayer4.visibility = "hidden";
		}
		layerTemp.visibility = "visible";
        layerTemp2.visibility = "visible";
        layerTemp3.visibility = "visible";
		layerTemp4.visibility = "visible";
		lastLayer = layerTemp;
        lastLayer2 = layerTemp2;
        lastLayer3 = layerTemp3;
		lastLayer4 = layerTemp4;
	}else{
		layerTemp.visibility = "hidden";
        layerTemp2.visibility = "hidden";
        layerTemp3.visibility = "hidden";
		layerTemp4.visibility = "hidden";
		LastLayer = 0;
		imgClicked = 0;
	}
}

function winopen( windowURL, windowName, windowFeatures ) {
		msg1=open( windowURL, windowName, windowFeatures ) ;
}

