function $(id) { 
    return document.getElementById(id); 
} 

function merkListe(){
	
	document.art2cart.angebot_erstellen.value="true";
	document.art2cart.submit();
}

function einBlenden(a) {
	$(a).style.display = "block";
}
function ausBlenden(a) {
	$(a).style.display = "none";
}

function borderIn(id) {
	$(id).style.border="1px solid #333333";
}

function borderOut(id) {
	$(id).style.border="1px dotted #CCCCCC";
}

function seiteDrucken(id) { 
  var set="toolbar=no,location=no,directories=no,menubar=yes,"; 
      set+="scrollbars=yes,width=690, height=600, left=100, top=25"; 
 //alert('m');
      var contentvalue = $(id).innerHTML; 
  //contentvalue = contentvalue + $("anzeige").innerHTML; 
  
  
  var docprint=window.open("","",set); 
   docprint.document.open(); 
   docprint.document.write('<html><head><style>body{color:#000000; font-family:arial; font-size:12px;} .r{float:right;} .no{display:none;} .text1{float:right;}</style><title>Druckansicht</title>'); 
   docprint.document.write('</head><body onLoad="self.print()">');          
   docprint.document.write(contentvalue);          
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}


// mit diesen Funktionen fing alles an !!! Sind nur noch aus nostalgischen Gründen im Quelltext werden seit 0.0.4 nicht mehr gebraucht
function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}

function FensterOeffnen (Adresse) {
  MeinFenster = window.open(Adresse, "Preisliste", "toolbar=no,width=500,height=400,resizable=no,scrollbars=yes,titlebar=no");
  MeinFenster.focus();
}

function bookmarksite(title,url){
  if(document.all)window.external.AddFavorite(url, title);
  else if(window.sidebar)window.sidebar.addPanel(title, url, "") }

//window.defaultStatus = "";

function openUp (Adresse) {
  x = screen.availWidth/2-300/2;
  y = screen.availHeight/2-400/2;
  MeinFenster = window.open(Adresse, '', 'width=300,height=400,scrollbars=yes,left='+x+',top='+y+',screenX='+x+',screenY='+y );
  MeinFenster.focus();
}


function doReq(b,c) { 
    //alert(b);
    var buttonZur = "<a href='' onclick=\"recoverContent('"+ c +"');return false;\">zur&uuml;ck</a>";
    
    grabContent(c);
    var xmlhttp = null; 
    // Mozilla 
    if (window.XMLHttpRequest) { 
        xmlhttp = new XMLHttpRequest(); 
    } 
    // IE 
    else if (window.ActiveXObject) { 
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    
    xmlhttp.open("GET", '' + b + '' , true); 
    xmlhttp.onreadystatechange = function() { 
        if(xmlhttp.readyState != 4) { 
            $(c).innerHTML = 'Seite wird geladen ...'; 
        } 
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
            $(c).innerHTML = xmlhttp.responseText + buttonZur ; 
        }
    }
   xmlhttp.send(null); 
}

var gCi ="";
var gcc = -1 ;

function grabContent (a){
	if ( gcc == -1 ) {
	gCi = $(a).innerHTML;
	gcc = gcc * -1;
	}
}

function recoverContent (a){
	$(a).innerHTML = gCi;
}
