/* +----------------------------------------------------------------------+ */
/* | www.ifas.ch                                                          | */
/* +----------------------------------------------------------------------+ */
/* | JavaScripts                                                          | */
/* +----------------------------------------------------------------------+ */

/*
     ##### Image Rollovers #####

     Standards Compliant Rollover Script
     Author : Daniel Nolan
     http://www.bleedingego.co.uk/webdev.php

     For any image in your document you will need to create a
     rollover state for it, the only requirements for this image is that
     it is named exactly the same as the original image, but it needs -hl
     on the end of the name. The image should also be in the same directory
     as the original and should be of the same type. So for example you would
     have sample.gif and sample-hl.gif files in the same directory.

     You will need to add the attribute class="imgover" to any image in
     your document that requires a mouseover effect to be trigger.
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '-hl'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;



/*
     ##### Protect Mail #####

     Script Originally by SSI Developer (www.ssi-developer.net)
     Modified by James Crooke of CJ Website Design (www.cj-design.com)
*/

function protectmail(name, address, subject, body) {

document.write("<a href='mailto:" + name + "@" + address.substring(1,address.length) + "?subject=" + subject + "&body=" + body + "'>" + name + "@" + address.substring(1,address.length) + "</a>");

}



function check_empty(text) {
return (text.length > 0); // gibt false zurück wenn leer
}

function check_eMail(address) {
if ((address == "")
|| (address.indexOf ('@') == -1)
|| (address.indexOf ('.') == -1))
return false;
return true;
}
