var junk1 = 'info'; // Benutzername
var junk2 = 'hgvwidnau'; // Serverstring
var junk3 = 'ch'; // Domain

var myStyle = '' ; // Style-Definitionen (optional, z.B.'color:red;')
var myName = '' ; // name=".." (optional)
var myID = '' ; // id=".." (optional)
var myClass = 'mailadresse' ; // CSS-Klasse (optional)
var mySubject = 'Nachricht%20aus%20Website%20HGVW'; //Zeichen escapen!!! (z.B. ö = &ouml;) Beim Öffnen des E-Mail-Editors wir dieser Text in das Betreff-Feld eingesetzt(optional)

var apple='' + junk1 + '@' + junk2 + '.' + junk3; // NICHT VERÄNDERN!!!

var myAppleLabel= apple; // apple = Mailadresse oder beliebiger Text

// FOLGENDE ZEILEN NICHT VERÄNDERN!!!
var junk4 = 'hr';
var junk5 = 'ef';
var junk6 = 'mai';
var junk7 = 'lto:';
var junk8 = '';

if (mySubject != '' ) { junk8+='?subject=' + mySubject; }

var myApple='<' + 'a ' + junk4 + junk5 + '="' + junk6 + junk7 + apple + junk8 + '" ' ;

if (myStyle != '' ) { myApple+=' style="' + myStyle + '" '; }
if (myName != '') { myApple+='name="' + myName + '" '; }
if (myID != '') { myApple+='id="' + myID + '" '; }
if (myClass != '') { myApple+='class="' + myClass + '" '; }

myApple+=('>' + myAppleLabel + '<\/a>');


// ----------------------------------------------------------------------------
// HasClassName
//
// Description : returns boolean indicating whether the object has the class name
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function hasClassName(objElement, strClass)
{
	// if there is a class
	if ( objElement.className )
	{
		// the classes are just a space separated list, so first get the list
	   var arrList = objElement.className.split(' ');
	   // get uppercase class for comparison purposes
	   var strClassUpper = strClass.toUpperCase();
	
	   // find all instances and remove them
	   for ( var i = 0; i < arrList.length; i++ )
      {
	      // if class found
	      if ( arrList[i].toUpperCase() == strClassUpper )
         {
	         // we found it
	         return true;
         }
      }
   }
	
	// if we got here then the class name is not there
	return false;
}

// ----------------------------------------------------------------------------
// AddClassName
//
// Description : adds a class to the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function addClassName(objElement, strClass, blnMayAlreadyExist)
{
   // if there is a class
   if ( objElement.className )
	{
   	// the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // if the new class name may already exist in list
      if ( blnMayAlreadyExist )
      {
			// get uppercase class for comparison purposes
         var strClassUpper = strClass.toUpperCase();

         // find all instances and remove them
         for ( var i = 0; i < arrList.length; i++ )
         {
				// if class found
            if ( arrList[i].toUpperCase() == strClassUpper )
            {
					// remove array item
               arrList.splice(i, 1);

               // decrement loop counter as we have adjusted the array's contents
               i--;
				}
			}
		}

      // add the new class to end of list
      arrList[arrList.length] = strClass;

      // add the new class to beginning of list
      //arrList.splice(0, 0, strClass);
      
      // assign modified class name attribute
      objElement.className = arrList.join(' ');
   }
   // if there was no class
   else
   {
      // assign modified class name attribute      
      objElement.className = strClass;
	}
}

// ----------------------------------------------------------------------------
// RemoveClassName
//
// Description : removes a class from the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to remove
//
function removeClassName(objElement, strClass)
{
   // if there is a class
   if ( objElement.className )
	{
	   // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');
      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
		{
		   // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
      	{
			   // remove array item
            arrList.splice(i, 1);
			   // decrement loop counter as we have adjusted the array's contents
            i--;
			}
		}

      // assign modified class name attribute
      objElement.className = arrList.join(' ');
	}
   // if there was no class
   // there is nothing to remove
}

