



var button_gear_flag=0;
var button_team_flag=0;
var button_news_flag=0;
var button_product_flag=0;
var button_company_flag=0;
var button_legal_flag=0;
var button_login_flag=0;
var isIE = false;
if (navigator.appName != "Netscape")
  isIE=true;
function siteAlertFrame()
{ siteAlertDone();
  resetSiteAlertFunction();
}
function siteAlertDone()
{ 
}
function resetSiteAlertFunction(){
   window['siteAlertDone']= function(){void(0);}
} 
function popup (comp,popupdiv,scontent,x,y)
{ pdiv=document.getElementById(popupdiv);
  if (pdiv!=null) 
  { pdiv.innerHTML='<table class="popuptable" border="0" bgcolor="#888888" cellpadding="3" cellspacing="1" width="100%"><tr><td height="1" bgcolor="#FFFEE4" valign="top">'+scontent+
    '</table>';
    var curleft = curtop = 0;
    lastcomp=comp;
    if (comp.offsetParent)
   { do
       { curleft += comp.offsetLeft;
	    curtop += comp.offsetTop;
      } while (comp = comp.offsetParent);
    }
    if (x!=null&&y!=null )
    { curleft+=x;
    	curtop+=y;
    } else
    { curleft-=200;
    	curtop+=0;
    }
    pdiv.style.top=curtop+"px";
    pdiv.style.top=curtop+"px";
  	 pdiv.style.left=curleft+"px";
    pdiv.style.display="block";
  }
}
function changebg(comp,imgsrc)
{ if (comp.style.backgroundImage!='url('+imgsrc+')')
  { comp.style.backgroundImage ='url('+imgsrc+')';
 }
  return 0;
}
function isDefined(object, variable)
{ if (typeof(object) == 'undefined') 
    return false;
  return true;
}
function posDiv (companc,comp,x,y)
{ anchestor=document.getElementById(companc);
  comp=document.getElementById(comp);
  if (comp!=null &&anchestor!=null ) 
  { var curleft = curtop = 0;
    lastcomp=anchestor;
    if (anchestor.offsetParent)
   { do
       { curleft += anchestor.offsetLeft;
	    curtop += anchestor.offsetTop;
      } while (anchestor = anchestor.offsetParent);
    }
    if (x!=null&&y!=null )
    { curleft+=x;
    	curtop+=y;
    } else
    { curleft-=200;
    	curtop+=0;
    }
    comp.style.top=curtop+"px";
    comp.style.top=curtop+"px";
    comp.style.left=curleft+"px";
  }
}
function sdiv(divname)
{ if ( document.getElementById(divname)!=null)
   document.getElementById(divname).style.display='block';
 //else 
   //alert('error sdiv '+divname);	
}
function setDivPos(divname,x,y)
{ if ( document.getElementById(divname)!=null)
  { document.getElementById(divname).style.left=x+'px';
    document.getElementById(divname).style.top=y+'px';
  } //else 
   //alert('error sdiv '+divname);	
}
function hdiv(divname)
{ if ( document.getElementById(divname)!=null)
   document.getElementById(divname).style.display='none';
  //else 
   //alert('error hdiv '+divname);	
}
function movedivz(divname,newz)
{ if ( document.getElementById(divname)!=null)
   document.getElementById(divname).style.zIndex=newz;
  //else 
  // alert('error movedivz '+divname);	
}
function getdivz(divname)
{ if ( document.getElementById(divname)!=null)
    return document.getElementById(divname).style.zIndex;
  //else 
  // alert('error getdivz '+divname);	
}
function isdivVis(divname)
{ if ( document.getElementById(divname)!=null)
    return document.getElementById(divname).style.display!='none';
  //else 
  // alert('error isdivVis '+divname);	
}
function existsDiv(divname)
{ return document.getElementById(divname)!=null
}
function getDiv(divname)
{ return document.getElementById(divname)
}
function setDivC(divname,content)
{ if ( document.getElementById(divname)!=null)
   document.getElementById(divname).innerHTML=content;
  //else 
   //alert('error setting div content '+divname);	
}
function n2c(number)
{ ret="";
  ret=ret+String.fromCharCode(number);
  return ret;
}
function checkmail(s)
{ 
  var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }
 if(a == true)
 {
  reg = new RegExp(n2c(94)+'([a-zA-Z0-9\-\.\_]+)'+
                   '(\@)([a-zA-Z0-9\-\.]+)'+
                   '(\.)([a-zA-Z]{2,4})$');
  res = (reg.test(s));
 }
 else
 {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5);
 }
 return(res);
}
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
function checkup_date(csrc)
{ allowedc="0123456789.";
  var src=csrc;	 
  var fields=src.split('.');
  if (fields.length!=3)
  { 
  } if(fields.length==3 && (fields[0].length==2||fields[0].length==1)&& (fields[1].length==2 ||fields[1].length==1) && fields[2].length==4)
  { source_date = new Date(fields[2],fields[1]-1,fields[0]);
    if(fields[2] != source_date.getFullYear())
    { return 1;
    }
    if(fields[1]-1 != source_date.getMonth())
    {  return 1;
    }
    if(fields[0] != source_date.getDate())
    {  return 1;
    }
    return 0;
  } else
  { 
  }
  return 1;
}
function dAlign(target,scomp,x,y)
{ pdiv=document.getElementById(target);
  comp=document.getElementById(scomp);
  if (pdiv!=null) 
  { 
    var curleft = curtop = 0;
    lastcomp=comp;
    if (comp.offsetParent)
   { do
       { curleft += comp.offsetLeft;
	    curtop += comp.offsetTop;
      } while (comp = comp.offsetParent);
    }
    if (x!=null&&y!=null )
    { curleft+=x;
    	curtop+=y;
    } else
    { curleft-=200;
    	curtop+=0;
    }
    pdiv.style.top=curtop+"px";
    pdiv.style.top=curtop+"px";
  	 pdiv.style.left=curleft+"px";
    pdiv.style.display="block";
  }
}
function Browser() {
  var ua, s, i;
  this.isIE    = false;
  this.isNS    = false;
  this.version = null;
  ua = navigator.userAgent;
  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
  // Treat any other "Gecko" browser as NS 6.1.
  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}
var browser = new Browser();
// Global object to hold drag information.
var dragObj = new Object();
// Global object to hold drag information.
var dragObj = new Object();
function dragStart(event, id) {
  var el;
  var x, y;
  // If an element id was given, find it. Otherwise use the element being
  // clicked on.
  var container=document.getElementById(id);
  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;
    // If this is a text node, use its parent element.
    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }
  // Get cursor position with respect to the page.
  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX ;//+ window.scrollX;
    y = event.clientY ;//+ window.scrollY;
  }
  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.offsetLeft, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.offsetTop,  10);
  //dragObj.elStartLeft  = dragObj.elNode.style.left;
  //dragObj.elStartTop   = dragObj.elNode.style.top;
  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;
  // Update element's z-index.
  //dragObj.elNode.style.zIndex = ++dragObj.zIndex;
  // Capture mousemove and mouseup events on the page.
  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}
function dragGo(event) {
  var x, y;
  // Get cursor position with respect to the page.
  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
     + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
     + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX ;//+ window.scrollX;
    y = event.clientY ;//+ window.scrollY;
  }
  // Move drag element by the same amount the cursor has moved.
  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";
  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}
function dragStop(event) {
  // Clear the drag element global.
  dragObj.elNode = null;
  // Stop capturing mousemove and mouseup events.
  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}
function change(imgname,imgsrc)
{ if ( document.getElementById(imgname)!=null)
    return document.getElementById(imgname).src=imgsrc;
  else 
   alert('error change '+imgname);
  return 0;
}
var xmlDoc;
var xmlDoc1;
var xmlDoc2;
var htmlDoc;
var htmlDoc1;
var htmlDoc2;
function requestXMLFrom(adress,funcname,retid)
{ var req = null;
  if (retid==null || retid=="")
    retid=0;
  try
  { req = new XMLHttpRequest();
  }
  catch (ms)
  { try
    { req = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (nonms)
    { try
      { req = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (failed)
      { req = null;
      }
    }  
  }
  if (req == null)
  alert("Error creating request object!");
   sdiv('waiting');
  //anfrage erstellen (GET, url ist localhost,
  //request ist asynchron      
  req.open("GET",adress, true);
  req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8;");
  //req.setRequestHeader("charset", "latin1");
  req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  req.onreadystatechange = function()
  { 
    switch(req.readyState) 
    { case 4: if(req.status!=200) 
              { //alert("Fehler: "+req.status+" "+adress+" "+" "+req.responseText); 
              } else
              {  
                switch (retid)
                { case 0 : xmlDoc=req.responseXML;	
                           htmlDoc=req.responseText;	
                           break;
                  case 1 : xmlDoc1=req.responseXML;	
                           htmlDoc1=req.responseText;	
                           break;
                  case 2 : xmlDoc2=req.responseXML;	
                           htmlDoc2=req.responseText;	
                           break;
                }if (funcname.length==0)
                {	
                } else if (funcname.indexOf("(")>=0)
                { eval (funcname);
                } else
                { eval (funcname+"();");
                }
              }
              window.setTimeout("hdiv('waiting');",250);
              break;
      default: window.setTimeout("hdiv('waiting');",250); return false;
               break;     
    }
  };
  req.send(null);
}
function postXMLFrom(adress,parameters, funcname,retid)
{ var preq = null;
   if (retid==null || retid=="")
    retid=0;
  try
  { preq = new XMLHttpRequest();
  }
  catch (ms)
  { try
    { preq = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (nonms)
    { try
      { preq = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (failed)
      { preq = null;
      }
    }  
  }
  if (preq == null)
  alert("Error creating request object!");
  sdiv('waiting');
  //anfrage erstellen (GET, url ist localhost,
  //request ist asynchron      
   preq.open("POST",adress, true);
   preq.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8;");
   preq.setRequestHeader("Content-length", parameters.length);
   //preq.setRequestHeader("charset", "latin1");
   preq.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
   preq.setRequestHeader("Connection", "close");
  //Beim abschliessen des request wird diese Funktion ausgef&uuml;hrt
  preq.onreadystatechange = function()
  { switch(preq.readyState) 
    { case 4: if(preq.status!=200) 
              { alert("Fehler: "+preq.status+" "+adress+" "+" "+preq.responseText+" / "+preq.responseXML); 
              } else
              {  switch (retid)
                { case 0 : xmlDoc=preq.responseXML;	
                           htmlDoc=preq.responseText;	
                           break;
                  case 1 : xmlDoc1=preq.responseXML;	
                           htmlDoc1=preq.responseText;	
                           break;
                  case 2 : xmlDoc2=preq.responseXML;	
                           htmlDoc2=preq.responseText;	
                           break;
                }if (funcname.length==0)
                {	
                } else if (funcname.indexOf("(")>=0)
                { eval (funcname);
                } else
                { eval (funcname+"();");
                }
              }
              window.setTimeout("hdiv('waiting');",250);
              break;
      default: window.setTimeout("hdiv('waiting');",250);
               return false;
               break;     
    }
  };
  preq.send(parameters);
}
function buttonVslid(id,offset)
{ backpos=$(id).css('background-position');
  $(id).css('top',offset+'px');
  //alert(x+' '+offset+'px');	
}
function createVslidButton(slidid,w1,h1,xofs,image,text,css1,linked,js)
{ overadd="";
  outadd="";
  downadd="";
  upadd="";
  if (linked!="")
  { outadd="buttonVslid('#"+linked+"',-"+0+");";
    overadd="buttonVslid('#"+linked+"',-"+h1+");";
    downadd="buttonVslid('#"+linked+"',-"+(h1*2)+");";
    upadd="buttonVslid('#"+linked+"',-"+(h1)+");";
  }
  document.write('<div onmousedown="buttonVslid(\'#'+slidid+'\',-'+(h1*2)+'); '+downadd+'" onmouseup="buttonVslid(\'#'+slidid+'\',-'+(h1)+'); '+upadd+'" '+
                 'onmouseover="$(\'#'+slidid+'_text\').css(\'color\',\'#ffffff\'); $(\'#'+slidid+'_link\').css(\'color\',\'#ffffff\'); buttonVslid(\'#'+slidid+'\',-'+h1+'); '+overadd+'" '+
                 'onmouseout="$(\'#'+slidid+'_text\').css(\'color\',\'#888888\'); $(\'#'+slidid+'_link\').css(\'color\',\'#888888\');  buttonVslid(\'#'+slidid+'\',-'+00+');'+outadd+'" '+
                 'style="float:left; width:'+w1+'px; overflow:hidden; height:'+h1+'px; cursor:pointer; '+css1+'" onclick="'+js+'">'+
                 '<div id="'+slidid+'" style="position:relative; top:0px;left:-'+xofs+'px; background:url('+image+'); background-repeat:no-repeat; width:500px; height:500px;" '+
                 'onmouseover="$(\'#'+slidid+'_text\').css(\'color\',\'#ffffff\');" '+
                 '></div>'+
                 '<div id="'+slidid+'_text" style="position:relative; left:0px; top:-'+500+'px; width:100%; height:'+h1+'px; text-align:center;" '+
                 'onmouseover="$(\'#'+slidid+'_text\').css(\'color\',\'#ffffff\');" '+
                 '>'+text+'</div>'+
                 '</div>'+
                 ''+
                 '');
}
function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
function callExternalInterface() {
	thisMovie("teaser_main").getSW(1);
}
function thisMovie(movieName) {
}
var atHome=0;
function searchCheck () {
  { if (products_showed==0)
    { $('#cid').val('');
      $('#sfpc').val('TSG_OVERVIEW');
      document.getElementById('filter').submit();
    }
    else if (document.getElementById('gridline')!=null)
    {   updateGridLine();  }
    else if (document.getElementById('filterpanel')!=null)
    {   updateOverview();  }
    else
    {  alert(3);
       document.location.href='/index.php?sfpc=TSG_OVERVIEW'+passfilter();
    }
  } 
  enableGear(0);
  return false;
}
function changeIdImg(compname,imgsrc)
{ var comp=document.getElementById(compname);
  if (comp!=null )
  { comp.style.background='url('+imgsrc+')';
  } else
  alert('');
  return 0;
}
function enableGear(mode)
{ if (mode==1)
  { document.getElementById('button_gear').style.backgroundImage='url('+img_path+'n_main_but1.png)';
    document.getElementById('button_gear_link').style.color='#ffffff';
    if ($('#tsg_mainsubMenu').css('display')=='none') $('#tsg_mainsubMenu').fadeIn(250);
    document.getElementById('tsg_mainsubMenu').title='';
  } else if (mode==0)
  { document.getElementById('tsg_mainsubMenu').title='close';
    window.setTimeout('enableGear(2);',1000);
  } else
  { if ($("#tsg_mainsubMenu").attr("title")=="close")
    { document.getElementById('button_gear').style.backgroundImage='url('+img_path+'n_main_but0.png)';
      document.getElementById('button_gear_link').style.color='#666666';
    }
    divClose("#tsg_mainsubMenu");
  }
 if (button_gear_flag==1)
  { $("#button_gear").css('background','url(tsg_images/n_main_but1.png)');
    $("#button_gear_link").css('color','#ffffff');
 }
}
function enableTeam(mode)
{ if (mode==1)
  { document.getElementById('button_team').style.backgroundImage='url('+img_path+'n_main_but1.png)';
    document.getElementById('button_team_link').style.color='#ffffff';
    if ($('#tsg_teamSubMenu').css('display')=='none') $('#tsg_teamSubMenu').fadeIn(250);
    document.getElementById('tsg_teamSubMenu').title='';
  } else if (mode==0)
  { doclose=1;
    document.getElementById('tsg_teamSubMenu').title='close';
    window.setTimeout('enableTeam(2);',1000);
  } else
  { if ($("#tsg_teamSubMenu").attr("title")=="close")
    { document.getElementById('button_team').style.backgroundImage='url('+img_path+'n_main_but0.png)';
      document.getElementById('button_team_link').style.color='#666666';
    }
    divClose("#tsg_teamSubMenu");
  }
  if (button_team_flag==1)
  { $("#button_team").css('background','url(tsg_images/n_main_but1.png)');
    $("#button_team_link").css('color','#ffffff');
 }
}
function divClose(windowDef)
{ if ($(windowDef).attr("title")=="close")
  { if ($(windowDef).css('display')!='none') $(windowDef).fadeOut(250);
  }
}
var doclose=0;
var doclose2=0;
var doclose3=0;
function flipfilter()
{ if ($('#filterpanel').css('display')=='none') 
  { $('#filterpanel').slideDown('slow'); 
    if (document.filter.filterpanel!=null)	
      document.filter.filterpanel.value="block";
  }else 
  { $('#filterpanel').slideUp('slow');
    if (document.filter.filterpanel!=null)	
      document.filter.filterpanel.value="none";		 
  }
}
function prepare_reg() 
{ $('#reg_name').defaultValue('your first name');
  $('#reg_surname').defaultValue('your surname');
  $('#reg_email').defaultValue('your email');
  $('#reg_pass1').defaultValue('password');
  $('#reg_pass2').defaultValue('password repeat');
  $('#reg_land').defaultValue('your country eg. US');
  $('#reg_country').defaultValue('your state eg. bavaria');
  $('#reg_city').defaultValue('your city');
  $('#reg_postal').defaultValue('your postal code');
  $('#reg_street').defaultValue('your street and number');
  Recaptcha.create("6Le4-ggAAAAAAA1gDmD4SEua0ZC3QsLWivX08UPp",
   "recaptcha_div", {
   theme: "blackglass",
   callback: Recaptcha.focus_response_field
  });
}
function afterListDelete()
{ sitealert("Info",htmlDoc);
   if (document.getElementById('content_title').innerHTML=="WISHLIST")
    openWishlist();
  else  if (document.getElementById('content_title').innerHTML=="CART")
    openCart();
  refreshnavi();
}
function setFilter(tags,model,pbp)
{ list=tags.split(";");
  resetWeltFilter(1);
  resetCatFilter(1);
  if (isDefined(model))
  { document.filter.search.value=model;
    if (model!="")
       menucall=1;
  } else
  {  document.filter.search.value="";
  }
  if (isDefined(pbp))
  { document.filter.pbp.value=pbp;
    document.filter.dsid.value='';	
  }
  for (i=0;i<list.length;i++)
  { if (list[i].indexOf('gender')==0)
      flipfn(list[i],1);
    else if (list[i].indexOf('cat')==0)
      flipfn(list[i],1);
    else if (list[i].indexOf('sw')==0)
      flipfn(list[i],1);
  }
  UpdateGrid();
  enableGear(0);
}
function setFilterGotoGear(tags,model,pbp)
{ list=tags.split(";");
  resetWeltFilter(1);
  resetCatFilter(1);
  if (isDefined(model))
  {   document.filter.search.value=model;
  } else
  {  document.filter.search.value="";
  }
  if (isDefined(pbp))
    document.filter.pbp.value=pbp;
  for (i=0;i<list.length;i++)
  { if (list[i].indexOf('gender')==0)
      flipf(list[i],(1));
    else if (list[i].indexOf('cat')==0)
      flipf(list[i],(1));
    else if (list[i].indexOf('sw')==0)
      flipf(list[i],(1));
  }
  enableGear(0);
  document.filter.sfpc.value='TSG_Gear';
  document.filter.submit();
}
function afterListClick(id,openId)
{ //$("#blend0").fadeOut(250);;
  if (typeof(reloadGrid)=="function") 
    requestXMLFrom('/index.php?sfpc=DATA_gridline&formfunc=getGridLine&dsid=id'+passfilter(),'reloadGrid('+id+')');
  else
   document.location.href="/index.php?sfpc=TSG_GEAR&dsid="+id+"&id="+openId;
}
function moveToCart(order)
{ sitealert("MoveToCart",htmlDoc);
  openWishlist(order);
  refreshnavi();
  window.setTimeout("$('#blend').fadeOut(250)",1000);	 
}
function refreshLogin()
{ requestXMLFrom('/index.php?sfpc=NAVI_DYNAMIC', 'setDivC("dynamic_navi",htmlDoc1);',1);
}
function doLogin()
{ username= $('#mainloginname').val();
  password= $('#mainloginpassword').val();
  cook= $('#maincook').val();
  protocol= window.location.protocol;
  host= window.location.host;
  pathname= window.location.pathname;
  requestXMLFrom('/index.php?sfpc=contentPort&formfunc=getUsername&username='+username+'&password='+password+'&login=yes&cook='+cook, 'sitealert("LOGIN",htmlDoc); if (htmlDoc.indexOf("Login failed")==0) window.setTimeout("openLogin()",1500); else refreshDynaNavi();');
  //requestXMLFrom('/index.php?sfpc=NAVI_DYNAMIC', 'setDivC("dynamic_navi",htmlDoc1);',1);
  if ($('#movecart_on_login').val()==1) 
  { window.setTimeout(" if ($('#loginflag').val()==1) requestXMLFrom('/index.php?sfpc=contentPort&formfunc=moveCartContents', ' refreshDynaNavi(); ')",1500);
  }
  closeWindow();	
}
function doLogout()
{ requestXMLFrom('/index.php?logout=true', '',1);
  window.setTimeout('refreshLogin()',250);
  closeWindow();
  sitealert("LOGOUT",'you logged out, thanks for the visit');
}
function moveToWishlist(order)
{ sitealert("MoveToWishlist",htmlDoc);
  openCart(order);
  refreshnavi();
  window.setTimeout("$('#blend').fadeOut(250)",1000);	 
}
function openWishlist(order)
{ requestXMLFrom('/index.php?sfpc=ContentPort&formfunc=showWishlist&order='+order+'&random='+new Date().getTime(),' siteContent("WISHLIST",htmlDoc);');
}
function afterRegister()
{ 
  if (htmlDoc.indexOf("recapcha is wrong")==0)
  { Recaptcha.reload();
  } else if (htmlDoc.indexOf("creation succeed")>=0)
  { closeWindow();
    sitealert('Register',"Your registration was successful. Please check your emails to activate your account.");
  } else
  { sitealert('Register',htmlDoc);
  }	 
}
function addToCart(id)
{ 
  sitealert('AddToCart','Article has heen added to your cart');
  openCart();
  refreshnavi();	
  window.setTimeout("refreshLogin();",500);	 
  window.setTimeout("$('#blend').fadeOut(250)",1000);	 
}
function openProfile(mode)
{ if (mode!= 0 &&mode!= 1 &&mode!= 2)
     mode=1;
  requestXMLFrom('/index.php?sfpc=switch_profile&formfunc=showProfile&addrpage='+$('#addrpage').val()+'&random='+new Date().getTime(),'actual_slide=1; openProfile2(); buttonVslid("#profile_t1",-22); '+"doProfileWarp("+mode+"); profile_changing=0; "+'  ');
}
function openProfile2(rules)
{ siteContent("PROFILE",htmlDoc);
  if (document.getElementById('recaptcha_div')!=null)
    prepare_reg(); 
  if (document.getElementById('show_addrpage')!=null)
   setDivC('show_addrpage',(parseInt($('#addrpage').val())+parseInt(1))+"")
}
function openCart(order)
{ requestXMLFrom('/index.php?sfpc=ContentPort&formfunc=openCart&order='+order+'&random='+new Date().getTime(),'siteContent("CART",htmlDoc);');
}
function openCheckout()
{ openCheckoutWindow();
}
function setDefaultsForCheckout()
{ $('#cartloginname').defaultValue('username');
  $('#cartloginpassword').defaultValue('password');
  $('#ba_name').defaultValue('name');
  $('#ba_surname').defaultValue('surname');
  $('#ba_email').defaultValue('email');
  $('#ba_phone').defaultValue('phone');
  $('#ba_land').defaultValue('country, use \'US\' for \'USA\'');
  $('#ba_country').defaultValue('state');
  $('#ba_postal').defaultValue('postal');
  $('#ba_city').defaultValue('city');
  $('#ba_street').defaultValue('street');
  $('#sa_name').defaultValue('name');
  $('#sa_surname').defaultValue('surname');
  $('#sa_land').defaultValue('country, use \'US\' for \'USA\'');
  $('#sa_country').defaultValue('state');
  $('#sa_postal').defaultValue('postal');
  $('#sa_city').defaultValue('city');
  $('#sa_street').defaultValue('street');
  $('#coupon').defaultValue('enter a coupon number if available');
}
function openLogin()
{ closeWindow();
  closeWindow();
  requestXMLFrom('/index.php?sfpc=form_login&random='+new Date().getTime(),'openLogin2()');
}
function refreshnavi()
{ requestXMLFrom('/index.php?sfpc=navi_dynamic&random='+new Date().getTime(),'setDivC("dynamic_navi",htmlDoc);');
}
function openLogin2()
{ loginContent("LOGIN",htmlDoc);
  $("#mainloginname").defaultValue('username');
  $("#mainloginpassword").defaultValue('password');
}
var accountpage=0;
var profile_changing=0;
function askfor(name,olddata,divtarget)
{ setDivC(divtarget,'<input type="text" class="tsg_input_textline_white" id="new_data" value="'+olddata+'" onblur="postXMLFrom(\'index.php\',\'sfpc=ContentPort&formfunc=updatePersonal&addrpage=\'+$(\'#addrpage\').val()+\'&field='+name+'&newdata=\'+encodeURI($(\'#new_data\').val())+\'\',\' openProfile('+actual_slide+');\');">');
  profile_changing=1;
  $(".countrycontrol").fadeOut(250);
  $("#new_data").focus();
}
var actual_slide=1;
function doAddfunction( id)
{  switch(id)
  { case 0: break;
	case 1: doCheckoutSlid(2); setDivC('checkout_continue_button_title','CONTINUE'); if ($('#loginflag').val()==1)  $('#CHECK_OK').fadeIn('250'); setDivC('checkout_add_button_title','BACK'); break;break;
	case 2: doCheckoutSlid(0); if ($('#loginflag').val()==1)  $('#CHECK_OK').fadeOut('250'); break;
	case 3: doCheckoutSlid(2); break
	case 4: if ($('#skipShip').val()  != 1)
                  { doCheckoutSlid(2);
                    id=2;
                  } else
                   doCheckoutSlid(3); break;
	case 5: doCheckoutSlid(4); break;case 6: setDivC('checkout_continue_button_title','BACK'); $('#CHECK_ADD').fadeIn('250'); setDivC('checkout_add_button_title','CHECKOUT'); 
 	case 6: doCheckoutSlid(5); break;case 6: setDivC('checkout_continue_button_title','BACK'); $('#CHECK_ADD').fadeIn('250'); setDivC('checkout_add_button_title','CHECKOUT'); 
	default : break;
  }
}
function refreshDynaNavi ()
{ requestXMLFrom('/index.php?sfpc=NAVI_DYNAMIC', 'setDivC("dynamic_navi",htmlDoc1); ',1);
}
function doCheckoutSlid( id)
{ 
  doslid=1;
  newslide=id;
  username= $('#cartloginname').val();
  password= $('#cartloginpassword').val();
  //if (''=='felix2')
    $('#pay3').removeAttr('disabled');
  cook= $('#cook').val();
  buttonVslid('#but_co_add1',0);
  buttonVslid('#but_co_add',0);
  switch(id)
  { case 0: id=1; $('#CHECK_ADD').fadeIn('250'); setDivC('checkout_continue_button_title','SIGN IN');  setDivC('checkout_add_button_title','CONTINUE'); break;
	case 1: requestXMLFrom('/index.php?sfpc=contentPort&formfunc=getUsername&username='+username+'&password='+password+'&login=yes&cook='+cook, 'sitealert("LOGIN",htmlDoc); ');
                  requestXMLFrom('/index.php?sfpc=NAVI_DYNAMIC', 'setDivC("dynamic_navi",htmlDoc1); openCheckout();',1);
                  window.setTimeout(" if ($('#loginflag').val()==1) requestXMLFrom('/index.php?sfpc=contentPort&formfunc=moveCartContents', 'sitealert(\\'CARTMOVE\\',htmlDoc); refreshDynaNavi();')",500);
	case 2: $('#CHECK_ADD').fadeIn('250'); 
                  setDivC('checkout_continue_button_title','CONTINUE');  
                  setDivC('checkout_add_button_title','BACK'); break;
	case 3: if (checkGuestFields ()>0)
                  { sitealert("BILLING ADRESS","Please enter all needed information");
                    doslid=0; 
                  } else  if ($('#userland_short').val()=="00" || $('#userland_short').val()=="0" )
                  { sitealert("BILLING ADRESS","Please enter a valid country");
                    doslid=0; 
                  } else 
                  { setDivC('checkout_continue_button_title','CONTINUE'); setDivC('checkout_add_button_title','BACK');
                  }
                  if ($('#skipShip').val() != 1)
                  { id=4;
                    newslide=id;
                  } 
                  break;
	case 4: if (checkGuestFields2 ()>0  && $('#skipShip').val() == 1)
                  { 
                    sitealert("DELIVERY ADRESS","Please enter all needed information");
                    doslid=0; 
                  } else  if (($('#deliveryland_short').val()=="00" || $('#deliveryland_short').val()=="0" )& $('#skipShip').val() == 1 )
                  { 
                    sitealert("BILLING ADRESS","Please enter a valid country");
                    doslid=0; 
                  }  else
                    setDivC('checkout_continue_button_title','CONTINUE'); setDivC('checkout_add_button_title','BACK'); break;
	case 5: setDivC('checkout_continue_button_title','CONTINUE'); setDivC('checkout_add_button_title','BACK'); break;
                  break;
	case 6: if ($("#loginflag").val()==0)
                  { printBAdress();
                    if ($('#skipShip').val() == 1) 
                      printSAdress();
                    else
                      setDivC("adress_ship","");
                  } else
                  { requestXMLFrom('/index.php?sfpc=contentPort&formfunc=getBillingAdress', 'setDivC("adress_bill",htmlDoc); ');
                    if ($('#skipShip').val() == 1) 
                      printSAdress();
                    else
                      setDivC("adress_ship","");
                  }
                  requestXMLFrom("/index.php?sfpc=contentPort&formfunc=getCartSummary"+
                                    "&address="+($('#skipShip').val() == 1?$("#addrpage").val():-1)+
                                    "&sa_land="+$('#sa_land').val()+
                                    "&ba_land="+$('#ba_land').val()+
                                    "&short="+sshort , 
                                    'setDivC("cart_summary",htmlDoc2); ',2);
                  printPayment();
                  printShipping();
                  setDivC('checkout_continue_button_title','DO CHECKOUT NOW');
                  hdiv('creditcheck');
                  break;
	case 7: if ($('#TCAccept:checked').val()!=1)
                  { sitealert('Terms&Conditions','You must accept Terms and Conditions before checking out.');
                  } else if ($('#checkoutPaymentType').val()==2 && $('#checkoutPaymentChecked').val()!="success" && $('#creditcheck').is(':visible'))
                  { sitealert('CreditCard','Still waiting for Payment, stop Paymentmode first by clicking STOP.');
                  } else if ($('#checkoutPaymentType').val()==2 && $('#checkoutPaymentChecked').val()!="success" )
                  { openPopupWindow('/index.php?sfpc=CREDIT_CARD_TALK','CreditCard Payment');
                    sdiv('creditcheck');
                     //sitealert('CreditCard','Please wait while checking for Credit Card payment. This window will close automatically when done or cancelled.<br><br>Please enter all needed data in the desired creditcard popup.');
	          waitForPayment();
	          doslid=0;
                  } else if ($("#loginflag").val()==0)// && ''!='felix2')
                  { requestXMLFrom('/index.php?sfpc=contentPort&formfunc=doShopGuest'+
                        '&payment='+$("#checkoutPaymentType").val()+
                        '&ship_avail='+$("#ship_avail").val()+
                        '&shipment='+$("#checkoutShippingType").val()+
                        '&address='+($('#skipShip').val() == 1?1:-1)+
                        '&ship_avail='+$("#ship_avail").val()+
                        '&ba_name='+$("#ba_name").val()+
                        '&ba_surname='+$("#ba_surname").val()+
                        '&ba_phone='+$("#ba_phone").val()+
                        '&ba_email='+$("#ba_email").val()+
                        '&ba_land='+$("#ba_land").val()+
                        '&ba_postal='+$("#ba_postal").val()+
                        '&ba_city='+$("#ba_city").val()+
                        '&ba_street='+$("#ba_street").val()+
                        '&sa_name='+$("#sa_name").val()+
                        '&sa_surname='+$("#sa_surname").val()+
                        '&sa_land='+$("#sa_land").val()+
                        '&sa_postal='+$("#sa_postal").val()+
                        '&sa_city='+$("#sa_city").val()+
                        '&sa_street='+$("#sa_street").val()
                        , 'closeWindow(); sitealert("CHECKOUT",htmlDoc); refreshDynaNavi(); ');
                  } else //if (''!='felix2')
                    requestXMLFrom('/index.php?sfpc=contentPort&formfunc=doShopUser'+
                        '&payment='+$("#checkoutPaymentType").val()+
                        '&ship_avail='+$("#ship_avail").val()+
                        '&saveadress='+$('#saveadress:checked').val()+
                        '&shipment='+$("#checkoutShippingType").val()+
                        '&sa_name='+$("#sa_name").val()+
                        '&sa_surname='+$("#sa_surname").val()+
                        '&sa_land='+$("#sa_land").val()+
                        '&sa_postal='+$("#sa_postal").val()+
                        '&sa_city='+$("#sa_city").val()+
                        '&sa_street='+$("#sa_street").val()+
                        '&address='+($('#skipShip').val() == 1?1:-1), 'closeWindow(); sitealert("CHECKOUT",htmlDoc); refreshDynaNavi(); ');   
                 //  else
                  //{ doslid=0;
                  //}
                  break;
          default : break;
  }
  if (id==4)
  { if ($('#skipShip').val() != 1)
      sshort=$('#userland_short').val();
    else
      sshort=$('#deliveryland_short').val();
    requestXMLFrom("/index.php?sfpc=contentPort&formfunc=transport_details&useShip="+$('#skipShip').val()+"&short="+sshort+"&addrpage="+$('#addrpage').val(),"setDivC('transport_details',htmlDoc);");
  }
  if (id>6)
    id=6;
  if (actual_slide!=id)
  if (doslid==1)
  { $('#checkout_content_'+actual_slide).animate({
        height: '0px',
        //buttonVslid("");
       }, 'slow');
    window.setTimeout("hdiv('checkout_content_"+actual_slide+"');",1000);
    $('#checkout_content_'+id).animate({
        height: '270px',
        //buttonVslid("");
      }, 'slow');
    $('#check_t'+id+'_title').css('color','#ffffff');
    $('#check_t'+actual_slide+'_title').css('color','#666666');
    buttonVslid("#check_t"+actual_slide,0);
    buttonVslid("#check_t"+id,-22);
    actual_slide=id;	
    x = document.getElementById('checkout_content_'+id);
    y = document.getElementById('cartoptions');
    x.appendChild(y);
  }
}
function waitForPayment()
{ if ($('#checkoutPaymentChecked').val()!="success" && $('#creditcheck').is(':visible') ) 
    requestXMLFrom('index.php?sfpc=ContentPort&formfunc=paymentRecieved','checkPay(htmlDoc);  window.setTimeout("waitForPayment()",2500);');
  else
  { hdiv('creditcheck');
    hdiv('blend');
  }
}
function checkPay(data)
{ if (data=="Payment_recieved")
  { $('#checkoutPaymentChecked').val("success");
    doCheckoutSlid(7);
  }
  setDivC('creditdebug',data);	
}
function printBAdress () 
{ setDivC("adress_bill",'<table border="0" width="100%">'+
          '<tr><td class="tgtext_14" style="color:#cccccc" colspan="2" onclick="doCheckoutSlid(2);">BILLING ADRESS' +
          '<tr><td>name:<td>' +$("#ba_name").val()+
          '<tr><td>Surname:<td>' +$("#ba_surname").val()+
          '<tr><td>Country:<td>' +$("#ba_land").val()+
          '<tr><td>Adress:<td>' +$("#ba_postal").val()+" "+$("#ba_city").val()+" "+$("#ba_street").val()+
          '<tr><td>&nbsp;' +
          '</table>');
}
function printSAdress () 
{ setDivC("adress_ship",'<table border="0" width="100%">'+
          '<tr><td class="tgtext_14" style="color:#cccccc" colspan="2" onclick="doCheckoutSlid(3);">SHIPPING ADRESS' +
          '<tr><td>name:<td>' +$("#sa_name").val()+
          '<tr><td>Surname:<td>' +$("#sa_surname").val()+
          '<tr><td>Country:<td>' +$("#sa_land").val()+
          '<tr><td>Adress:<td>' +$("#sa_postal").val()+" "+$("#sa_city").val()+" "+$("#sa_street").val()+
          '<tr><td>&nbsp;' +
          '</table>');
}
function printPayment () 
{ setDivC("payment_type",'<table border="0" width="100%">'+
          '<tr><td class="tgtext_14" style="color:#cccccc" colspan="2" onclick="doCheckoutSlid(5);">PAYMENT TYPE' +
          '<tr><td>Payment:<td>' +PaymentTypes[$("#checkoutPaymentType").val()]+
          '<tr><td>&nbsp;' +
          '</table>');
}
function printShipping () 
{ setDivC("shipping_type",'<table border="0" width="100%">'+
          '<tr><td class="tgtext_14" style="color:#cccccc" colspan="2" onclick="doCheckoutSlid(4);">SHIPPING METHOD' +
          '<tr><td>Shipping:<td>' +ShippingTypes[$("#checkoutShippingType").val()]+
          '<tr><td>&nbsp;' +
          '</table>');
}
var PaymentTypes=new Array();
var ShippingTypes=new Array();
PaymentTypes[0]="PayPal";
PaymentTypes[1]="Bank Transfer";
PaymentTypes[2]="Credit Card";
ShippingTypes[0]="FedEX";
ShippingTypes[1]="DPD";
function doProfileSlid( id)
{ 
  $('#profile_t'+id+'_title').css('color','#ffffff');
  $('#profile_t'+actual_slide+'_title').css('color','#666666');
  $('#profile_content_'+actual_slide).animate({
        height: '0px',
        //buttonVslid("");
      }, 'slow');
  $('#profile_content_'+id).animate({
        height: '270px',
        //buttonVslid("");
      }, 'slow');
  buttonVslid("#profile_t"+actual_slide,0);
  buttonVslid("#profile_t"+id,-22);
  actual_slide=id;	
  switch(id)
  { case 0: break;
	case 1:  break;
	case 2:  break;
	case 3:  break;
	case 4:  break;
	case 5:  break;
	case 6:  break;
	default : break;
  }
}
function setAdress(name,surname,land,postal,city,street,landshort)
{ $('#sa_name').val(name);
  $('#sa_surname').val(surname);
  //$('#sa_country').val(land);
  $('#sa_land').val(landshort);
  $('#deliveryland_short').val(land);
  $('#sa_postal').val(postal);
  $('#sa_city').val(city);
  $('#sa_street').val(street);
}
function getDivPos (companc)
{ anchestor=document.getElementById(companc);
  if (anchestor!=null ) 
  { var curleft = curtop = 0;
    lastcomp=anchestor;
    if (anchestor.offsetParent)
    { do
       { curleft += anchestor.offsetLeft;
	    curtop += anchestor.offsetTop;
      } while (anchestor = anchestor.offsetParent);
    }
    prev_end= curtop+$('#'+companc).height();
    prev_endx= curleft+$('#'+companc).width();
    var nt = curtop;
    var nl = curleft;
    if (prev_end>f_scrollTop()+f_clientHeight())
      nt= (f_scrollTop()+f_clientHeight()-$('#'+companc).height());
    else if (curtop<f_scrollTop())
      nt=f_scrollTop()
    if (curleft<f_scrollLeft())
      nl=f_scrollLeft();
    else if (prev_endx>f_scrollLeft()+f_clientWidth())
      nl=(f_scrollLeft()+f_clientWidth()-$('#'+companc).width());
    $('#'+companc).animate({
        left: nl+'px',
        top: nt+'px',
       }, 50);
  }
}
function openPopupWindow (url,title) {
 fenster = window.open(url, title, "width=1020,height=520,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
 // fenster.addEventListener(CloseEvent.CLOSE, onPopUpClose);
}
function onPopUpClose()
{ hdiv('blend');
  hdiv('waiting');
  hdiv('creditcheck');
}
function doProfileWarp( id)
{ if (id==2)
  { $('#profile_t2_title').css('color','#ffffff');
    $('#profile_t1_title').css('color','#666666');
    $('#profile_content_1').css('height','0px');
    $('#profile_content_2').css('height','270px');
    buttonVslid("#profile_t1",0);
    buttonVslid("#profile_t2",-22);
  } else 
  { $('#profile_t1_title').css('color','#ffffff');
    $('#profile_t2_title').css('color','#666666');
    $('#profile_content_2').css('height','0px');
    $('#profile_content_1').css('height','270px');
    buttonVslid("#profile_t2",0);
    buttonVslid("#profile_t1",-22);
  }
  actual_slide=id
}
function setmodes(name, mode)
{ if (mode==0)
  { $(name).css('background','url(tsg_images/n_search_typefield.png) ');  
    $(name).css('color','#ffffff');
  } else if (mode==1)
  { $(name).css('background','url(tsg_images/n_search_typefield_a.png) ');  
    $(name).css('color','#000000');
  } else
  { $(name).css('background','url(tsg_images/n_search_typefield_f.png) ');  
    $(name).css('color','#000000');
  }
}
function addWishlist(id)
{ 
   sitealert('Wishlist',xmlDoc.getElementsByTagName("action")[0].childNodes[0].nodeValue);
   window.setTimeout("$('#blend').fadeOut(250)",1000);	
   refreshLogin();
}
function checkuserland(id)
{ var fields=new Array();
  fields = htmlDoc.split(";");
  if (fields[0]=='00')
  { sitealert("ERROR","your land could not be found. Please use 'DE' for Germany or 'US' for USA");
    if(id==0)
    { $('#ba_land').val(fields[0]+" "+fields[1]);
      $('#userland_short').val("00");
    } else
    { $('#sa_land').val(fields[0]+" "+fields[1]);
      $('#deliveryland_short').val("00");
    }
  }
  else if(id==0)
  { $('#userland_short').val(fields[0]);	
    $('#ba_land').val(fields[0]+" "+fields[1]);	
  } else
  { $('#deliveryland_short').val(fields[0]);
    $('#sa_land').val(fields[0]+" "+fields[1]);
  } 
}
function addrbook_Del()
{ if (confirm('are you want to delete adress nr '+(parseInt($('#addrpage').val())+1)+'')) 
    requestXMLFrom('/index.php?sfpc=ContentPort&formfunc=removeaddr&addrpage='+$('#addrpage').val()+'&random='+new Date().getTime(),'$(\'#addrpage\').val(parseInt($(\'#addrpage\').val())-1); openProfile('+actual_slide+')' );
}
function addrbook_New()
{ $('#addrpage').val('999'); 
  requestXMLFrom('/index.php?sfpc=ContentPort&formfunc=newaddr&addrpage='+$('#addrpage').val()+'&random='+new Date().getTime(),'openProfile('+actual_slide+')' ); 
}
function configureProduct(id,update,mode)
{ // sitealert("notice","our online shop will be available soon");
  requestXMLFrom('/index.php?sfpc=contentport&formfunc=configProd&id='+id+'&mode='+mode+'&update='+update+'&id='+id+'&random='+new Date().getTime(),'sitealert("CHOOSE SIZE",htmlDoc,"BACK TO SHOP");');
}
function checkRegisterFields()
{ if (document.register.reg_pass1.value=="")
    setmodes('#reg_pass1',2);
  else
    setmodes('#reg_pass1',0);
  if (document.register.reg_pass2.value=="")
    setmodes('#reg_pass2',2);
  else
    setmodes('#reg_pass2',0);
  if (document.register.reg_name.value=="your first name")
    setmodes('#reg_name',2);
  else
    setmodes('#reg_name',0);
   if (document.register.reg_surname.value=="your surname")
    setmodes('#reg_surname',2);
  else
    setmodes('#reg_surname',0);
   if (document.register.reg_land.value=="your land eg. US")
    setmodes('#reg_land',2);
  else
    setmodes('#reg_land',0);
   if (document.register.reg_city.value=="your city")
    setmodes('#reg_city',2);
  else
    setmodes('#reg_city',0);
   if (document.register.reg_country.value=="your country eg. bavaria")
    setmodes('#reg_country',2);
  else
    setmodes('#reg_country',0);
   if (document.register.reg_street.value=="your street and number")
    setmodes('#reg_street',2);
  else
    setmodes('#reg_street',0);
   if (document.register.reg_email.value=="your email")
    setmodes('#reg_email',2);
  else
    setmodes('#reg_email',0);
   if (document.register.reg_postal.value=="your postal code")
    setmodes('#reg_postal',2);
  else
    setmodes('#reg_postal',0);
}
function checkGuestFields()
{ var cnt=0;
  if ($('#ba_name').val()=="" || $('#ba_name').val()=="name" )
  { setmodes('#ba_name',2); cnt++; }
  else
    setmodes('#ba_name',0);
  if ($('#ba_surname').val()=="" || $('#ba_surname').val()=="surname" )
  { setmodes('#ba_surname',2); cnt++; }
  else
    setmodes('#ba_surname',0);
  if ($('#ba_email').val()=="" || $('#ba_email').val()=="email")
  { setmodes('#ba_email',2); cnt++; }
  else
    setmodes('#ba_email',0);
  if ($('#ba_land').val()=="" || $('#ba_land').val()=="country, use 'US' for 'USA'")
  { setmodes('#ba_land',2); cnt++; }
  else
    setmodes('#ba_land',0);
 if ($('#ba_postal').val()=="" || $('#ba_postal').val()=="postal")
  { setmodes('#ba_postal',2); cnt++; }
  else
    setmodes('#ba_postal',0);
 if ($('#ba_city').val()=="" || $('#ba_city').val()=="city")
  { setmodes('#ba_city',2); cnt++; }
  else
    setmodes('#ba_city',0);
 if ($('#ba_street').val()=="" || $('#ba_street').val()=="street")
  { setmodes('#ba_street',2); cnt++; }
  else
    setmodes('#ba_street',0  );
  return cnt;
}
function checkGuestFields2()
{ var cnt=0;
  if ($('#sa_name').val()=="" || $('#sa_name').val()=="name" )
  { setmodes('#sa_name',2); cnt++ ; }
  else
  { setmodes('#sa_name',0); }
  if ($('#sa_surname').val()=="" || $('#sa_surname').val()=="surname" )
  { setmodes('#sa_surname',2); cnt++ ; }
  else
  { setmodes('#sa_surname',0); }
  if ($('#sa_land').val()=="" || $('#sa_land').val()=="country, use 'US' for 'USA'" || $('#sa_land').val()=="00 not found" )
  { setmodes('#sa_land',2); cnt++ ; }
  else
  { setmodes('#sa_land',0); }
  if ($('#sa_postal').val()=="" || $('#sa_postal').val()=="postal" )
  { setmodes('#sa_postal',2); cnt++ ; }
  else
  { setmodes('#sa_postal',0);  }
  if ($('#sa_city').val()=="" || $('#sa_city').val()=="city" )
  { setmodes('#sa_city',2); cnt++ ; }
  else
  { setmodes('#sa_city',0);  }
  if ($('#sa_street').val()=="" || $('#sa_street').val()=="street" )
  { setmodes('#sa_street',2); cnt++ ; }
  else
  { setmodes('#sa_street',0);  }
  return cnt;
}

