function fenster(seite, weite, hoehe,name){ 
var mon, toppos, leftpos; 

toppos = (screen.height - hoehe)/2; 
leftpos = (screen.width - weite)/2; 
features = "scrollbars=1,location=0,toolbar=0,menubar=0,resizable=1,status=0"; 
mon = window.open(seite,"name","width="+weite+",height="+hoehe+",top="+toppos+",left="+leftpos+","+features); 
//mon.document.title=name;
mon.focus();
} 

function fenster1(seite, weite, hoehe, name){ 
var mon, toppos, leftpos; 

toppos = (screen.height - hoehe)/2; 
leftpos = (screen.width - weite)/2; 
features = "scrollbars=1,location=0,toolbar=0,menubar=0,resizable=1,status=0"; 
mon = window.open(seite,"name","width="+weite+",height="+hoehe+",top="+toppos+",left="+leftpos+","+features); 
mon.document.write('<head><title>'+name+'</title></head><body><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="middle"><img src='+seite+' width="'+eval(weite-40)+'"></td></tr></table></body>');
//mon.document.title=name;
mon.focus();
} 

function MM_displayStatusMsg(msgStr)
{ 
  status=msgStr;
  document.MM_returnValue = true;
}

function linkme(link){
  window.location.href = link;
}
function back(refer){
  if(typeof(document.referrer)!="undefined" && document.referrer.indexOf('http://www.stoffcorner.de/')>-1 ){
      window.location.href = document.referrer;
  }else{
      window.location.href=refer;
  }
}

function showAllFields(){
	for(i=1;i<9;i++){
		document.getElementById('tr_text'+i).style.display='';	
	}
}

function showFields(){
	for(i=1;i<9;i++){
		document.getElementById('tr_text'+i).style.display='';	
	}
	document.getElementById('preis').style.display='';
	document.getElementById('preis_text').style.display='none';
}

function hideAllFields(){
	for(i=1;i<9;i++){
		document.getElementById('tr_text'+i).style.display='none';	
	}
}

function hideFields(){
	for(i=1;i<9;i++){
		if(i!=7) document.getElementById('tr_text'+i).style.display='none';	
	}
	document.getElementById('preis').style.display='none';
	document.getElementById('preis_text').style.display='';
}

function checkSelection(){
	if(document.add2cart.insert_verarbeitungsart.options[document.add2cart.insert_verarbeitungsart.selectedIndex].value!="1" && document.add2cart.insert_file.value=="" && document.add2cart.insert_text.value==""){
		document.add2cart.insert_text.style.background="#EC0093";
		document.add2cart.insert_text.focus();
		alert("Bitte geben Sie den gewünschten Text ein!");
	}
	else document.add2cart.submit();
}

function getQueryVariable(variable) { 
  var query = window.location.search.substring(1); 
  var vars = query.split("&"); 
  for (var i=0;i<vars.length;i++) { 
    var pair = vars[i].split("="); 
    if (pair[0] == variable) { 
      return pair[1]; 
    } 
  } 
  return "";
}

function getOffer(){
	var angebot=getQueryVariable("angebot");
	if (angebot!="") document.formular.Bemerkung.value="Gewünschte Pauschale: "+urldecode(angebot);
}

function hinweis(lang){
	switch(lang){
		case("en"):
			alert("This page coming soon.");
			break;
		case("fr"):
			alert("Cette page est en construction.");
			break;
		case("it"):
			alert("Questa pagina è attualmente in costruzione.");
			break;
		case("nl"):
			alert("Deze pagina is in ontwikkeling.");
			break;
		default:
			alert("This page coming soon.");
		break;
	
	}
}
