var submitFormID = function(id,repl)
{


$(id).request(

 {   
  onComplete: function(r){ $(repl).innerHTML = r.responseText; }

 }

);
} 









	  function pageoffset()
	  {
	  var page = new Object();
	  page.scrollY = (window.pageYOffset ||document.documentElement.scrollTop  || document.body.scrollTop);
	  page.scrollX = (window.pageXOffse  || document.documentElement.scrollLeft || document.body.scrollLeft);
	  page.innerX =  (window.innerWidth  || document.documentElement.clientWidth || document.body.clientWidth);
	  page.innerY =  (window.innerHeight ||document.documentElement.clientHeight || document.body.clientHeight);
	  
      if(window.innerHeight) var scroll = 20; else var scroll = 0;
	  
	  page.absY = page.scrollY + page.innerY;
	  page.absX = page.scrollX + page.innerX -scroll;
	  return page;
	  }
	  


	  var adjust =    function(obj){
	  var p = pageoffset();
	  
	  obj.style.height = p.absY+'px';
	  obj.style.width =  p.absX+'px';
	  }
	  
	  	  var adjust2 =    function(obj){
	          var p = pageoffset();
	  
	          try
			  {
	          obj.style.left = (Math.round(p.innerX/2)-320)+'px';
			  obj.style.top = (Math.round(p.scrollY)+50)+'px';
			  }
			  catch(e){}
	  }
	  
	  
	  var setBG = function(clsn,url){
	  
	  if(document.getElementById('flash'))
	  document.getElementById('flash').style.display = 'none';
	  var body = document.getElementsByTagName('body')[0];
	  var div = document.createElement('div');
	  div.className = clsn;
	  div.id = 'cover';
	  p = pageoffset();
	
	  div.style.height = p.absY+'px';
	  div.style.width =  p.absX+'px';
	  
	  body.appendChild(div);
	  
	  var r = new Request();
	      r.sendRequest(url);
	  
	  
	  
	  
	  window.onresize = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
	  
	  window.onscroll = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
  
	  }



	  var setMailForm = function(clsn,url,md5){
	  
	  if(document.getElementById('flash'))
	  document.getElementById('flash').style.display = 'none';
	  var body = document.getElementsByTagName('body')[0];
	  var div = document.createElement('div');
	  div.className = clsn;
	  div.id = 'cover';
	  p = pageoffset();
	
	  div.style.height = p.absY+'px';
	  div.style.width =  p.absX+'px';
	  
	  body.appendChild(div);
	  
	  var r = new Request();
	      r.sendRequest(url+'?code='+md5);
	  
	  
	  
	  
	  window.onresize = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
	  
	  window.onscroll = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
  
	  }





	  
	  var setImage = function(clsn,url,img,w,h){
	  
	  if(document.getElementById('flash'))
	  document.getElementById('flash').style.display = 'none';
	  var body = document.getElementsByTagName('body')[0];
	  var div = document.createElement('div');
	  div.className = clsn;
	  div.id = 'cover';
	  p = pageoffset();
	
	  div.style.height = p.absY+'px';
	  div.style.width =  p.absX+'px';
	  
	  body.appendChild(div);
	  
	  var r = new Request();
	      r.sendRequest(url+'?image='+escape(img)+'&w='+w+'&h='+h);
	  
	  
	  
	  
	  window.onresize = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
	  
	  window.onscroll = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
  
	  }
	  
	  
	  
	  



var Request = function(){
	  
	  
	   this.sendRequest = function(url){
			
		var myXML = new Ajax.Request(
		
			url,
			{
			method: 'get',
			onComplete:this.getResponse,
			onFailure:this.showError
			}
		);
		}
		
		
		this.getResponse = function(r){
		
		  var body = document.getElementsByTagName('body')[0];
		  var div = document.createElement('div');
		      div.className = 'ajaxform';
			  div.id = 'coverform';
		  var p = pageoffset();
			  div.style.left = (Math.round(p.innerX/2)-320)+'px';
			  div.style.top = (Math.round(p.scrollY)+50)+'px';
		      div.innerHTML = r.responseText;
		      body.appendChild(div);
		
		  
		
		}
	  
	  
}




var rwinclose = function(){

if(document.getElementById('flash'))
document.getElementById('flash').style.display = 'block';
var body = document.getElementsByTagName('body')[0];
window.onresize = null;
window.onscroll = null;
body.removeChild($('cover'));
body.removeChild($('coverform'));
}




var showPrintVersion = function(obj,title){


var html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ';
html+= '"http://www.w3.org/TR/xhtml1/DTD/strict.dtd">';
html+= '<html xmlns="http://www.w3.org/1999/xhtml">';
html+= '   <head>';
html+= '      <title>';
html+= title;
html+= '      </title>';
html+= '<link rel="stylesheet"  href="http:\/\/ewebaskets.nvsolutions.de/css/print.css" />';
html+= '   </head>';
html+= '   <body>';
html+= obj.innerHTML;
html+= '<hr />&copy; www.ewe-baskets.de'
html+= '   </body>';
html+= '</html>';


var win = window.open('','','width=700,height=600,scrollbars=yes');
var d = win.document;
d.open();
d.write(html);
d.close();
//win.print();

}


		var submitAJAXRequest = function(f){
			
			
		
			var myXML = new Ajax.Request(
		
				f.getAttribute('action')+'?'+$(f.id).serialize()+'&location='+encodeURIComponent(self.location)+'&title='+encodeURIComponent(document.title),
				{
					method: 'get',
					onComplete:showResponse,
					onFailure:showError
				}
		
			);
			
		}
		
var showResponse = function(r)
{
	$('replace').innerHTML = r.responseText;
}

var showError = function()
{
	alert('Fehler');
}



	  var setDetailImage = function(image){
	  
	  var body = document.getElementsByTagName('body')[0];
	  var div = document.createElement('div');
          document.getElementById('flash').style.display = 'none';
	  div.className = 'coverbody';
	  div.id = 'cover';
	  p = pageoffset();
	
	  div.style.height = p.absY+'px';
	  div.style.width =  p.absX+'px';
	  
	  body.appendChild(div);
	  
	
	  
	  
	  	  	  var body = document.getElementsByTagName('body')[0];
		      var div2 = document.createElement('div');
		      div2.className = 'ajaxform';
			  div2.id = 'coverform';
			  
		      var p = pageoffset();
			  div2.style.left = (Math.round(p.innerX/2)-320)+'px';
			  div2.style.top = (Math.round(p.scrollY)+50)+'px';
		      div2.innerHTML = '<a href="javascript:rwinclose();" >[x]</a><br /><div class="diashow-detail"><div id="diashow-detail"><img src="'+image+'" /></div></div>';
		      body.appendChild(div2);
	  
	  
	  
	  
	  
	  
	  window.onresize = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
	  
	  window.onscroll = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
  
	  }