function MM_findObj(n, d) { 
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { 
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

function BImage (id, imageURL) {
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all) {
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' : 'url(' + imageURL + ')';
    document.all[id].style.visibility = 'visible';
  }
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}

function pageScroll() {
//window.scroll(0,230);
}

//for (i=0;i<=3;i++)  {
//window.scrollBy(0,59); // horizontal and vertical scroll increments
//}

var xmlhttp
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	   xmlhttp=false
	  }
	 }
	@else
	 xmlhttp=false
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	 try {
	  xmlhttp = new XMLHttpRequest();
	 } catch (e) {
	  xmlhttp=false
	 }
	}
	function myXMLHttpRequest() {
	  var xmlhttplocal;
	  try {
	    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	    xmlhttplocal=false;
	  }
	 }

	if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
	 try {
	  var xmlhttplocal = new XMLHttpRequest();
	 } catch (e) {
	  var xmlhttplocal=false;
	  alert('couldn\'t create xmlhttp object');
	 }
	}
	return(xmlhttplocal);
}

function penny(ale, her, dam, jun, mad, wgr, kat, order, prs, wei, typ) {
	var theUL = document.getElementById('prod_desc'); // the UL	
	theUL.innerHTML = '<div class="loading"><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><img src="http://www.brookssports.de/images/b2b/loading.gif" /></div>';	
	
	//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	var parameters = "alle="+ale+"&herren="+her+"&damen="+dam+"&jungen="+jun+"&maedchen="+mad+"&order="+order+""+wgr+""+prs+""+kat+""+wei+""+typ;
	xmlhttp.open("POST", '../../../penny_ajax.php', true);
	//Send the proper header information along with the request
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp.setRequestHeader("Content-length", parameters.length);
	xmlhttp.setRequestHeader("Connection", "close");
    xmlhttp.send(parameters);	
	var go = eval("handleResponse('"+ale+"')"); 
	//xmlhttp.onreadystatechange = setTimeout("handleResponse('"+adu+"')", 400);	
		
	setTimeout("FancyForm.start( $$('#content #penny input') )", 400);	
}


function handleResponse(Artnr) {
  if(xmlhttp.readyState == 4){ 
		if (xmlhttp.status == 200){
        var response = xmlhttp.responseText;    
            update = response;
            changeText(Artnr, update); 	
		}
    }
	else{ setTimeout( 'handleResponse(\"'+Artnr+'\")', 200); 
	      setTimeout("FancyForm.start( $$('#content #penny input') )", 200);
    }
		//window.scroll(0,230);
}


function changeText( div2show, text ) {
	div2show ="prod_desc";
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0; 
    if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"
    if (DOM) {
        var viewer = document.getElementById(div2show);
        viewer.innerHTML = text;
    }  else if(IE) {
		document.getElementById(div2show).innerHTML = text;
        document.all[div2show].innerHTML = text;
    }
}