<!--
/**
 * Script voor popup-windows voor editor (niet naar het achterliggende venster)
 */
var winModalWindow
 
function IgnoreEvents(e)
{
  return false
}
 
function ShowWindow(f,status,resizable,scroll,w,h,help)
{
  if (window.showModalDialog)
  {
  // Modal dialog.. problemen bij posten van informatie
  // window.showModalDialog(f, 'window', 'status=' + status + ';resizable=' + resizable + 'scroll=' + scroll + ';dialogWidth=' + w + 'dialogHeight=' + h + 'help=' + help)
	winModalWindow = window.open(f, 'window', 'status=' + status + ', resizable=' + resizable + ', scroll=' + scroll + ', height=' + h +', width=' + w +', help=' + help + ', alwaysRaised, dependent, z-lock')
	winModalWindow.ondeactivate = winModalWindow.focus()

  }
  else
  {
    window.top.captureEvents (Event.CLICK|Event.FOCUS)
    window.top.onclick=IgnoreEvents
    window.top.onfocus=HandleFocus 
    winModalWindow = window.open (f, 'ModalChild', 'dependent=yes,resizable=' + resizable + ',scrollbars=' + scroll + ',width=' + w + ',height=' + h)
    winModalWindow.focus()
  }
}

 
function HandleFocus()
{
  if (winModalWindow)
  {
    if (!winModalWindow.closed)
    {
      winModalWindow.focus()
    }
    else
    {
      window.top.releaseEvents (Event.CLICK|Event.FOCUS)
      window.top.onclick = ""
    }
  }
  return false
}


/**
 * Script voor popup-windows voor Helpinterface
 */
var win = null
  function NewWindow(mypage,myname,w,h,scroll)
	{
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
    }

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object   the table row
 * @param   string   the action calling this script (over, out or click)
 * @param   string   the default background color
 * @param   string   the color to use for mouseover
 * @param   string   the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                     ? thePointerColor
                     : theDefaultColor;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

// ------------------------------------------------------------------
// Enter als tab toets
// ------------------------------------------------------------------
var submitKey = 0;

function TranslateKey(keypress) {
	//if (submitKey == 0) {
	//	if (event.keyCode == 13) {
	//		event.keyCode = 9;
	//	}
	//}
	
	// Als de CRTL en ALT toestsen wordt ingedrukt
	//if (window.event.altKey && window.event.ctrlKey) {
	//	if (event.keyCode == 70) { window.location="/nl/relaties/relatie+zoeken/"; } // F
//		if (event.keyCode == 78) { window.location="/nl/overzicht+meldingen/nieuwe+melding/"; } // N
//		if (event.keyCode == 79) { window.location="/nl/overzicht+meldingen/"; } // O
//	}
}

window.document.onkeydown = TranslateKey;

// ------------------------------------------------------------------
// Formulier maar 1x submitten
// ------------------------------------------------------------------
var submitcount = 0;

function submitOnce() {
	if (submitcount == 0) {
		submitcount = 1;
		return true;
	} else {
		alert('One moment please, the system is already processing your request!');
		return false;
	}
}

// ------------------------------------------------------------------
// Select all
// ------------------------------------------------------------------
function selectAll(name) {
	var field = document.getElementsByName(name);
    for (i=0;i<=field.length-1;i++) {
   		field[i].checked = true;
	}
}

// ------------------------------------------------------------------
// Deslect all
// ------------------------------------------------------------------
function deselectAll(name) {
	var field = document.getElementsByName(name);
    for (i=0;i<=field.length-1;i++) {
		field[i].checked = false;
	}
}

// ------------------------------------------------------------------
// Tekst weergevenen en verbergen bij klikken op de link
// ------------------------------------------------------------------
var tijdelijk, t= new Array(), fill, alles = new Array();

init = 0;

function update_style(waardeeen,style,waarde,dezelatenstaan)
{	
	if(init==1)
	{	alles[alles.length] = waardeeen;
	}
	
	if(style == 'display' && init!=1)	{
		if(tijdelijk) {	
			if (dezelatenstaan!=tijdelijk){
				eval("document.getElementById('" + tijdelijk + "').style." + style + "='none'");
			}
		}
			
		if(tijdelijk == waardeeen)
		{	tijdelijk = '';
		}
		else if(tijdelijk!=waardeeen)	{
			if(document.getElementById(waardeeen).style.display=='none') {
				eval("document.getElementById('" + waardeeen + "').style." + style + "='" + waarde +"'");
			}
			else {
				eval("document.getElementById('" + waardeeen + "').style." + style + "='none'");
			}
			tijdelijk = waardeeen;
		}
	}	else	{
			eval("document.getElementById('" + waardeeen + "').style." + style + "='" + waarde +"'");
	}		
}

function update_style2(waardeeen,style,waarde)
{	eval("document.getElementById('" + waardeeen + "').style." + style + "='" + waarde + "'");
}

/*
 * Parse and show RSS feeds
 */
jQuery(document).ready(function(){
	// Parse all feeds in blocks with the class feed
	jQuery(".feed").each(function() {
		var $feed = jQuery(this);
		jQuery.get($feed.find("#feedSource").attr("value"), function(d) {

			//clear the content in the div for the next feed.
			$feed.find("#feedHeadlines").empty();
			$feed.find("#itemTitle").empty();
			$feed.find("#itemDescription").empty();
			//$feed.find('#feedHeadlines').append('<ul>');
			$feed.find("#feedListItems").empty();

			// limit the number of shown items
			if ($feed.find("#feedShowItems").attr("value").match(/^\d+$/) == null) {
				var showItems = 10;
			} else {
				var showItems = $feed.find("#feedShowItems").attr("value");
			}

			// reset the number of itmes done
			var i = 0;
			
			//find each 'item' in the file and parse it
			jQuery(d).find('item').each(function() {
				i++;
			
				//name the current found item this for this particular loop run
				var $item = jQuery(this);
				// grab the post title
				var title = $item.find('title').text();
				// grab the post's URL
				var link = $item.find('guid').text();
				// next, the description
				var description = $item.find('description').text();
				//don't forget the pubdate
				var pubDate = $item.find('pubDate').text();
	 
				if (i == 0) {
					var html = "<a href=\"" + link + "\" target=\"_self\">" + title + "</a>";
					
					
					$feed.find('#itemTitle').append($(html));
					$feed.find('#itemDescription').append(description + '&nbsp;&nbsp;<a href="' + link +'"><img src="../../nw4all/images/readmore.gif" alt="laatste_nieuws" /></a>');
					$feed.find('#itemLink > a').attr({href: link});
					
				} else if (i > showItems) {
					// Do nothing
				} else {
					// now create a var 'html' to store the markup we're using to output the feed to the browser window
					var html = "<li><a href=\"" + link + "\" target=\"_self\" title=\"" + description + "\">" + title + "</a><\/li>";
						
	 				//put that feed content on the screen!
					$feed.find('#feedHeadlines').append($(html));
				}
				
				if (i <= showItems) {
					var d = new Date(pubDate);
					
					var html = "<h3><a href=\"" + link + "\" target=\"_self\" title=\"" + description + "\">" + title + "</a><\/h3><div class=\"newsDate\">" + d.toLocaleDateString() + "</div><p>" + description + "</p>";
					$feed.find('#feedListItems').append($(html));
				}
			});

			//$feed.find('#feedHeadlines').append('</ul>');
		});
	});
});

/*
 * addEvent.js file
 */
Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};

function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}
	
var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();
addEvent(window,'unload',EventCache.flush);

/*
Sweet Titles (c) Creative Commons 2005
http://creativecommons.org/licenses/by-sa/2.5/
Author: Dustin Diaz | http://www.dustindiaz.com
*/
var sweetTitles = { 
	xCord : 0,								// @Number: x pixel value of current cursor position
	yCord : 0,								// @Number: y pixel value of current cursor position
	tipElements : ['a','abbr','span'],	// @Array: Allowable elements that can have the toolTip
	obj : Object,							// @Element: That of which you're hovering over
	tip : Object,							// @Element: The actual toolTip itself
	active : 0,								// @Number: 0: Not Active || 1: Active
	init : function() {
		if ( !document.getElementById ||
			!document.createElement ||
			!document.getElementsByTagName ) {
			return;
		}
		var i,j;
		this.tip = document.createElement('div');
		this.tip.id = 'toolTip';
		document.getElementsByTagName('body')[0].appendChild(this.tip);
		this.tip.style.top = '0';
		this.tip.style.visibility = 'hidden';
		var tipLen = this.tipElements.length;
		for ( i=0; i<tipLen; i++ ) {
			var current = document.getElementsByTagName(this.tipElements[i]);
			var curLen = current.length;
			for ( j=0; j<curLen; j++ ) {
				addEvent(current[j],'mouseover',this.tipOver);
				addEvent(current[j],'mouseout',this.tipOut);
				current[j].setAttribute('tip',current[j].title);
				current[j].removeAttribute('title');
			}
		}
	},
	updateXY : function(e) {
		if ( document.captureEvents ) {
			sweetTitles.xCord = e.pageX;
			sweetTitles.yCord = e.pageY;
		} else if ( window.event.clientX ) {
			sweetTitles.xCord = window.event.clientX+document.documentElement.scrollLeft;
			sweetTitles.yCord = window.event.clientY+document.documentElement.scrollTop;
		}
	},
	tipOut: function() {
		if ( window.tID ) {
			clearTimeout(tID);
		}
		if ( window.opacityID ) {
			clearTimeout(opacityID);
		}
		sweetTitles.tip.style.visibility = 'hidden';
	},
	checkNode : function() {
		var trueObj = this.obj;
		if ( this.tipElements.inArray(trueObj.nodeName.toLowerCase()) ) {
			return trueObj;
		} else {
			return trueObj.parentNode;
		}
	},
	tipOver : function(e) {
		sweetTitles.obj = this;
		tID = window.setTimeout("sweetTitles.tipShow()",500);
		sweetTitles.updateXY(e);
	},
	tipShow : function() {		
		var scrX = Number(this.xCord);
		var scrY = Number(this.yCord);
		var tp = parseInt(scrY+15);
		var lt = parseInt(scrX+10);
		var anch = this.checkNode();
		var addy = '';
		var access = '';
		addy = anch.firstChild.nodeValue;
		this.tip.innerHTML = "<p>"+anch.getAttribute('tip')+"</p>";
		if ( parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft) < parseInt(this.tip.offsetWidth+lt) ) {	
			this.tip.style.left = parseInt(lt-(this.tip.offsetWidth+10))+'px';

		} else {
			this.tip.style.left = lt+'px';
		}
		if ( parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop) < parseInt(this.tip.offsetHeight+tp) ) {
			this.tip.style.top = parseInt(tp-(this.tip.offsetHeight+10))+'px';

		} else {
			this.tip.style.top = tp+'px';
		}
		if ( anch.getAttribute('tip') != '' ) {
			this.tip.style.visibility = 'visible';
		} else {
			this.tip.style.visibility = 'hidden';
			return;
		}			
		this.tip.style.opacity = '.1';
		this.tipFade(10);
	},
	tipFade: function(opac) {
		var passed = parseInt(opac);
		var newOpac = parseInt(passed+10);
		if ( newOpac < 80 ) {
			this.tip.style.opacity = '.'+newOpac;
			this.tip.style.filter = "alpha(opacity:"+newOpac+")";
			opacityID = window.setTimeout("sweetTitles.tipFade('"+newOpac+"')",20);
		}
		else { 
			this.tip.style.opacity = '.80';
			this.tip.style.filter = "alpha(opacity:80)";
		}
	}
};

function pageLoader() {
	sweetTitles.init();
}

addEvent(window,'load',pageLoader);

// -->


/*
  XX SUNRISE / LANDRUSH SCRIPT
*/

function showhide(a) {

	if(a == "S1") {
	
		document.getElementById('trademarkName').style.display = 'table-row';
		document.getElementById('trademarkNumber').style.display = 'table-row';
		document.getElementById('trademarkCC').style.display = 'table-row';
		document.getElementById('trademarkClass').style.display = 'table-row';
		document.getElementById('domainName').style.display = 'none';
		document.getElementById('appDate').style.display = 'table-row';
		document.getElementById('regDate').style.display = 'table-row';
		document.getElementById('entitlement').style.display = 'table-row';
		
	}
	else if (a == "S2") {
		
		document.getElementById('trademarkName').style.display = 'none';
		document.getElementById('trademarkNumber').style.display = 'none';
		document.getElementById('trademarkCC').style.display = 'none';
		document.getElementById('trademarkClass').style.display = 'none';
		document.getElementById('domainName').style.display = 'table-row';
		document.getElementById('appDate').style.display = 'none';
		document.getElementById('regDate').style.display = 'table-row';
		document.getElementById('entitlement').style.display = 'table-row';
		
	}
	else if (a == "S3") {

		document.getElementById('trademarkName').style.display = 'table-row';
		document.getElementById('trademarkNumber').style.display = 'table-row';
		document.getElementById('trademarkCC').style.display = 'table-row';
		document.getElementById('trademarkClass').style.display = 'table-row';
		document.getElementById('domainName').style.display = 'none';
		document.getElementById('appDate').style.display = 'table-row';
		document.getElementById('regDate').style.display = 'table-row';
		document.getElementById('entitlement').style.display = 'table-row';
	
	} else {
		
		document.getElementById('trademarkName').style.display = 'none';
		document.getElementById('trademarkNumber').style.display = 'none';
		document.getElementById('trademarkCC').style.display = 'none';
		document.getElementById('trademarkClass').style.display = 'none';
		document.getElementById('domainName').style.display = 'none';
		document.getElementById('appDate').style.display = 'none';
		document.getElementById('regDate').style.display = 'none';
		document.getElementById('entitlement').style.display = 'none';
	
	}
}


