/*
 * sIFR replacements
 */
if(typeof sIFR == "function"){

  sIFR.replaceElement("b", named({sSelector: "b.kids", sFlashSrc: "images/din-h1.swf", sColor: "#d66cec", sWmode: "opaque"}));
  sIFR.replaceElement("b", named({sSelector: "b.zone", sFlashSrc: "images/din-h1.swf", sColor: "#3074a9", sWmode: "opaque"}));

  sIFR.replaceElement("h1", named({sFlashSrc: "images/din-h1.swf", sColor: "#a98830", sWmode: "opaque"}));
  sIFR.replaceElement("h2", named({sFlashSrc: "images/din-h1.swf", sColor: "#7d142b", sWmode: "opaque"}));
}

/*
 * Absolute NL signup form validation
 */
 function xlaANLformvalidate(what){ 
   var toreturn=true;
	 
	 if (what.email.value == '') {
		 alert('Please provide a valid e-mail address');
		 toreturn=false;
	 }
	 
	 return(toreturn);
 }


/*
 * Crossbrowser addEvent & RemoveEvent functions
 * Courtesy of http://www.soziologie.uni-halle.de/unger/scripts/workshop_internet/fr_js_322.html
 */
 function addEvent(obj, eventType, afunction, isCapture) {
    // W3C DOM
    if (obj.addEventListener) {
       obj.addEventListener(eventType, afunction, isCapture);
       return true;
    }
    // Internet Explorer
    else if (obj.attachEvent) {
       return obj.attachEvent("on"+eventType, afunction);
    }
    else return false;
 }

 function removeEvent(obj, eventType, afunction, isCapture) {
    if (obj.removeEventListener) {
       obj.removeEventListener(eventType, afunction, isCapture);
       return true;
    }
    else if (obj.detachEvent) {
       return obj.detachEvent("on"+eventType, afunction);
    }
    else return false;
 }

/*
 * give links in the document with rel="external" a target="_new" value
 * (this supports strict doctype which doesn't use target attribute)
 */
 function set_link_targets() {
	 var links = document.getElementsByTagName('A');
	 for (var i=0; i<links.length; i++) {
		 if (links[i].rel && links[i].rel.match(/\b(external|popup)\b/i)) {
			 links[i].target = '_blank'; 
		 }
	 }
 }

 function init() {

    // set up target values for links which want to operate in a new window
		set_link_targets();
 }


addEvent(window, 'load', init, false);
