// START OF MESSAGE SCRIPT //

var MSGTIMER = 20;
var MSGSPEED = 5;
var MSGOFFSET = 3;
var MSGHIDE = 6;

// build out the divs, set attributes and call the fade function //
function inlineMsg(target,string,autohide) {
  var msg;
  var msgcontent;
  if(!document.getElementById('msg')) {
    msg = document.createElement('div');
    msg.id = 'msg';
    msgcontent = document.createElement('div');
    msgcontent.id = 'msgcontent';
    document.body.appendChild(msg);
    msg.appendChild(msgcontent);
    msg.style.filter = 'alpha(opacity=0)';
    msg.style.opacity = 0;
    msg.alpha = 0;
  } else {
    msg = document.getElementById('msg');
    msgcontent = document.getElementById('msgcontent');
  }
  msgcontent.innerHTML = string;
  msg.style.display = 'block';
  var msgheight = msg.offsetHeight;
  var targetdiv = document.getElementById(target);
  targetdiv.focus();
  var targetheight = targetdiv.offsetHeight;
  var targetwidth = targetdiv.offsetWidth;
  var topposition = topPosition(targetdiv) - ((msgheight - targetheight) / 2);
  var leftposition = leftPosition(targetdiv) + targetwidth + MSGOFFSET;
  msg.style.top = topposition + 'px';
  msg.style.left = leftposition + 'px';
  clearInterval(msg.timer);
  msg.timer = setInterval("fadeMsg(1)", MSGTIMER);
  window.setTimeout("hideMsg()", (MSGHIDE * 1000));
}

// hide the form alert //
function hideMsg(msg) {
  var msg = document.getElementById('msg');
  if(!msg.timer) {
    msg.timer = setInterval("fadeMsg(0)", MSGTIMER);
  }
}

// face the message box //
function fadeMsg(flag) {
  if(flag == null) {
    flag = 1;
  }
  var msg = document.getElementById('msg');
  var value;
  if(flag == 1) {
    value = msg.alpha + MSGSPEED;
  } else {
    value = msg.alpha - MSGSPEED;
  }
  msg.alpha = value;
  msg.style.opacity = (value / 100);
  msg.style.filter = 'alpha(opacity=' + value + ')';
  if(value >= 99) {
    clearInterval(msg.timer);
    msg.timer = null;
  } else if(value <= 1) {
    msg.style.display = "none";
    clearInterval(msg.timer);
  }
}

// calculate the position of the element in relation to the left of the browser //
function leftPosition(target) {
  var left = 0;
  if(target.offsetParent) {
    while(1) {
      left += target.offsetLeft;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.x) {
    left += target.x;
  }
  return left;
}

// calculate the position of the element in relation to the top of the browser window //
function topPosition(target) {
  var top = 0;
  if(target.offsetParent) {
    while(1) {
      top += target.offsetTop;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.y) {
    top += target.y;
  }
  return top;
}


// Function To Clean Inputdata

function cleanInput(field) {
   field.value = field.value.replace(/^\s+|\s+$/g, '').toLowerCase();
   field.value = field.value.substr(0, 1).toUpperCase() + field.value.substr(1);
}


// (c) 2004-2007 Copyright Nedstat BV Netherlands.
// ALL RIGHTS RESERVED
// version v4.7 2004-02-22 TP added ns_ prefix and ns_undefined validation
// version v5.0 2007-06-21 SH complete rewrite

var ns_sendOrders={};

function ns_order(ns_counterURL,ns_client_id,ns_order_id){

this.counterURL=ns_counterURL;this.clientID=ns_client_id;this.orderID=ns_order_id;this.orders=[];this.logs=[];this.DEBUG=false;};ns_order.prototype.addLine=function(prod_id,brand,prod_grp,shop,qty,prod_price){this.orders[this.orders.length]={ns_prod_id:!this.isEmpty(prod_id)?prod_id:"ns_undefined",ns_brand:!this.isEmpty(brand)?brand:"ns_undefined",ns_prod_grp:!this.isEmpty(prod_grp)?prod_grp:"ns_undefined",ns_shop:!this.isEmpty(shop)?shop:"ns_undefined",ns_qty:this.toFloat(qty),ns_prod_price:this.toSignedFloat(prod_price)}};ns_order.prototype.sendOrder=function(){var cookieStr="ns_order_id_"+this.orderID+"=true";if(this.DEBUG){alert("cookie:\n"+document.cookie);}if(!this.orderID||ns_sendOrders[this.orderID]||(new RegExp(cookieStr+"\s*;")).test(new String(document.cookie||""))) return;ns_sendOrders[this.orderID]=true;document.cookie=cookieStr;var log=this.counterURL+"&ns__t="+(new Date()).getTime()+"&ns_commerce=true&ns_type=hidden"+"&ns_client_id="+this.toValueString(this.clientID)+"&ns_order_id="+this.toValueString(this.orderID)+"&ns_orderlines="+this.orders.length;for(var i=0,order,logURL;(order=this.orders[i]);i++){logURL=log+"&ns_orderline_id="+(i+1);for(var key in order)logURL+="&"+key+"="+escape(this.toValueString(order[key]));if(this.DEBUG)alert(logURL.replace(/&/g,"\n"));this.logs[this.logs.length]=new Image();this.logs[this.logs.length-1].src=logURL;}this.logs=[];};ns_order.prototype.toValueString=function(s){ return new String((typeof s=="undefined")?0:s).replace(/(%3C|%3E|<|>)/gi,"_");};ns_order.prototype.toFloat=function(s){var val=parseFloat(s); return isNaN(val)?"ns_undefined":val;};ns_order.prototype.toSignedFloat=function(s){s=new String((typeof s=="undefined")?"":s);if(!this.isMoney(s)) return 0;var matches=s.match(/([\+-])?([0-9\.,]+)[\.,]([0-9]{1,2})?$/);var val=(matches)?((matches[1])?matches[1]:"")+new String(matches[2]).replace(/[\.,]/g,"")+"."+(Math.round(matches[3]*100)/100):s.replace(/[\.,]/g,""); return val.replace(/([\+-])?0*(.*)/,"$1$2");};ns_order.prototype.isMoney=function(s){ return/^([\+-])?([0-9]+|[0-9]{1,3}([\.,][0-9]{3})*)([\.,][0-9]{1,2})?$/.test(new String((typeof s=="undefined")?0:s).replace(/(^\s+)|\s+$/g,""));};ns_order.prototype.isEmpty=function(s){s=new String((typeof s=="undefined")?"":s); return(s)?s.match(/^([\s]+)?$/):false;};

// NetStat Normal Code

function sitestat(ns_l){// FromUrl v1.5 Copyright (c) 2001-2008 Nedstat B.V. All rights reserved.
var ns_type='' // leave empty for normal/ppc measurement, fill in for clickin, clickout or pdf
var r='' // yes=only parse url when there is a real document.referrer,
// no=only parse url when there is no real document.referrer, empty=always parse url
var t='?' // tag in url where parameters follow; default '?' could be replaced by "#"
var p=new Array();var w='';var l='';var d=document;var n=navigator;var ns_0=''
;if(top!=self){if('\u0041'=='A'){var u=n.userAgent;if(u.indexOf('Safari')==-1)
{var b=u.indexOf('Opera');if(b==-1||(u.charAt(b+6)+0)>5){b=u.indexOf('Mozilla'
);var xb=b!=-1?u.charAt(b+8)>4:1;if(u.indexOf('compatible')!=-1||xb){var c=
'try{ns_0=top.document.referrer}catch(e){}';eval(c);c=
'try{l=top.document.location.href}catch(e){}';eval(c);}}}}}else{ns_0=
d.referrer;l=d.location.href;}if(ns_0.lastIndexOf('/')==ns_0.length-1){ns_0=
ns_0.substring(ns_0.lastIndexOf('/'),0);}var f=ns_l.indexOf('?');if(f!=-1){
var q=ns_l.substring(f+1);ns_l=ns_l.substring(0,f);if(q){var m=q.indexOf('&');
w=q.substring(0,m==-1?q.length:m);if(w.indexOf('=')!=-1){w='';}if(w){q=
q.substring(m==-1?q.length:m+1);q+=(q?'&':'')+'ns_name='+w;}if(ns_0.length>0){
q+=(q?'&':'')+'ns_referrer='+escape(ns_0);}var s=0;var e=0;while(q.length){e=
q.indexOf('&');if(e==-1){e=q.length;}var o=q.substring(s,e);if(o.substring(0,4
)=='amp;'){o=o.substring(4);}if(o)p[p.length]=o;q=q.substring(e+1);}}}var a=
l.indexOf(t);a=a==-1?0:l.substring(a+1);var j;if(r=='yes')j=ns_0.length;else
if(r=='no')j=!ns_0.length;else if(r=='')j=1;if(a&&j){while(a.length){var e=
a.indexOf('&');if(e==-1){e=a.length;}var k=a.substring(0,a.substring(0,e)
.indexOf('='));var v=a.substring(a.substring(0,e).indexOf('=')+1,e);if(
k.substring(0,4)=='amp;'){k=k.substring(4);}while(v.substring(0,1)=='='){v=
v.substring(1);}if(k=='ns_name'){w=v;}else if(k=='ns_or'){var g='ns_referrer='
;for(var z=0;z<p.length;z++){if(p[z].substring(0,g.length)==g){p[z]=
'ns_referrer='+v;}}}else{if(k.substring(0,3)=='ns_'&&v&&k){var h=0;for(var x=0
;x<p.length;x++){if(p[x].substring(0,p[x].indexOf('='))==k){p[x]=k+"="+v;h=1}}
if(!h){p[p.length]=k+"="+v;}}}a=a.substring(e+1);}}if(!w){return;}var s='';
var y='';for(var i=0;i<p.length;i++)if(p[i].substring(0,8)!='ns_name='){if(p[i
].substring(0,12)!='ns_referrer='){s+='&'+p[i];}else{y='&'+p[i];}}s+=ns_type?
'&ns_type='+ns_type+'&ns_action=view':'';ns_pixelUrl=ns_l+'?'+w+"&ns__t="+(
new Date()).getTime();ns_l=ns_pixelUrl+s+y;if(d.images){ns_1=new Image();
ns_1.src=ns_l;}else{d.write('<img src='+ns_l+' width="1" height="1">');}}



function cleanUp(s) {
s = s.toLowerCase();
s = s.replace(/ - /g,"");
s = s.replace(/ /g, "_");
s = s.replace(/&quot;/g, "");
s = s.replace(/&apos;/g, "");
s = s.replace(/&lt;/g  , "");
s = s.replace(/&gt;/g  , "");
s = s.replace(/&amp;/g , "");
s = s.replace(/&nbsp;/g, "");
s = s.replace(/&ccedil;/g, "c");
s = s.replace(/ccedil;/g, "c");
s = s.replace(/&egrave;/g, "e");
s = s.replace(/&eacute;/g, "e");
s = s.replace(/&ecirc;/g, "e");
s = s.replace(/&euml;/g, "e");
s = s.replace(/&agrave;/g, "a");
s = s.replace(/&acirc;/g, "a");
s = s.replace(/&aacute;/g, "a");
s = s.replace(/&atilde;/g, "a");
s = s.replace(/&auml;/g, "a");
s = s.replace(/&aring;/g, "a");
s = s.replace(/&igrave;/g, "i");
s = s.replace(/&iacute;/g, "i");
s = s.replace(/&icirc;/g, "i");
s = s.replace(/&iuml;/g, "i");
s = s.replace(/&ograve;/g, "o");
s = s.replace(/&oacute;/g, "o");
s = s.replace(/&ocirc;/g, "o");
s = s.replace(/&otilde;/g, "o");
s = s.replace(/&ouml;/g, "o");
s = s.replace(/&ugrave;/g, "u");
s = s.replace(/&uacute;/g, "u");
s = s.replace(/&ucirc;/g, "u");
s = s.replace(/&uuml;/g, "u");
s = s.replace(/&yacute;/g, "y");
s = s.replace(/&yuml;/g, "y");
s = s.replace(/&lsquo;/g, "");
s = s.replace(/&rsquo;/g, "");
s = s.replace(/:/g, "");
s = s.replace(/&#8217;/g, "");
s = s.replace(/&raquo;/g, "/");
s = s.replace(/!/g, "");
s = s.replace(/\?/g, "_");
s = s.replace(/\(/g, "");
s = s.replace(/\)/g, "");
s = s.replace(/\[/g, "");
s = s.replace(/\]/g, "");
s = s.replace(/\%20/g, "_");
s = s.replace(/\%/g, "_");
s = s.replace(/\+/g, "_");
s = s.replace(/&/g,"");
s = s.replace(/,/g,"");
return s;
}

function ns_onclick (klantnaam,sitenaam, a, url, name, type, winopt){var ns_l="http://be.sitestat.com/"+klantnaam+"/"+sitenaam+"/s?";ns_l+=name;ns_l+='&ns_type='+type+'&ns_action=view';ns_l+='&ns__t='+(new Date()).getTime();if(!url)url=a.href;var ns_0=document.referrer;if(ns_0.lastIndexOf('/')==ns_0.length-1)ns_0=ns_0.substring(ns_0.lastIndexOf('/'),0);if (ns_0.length>0)ns_l+='&amp;ns_referrer='+escape(ns_0);winopt=winopt||"";vartarget=(a&&a.target&&a.target!="")?(a.target.substring(0,1)=="_")?a.target.substring(1):a.target:"self";var ns_i=new Image();if(target&&url){if(window[target]){window.ns_softclick_timer=function(target,url){return function(){ns_i.onload=ns_i.onerror=function(){return;};window[((window[target])?target:"self")].location.href=url;}}(target,url);window.setTimeout('ns_softclick_timer()',5000);ns_i.onload=ns_i.onerror=window.ns_softclick_timer;}else{window.open(url,target,winopt);}}ns_i.src=ns_l;return false;}

/* MetriWeb Javascript file */
/* Version 4.5.2 -- 2008-01-19 */

/* Please, do NEVER modify this monitored file! */


var mw=new Object();

mw.V="4.5.2";
mw.i=new Image();
mw.p=0;
mw.l=0;
mw.D=".metriweb.be";
mw.W=function(u1,u2)
{
	if(mw.l){
		if(mw.l++>1){
			var nS=document.createElement("script");
			nS.setAttribute("src", u1+"sd"+u2);
			document.getElementsByTagName("head").item(0).appendChild(nS);
		}else if(mw.i.width!=1){
			var nS=document.createElement("script");
			nS.setAttribute("src", u1+"td"+u2);
			document.getElementsByTagName("head").item(0).appendChild(nS);
		}
	}else{
		mw.i.src=u1+"dyn"+u2;
		if(!mw.p){
			var oL=window.onload;
			if(typeof window.onload!='function') window.onload=function(){mw.l++;mw.W(u1,u2)}
			else window.onload=function(){mw.l++;mw.W(u1,u2);oL()}
		}
	}
}
mw.n=function(d)
{
	var k="0000";
	var t=d.split(".");
	if(parseInt(k+t[t.length-1]))mw.d=d;
	else mw.d="."+t[t.length-2]+"."+t[t.length-1];
	t="charCodeAt(0)";
	var c=(k+eval("\""+mw.d.split("").join("\"."+t+"+\"")+"\"."+t));
	t=k+k+k+k+new Date().getTime();
	t=t.substr(t.length-16,16);
	return t.substr(0,13)+"."+t.substr(13,3)+c.substr(c.length-3,3)+".5";
}
mw.g=function(s,f)
{
	var c;
	var o=document.cookie.indexOf(s+"=");
	if(o<0){
		c=f(document.domain);
		document.cookie=s+"="+c+"; domain="+mw.d+"; path=/; expires="+
			new Date(new Date().getTime()+365*24*3600000).toGMTString()+";";
	}else{
		var e=document.cookie.indexOf(";",o);
		if(e<0)e=document.cookie.length;
		c=document.cookie.substring(o+4,e);
	}
	return c;
}
mw.H=function()
{
	document.getElementById("metriwebLayer").style.visibility="hidden";
}
mw.c=mw.g("mwc",mw.n);

function metriwebTag (tag,keyword,extra,refresh)
{
	mw.W('https://'+tag+mw.D+'/','/'+tag+'/mw.cgi?page='+keyword+
		(extra?('&q='+extra):'')+(refresh?('&s='+refresh):'')+
		'&c='+mw.c+'&v='+mw.V+'&p='+mw.p+'&d='+new Date().getTime()+'&R='+Math.random());
	mw.p++;
}

/* (c) 2000-2008, DouWÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¨re */


var state = 0;
function selectAll(formName){
var cbTotal = document[formName].elements.length;
for (var i=0;i<cbTotal;i++) {
if (state == 0){
selectElement(document[formName].elements[i], true);
}
else{
selectElement(document[formName].elements[i], false);
}
}
if (state == 0){
state = 1;
document.getElementById('A').style.display="none";
document.getElementById('B').style.display="block";
}
else{
state = 0;
document.getElementById('A').style.display="block";
document.getElementById('B').style.display="none";
}
}
function selectElement(element, value) {
if (element.disabled != true) {
element.checked = value;
}
}



/*@cc_on
  @if (@_jscript_version >= 5)
@*/
if(typeof ns_API=="undefined"){var ns_API={loadEvents:[],reservedLabels:new RegExp(/^\s*(ns\_.*|agent|availscreen|colordepth|cookie|corporate|day|full\_loading\_time|html\_loading\_time|httpreferer|innersize|ip|java|lang|mimetypes|name|newcookie|offset|or|outersize|p|pie|plugins|referrer|screen|site|\_t|time|type|url|ver)\s*$/i),regCounter:new RegExp(/(?:https?):\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/s\?([\w_\-\.\[\]\(\)\$\~\{\}\*\^\,]{1,200})/)}}if(typeof ns_API.addEvent=="undefined"){ns_API.addEvent=(document.addEventListener)?(function(a,c,b){a.addEventListener(c,b,false)}):(document.attachEvent)?(function(a,c,b){a.attachEvent("on"+c,b)}):new Function}if(typeof ns_API.isIE=="undefined"){ns_API.isIE=
/*@cc_on!@*/
false}if(typeof ns_API.isIE7=="undefined"){ns_API.isIE7=(ns_API.isIE&&/MSIE\s*([7-9]|[1-9]\d+)/i.test(navigator.userAgent))?true:false}if(typeof ns_API.getJSPageURL=="undefined"){ns_API.getJSPageURL=function(){return(document.URL)?document.URL:document.location.domain+document.location.pathname+document.location.search}}if(typeof ns_API.onDocumentReady=="undefined"){ns_API.onDocumentReady=function(c){try{if(/webkit/i.test(navigator.userAgent)){var b=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(b);c()}},10)}else{if(ns_API.isIE){var f="__ie_onload_"+new Date().getTime();document.write("<script id='"+f+"' defer='defer'><\/script>");var a=document.getElementById(f);a.onreadystatechange=function(){if(/complete/i.test(this.readyState)){c();this.parentNode.removeChild(this)}}}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",c,false)}else{ns_API.addEvent(window,"load",c)}}}}catch(d){ns_API.addEvent(window,"load",c)}}}if(typeof ns_API.addLoadEvent=="undefined"){ns_API.addLoadEvent=function(a){ns_API.loadEvents.push(a)};ns_API.onDocumentReady(function(){for(var a=0,b;(b=ns_API.loadEvents[a]);a++){if(b instanceof Function){b()}}})}if(typeof ns_API.constructLabel=="undefined"){ns_API.constructLabel=function(a){return a.replace(/[^\-_\.a-zA-Z0-9]/g,"___")}}if(typeof ns_API.startTime=="undefined"){ns_API.startTime=(typeof ns_loadingtime1!="undefined"&&!isNaN(parseInt(ns_loadingtime1)))?ns_loadingtime1:ns_API.addLoadEvent(function(){ns_API.startTime=new Date().getTime()})}if(typeof ns_API.log=="undefined"){ns_API.log=function(a,e,d){var b=++ns_API.log.totalLogs+":"+new Date().getTime();var f=new Image();var c=function(){if(ns_API.log.timerItems[b]){window.clearTimeout(ns_API.log.timerItems[b]);delete ns_API.log.timerItems[b]}if(d&&d instanceof Function){d()}delete ns_API.log.logImages[b];f.onload=f.onerror=f.onabort=new Function};f.onload=f.onabort=f.onerror=c;ns_API.log.timerItems[b]=window.setTimeout(c,e);f.src=a};ns_API.log.logImages={};ns_API.log.timerItems={};ns_API.log.totalLogs=0;
/*@end
@*/
};/*@cc_on
  @if (@_jscript_version >= 5)
@*/
ns_API.forms={DEBUG:false,isProtoTyped:false,NORMALNAMEPREFIX:"ns_fo_fn",NORMALVALUEPREFIX:"ns_fo_fv",HIDDENNAMEPREFIX:"ns_fo_hn",HIDDENVALUEPREFIX:"ns_fo_hv",PASSWORDNAMEPREFIX:"ns_fo_pn",PASSWORDVALUEPREFIX:"ns_fo_pv",RESERVEDPREFIX:"ns_fo_",instances:[],isRegistered:function(a){var d=false;for(var c=0,b;!d&&(_form=this.instances[c]);c++){if(a==b){d=true}}if(!d){this.instances.push(a)}return d},getInstanceByForm:function(c){if((typeof c).toLowerCase()=="object"){for(var b=0,a;(a=this.instances[b]);b++){if(a.form==c){return a}}}else{if((typeof c).toLowerCase()=="string"){for(var b=0,a;(a=this.instances[b]);b++){if(a.formName==c){return a}}}}},dispatchValidationError:function(d,b,c,f,e,g){var a=this.getInstanceByForm(d);if(a.hasValidationError){return}if(a instanceof ns_API.form){a.onError.apply(a,Array.prototype.slice.call(arguments,1))}},dispatchSubmitEvent:function(b){var a=this.getInstanceByForm(b);if(a instanceof ns_API.form){a.onSubmit.apply(a)}}};ns_API.forms.exception=function(){this.totalErrors=0;this.errorField=null;this.msg="";this.overview={}};var ns_p=ns_API.forms.exception.prototype;ns_p.append=function(b,d){var a=b.split(";");if(a.length<0){return}this.errorField=a[a.length-1];this.msg=d;for(var c=0,b;(field=a[c]);c++){field=(c+1)+"_"+field.toLowerCase();if(this.overview[field]){this.overview[field]++}else{this.overview[field]=1}}this.totalErrors++};ns_p.getOverview=function(){var a=[];for(var b in this.overview){a.push(b+":"+this.overview[b])}return a};ns_p.getLastErrorField=function(){return this.errorField};ns_p.getTotalErrors=function(){return this.totalErrors};ns_p.getLabels=function(b){var a=[];if(this.getOverview().join("|")!=""){a.push(ns_API.forms.RESERVEDPREFIX+"vfo="+this.getOverview().join("|"))}if(this.errorField){a.push(ns_API.forms.RESERVEDPREFIX+"vfl="+this.errorField.toLowerCase())}if(this.totalErrors>0){a.push(ns_API.forms.RESERVEDPREFIX+"vf="+this.totalErrors)}a.push(ns_API.forms.RESERVEDPREFIX+"vfe="+escape(this.msg.substring(0,255)));return a};ns_API.form=function(a,b){this.autoEvents=(b==null)?true:Boolean(b);this.MAXFIELDSIZE=255;this.version="1.2.3";this.formName=(typeof a=="string")?a:null;this.form=((typeof a=="object")&&/^form$/i.test(a.tagName))?a:null;this.url=null;this.sequence=1;this.id=null;this.isFormAbandoned=false;this.isFormActive=false;this.isFormSubmitted=false;this.hasValidationError=false;this.error=new ns_API.forms.exception();this.lastField=null;this.startTime=null;this.fields={SUBMIT:{NORMAL:"",HIDDEN:"",PASSWORD:""},SUBMITABANDON:{NORMAL:"",HIDDEN:"",PASSWORD:""},SUBMITVALFAIL:{NORMAL:"",HIDDEN:"",PASSWORD:""}};this.init()};ns_p=ns_API.form.prototype;ns_p.init=function(){var a=this;try{if(this.form==null){if(!this.formName){throw"Please secify the name of the form to be measured"}if(document.forms[this.formName]){this.form=document.forms[this.formName]}else{if(document.getElementById(this.formName)&&/^form$/i.test(document.getElementById(this.formName).tagName)){this.form=document.getElementById(this.formName)}else{throw"Form not found on page ["+this.formName+"]"}}}else{if(this.form.name!=""){this.formName=this.form.name}else{this.formName="unnamed"}}if(ns_API.forms.isRegistered(this)){throw"Form already registered by ns_API"}this.id=escape(this.formName)+"_"+new Date().getTime();this.addEvents();if(typeof HTMLFormElement!="undefined"&&!ns_API.forms.isProtoTyped&&this.autoEvents){ns_API.forms.isProtoTyped=true;this.form.oldOnSubmit=this.form.onsubmit;HTMLFormElement.prototype.ns_submit=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(((this.oldOnSubmit!=null)&&(this.oldOnSubmit()!=false))||(this.oldOnSubmit==null)){var c=ns_API.forms.getInstanceByForm(this);if(c){c.isFormSubmitted=true;c.onSubmit()}this.ns_submit()}else{return false}}}else{if(ns_API.isIE&&this.autoEvents){this.form.oldOnSubmit=this.form.onsubmit;this.form.onsubmit=function(){if(((this.oldOnSubmit!=null)&&(this.oldOnSubmit()!=false))||(this.oldOnSubmit==null)){var c=ns_API.forms.getInstanceByForm(this);if(c){c.isFormSubmitted=true;c.onSubmit()}}else{return false}}}}try{this.url=window.ns_pixelUrl.match(ns_API.regCounter)[0]}catch(b){}}catch(b){this.throwException(b)}};ns_p.paramToFieldList=function(b,a){return(b)?/\s*\*\s*/.test(b)?(a)?"*":null:b.replace(/\s*([^;\s]+)\s*(;?)/g,"$1$2"):null};ns_p.log=function(d,j){try{if(!ns_API.forms.DEBUG&&!ns_API.regCounter.test(this.url)){throw"Please specify a valid sitestat url"}j.push("ns_jspageurl="+ns_API.getJSPageURL());var f=[];for(var c=0;c<j.length;c++){if((typeof j[c]=="object")&&(j[c].constructor.toString().match(/array/i)!=false)&&(j[c][0]=="checkbox")&&(typeof c=="number")){var h=j[c][1].split("=");if(f[h[0]]==null){f[h[0]]=h[1]}else{f[h[0]]+=","+h[1]}j.splice(c,1);c--}}for(var c in f){if(typeof f[c]=="string"){j.push(c+"="+f[c].substring(0,this.MAXFIELDSIZE))}}var a=false,b=(ns_API.isIE)?new Image():document.body.appendChild(document.createElement("img"));window.ns_forms_timer=function(i,e){return function(){e=true;if(window.ns_forms_timer_id){window.clearTimeout(window.ns_forms_timer_id)}i.onload=i.onerror=function(){return}}}(b,a);window.ns_forms_timer_id=window.setTimeout("window.ns_forms_timer()",5000);b.onload=b.onerror=window.ns_forms_timer;b.src=this.url+j.join("&");this.sequence++}catch(g){this.throwException(g)}};ns_p.addSubmitEvent=function(d,c,a){if(!this.form){return}var b=this;this.fields.SUBMIT.normal=this.paramToFieldList(d,true);this.fields.SUBMIT.hidden=this.paramToFieldList(c,true);this.fields.SUBMIT.password=this.paramToFieldList(a,true);if(this.autoEvents){ns_API.addEvent(this.form,"submit",function(){b.onSubmit.apply(b,arguments)})}};ns_p.addAbandonEvent=function(d,c,a){if(!this.form){return}var b=this;this.fields.SUBMITABANDON.normal=this.paramToFieldList(d);this.fields.SUBMITABANDON.hidden=this.paramToFieldList(c);this.fields.SUBMITABANDON.password=this.paramToFieldList(a);if(ns_API.isIE){ns_API.addEvent(window,"beforeunload",function(){b.onAbandon.apply(b,arguments)})}else{ns_API.addEvent(window,"unload",function(){b.onAbandon.apply(b,arguments)})}};ns_p.onError=function(e,b,d,c,a){this.error.append(e,b);this.fields.SUBMITVALFAIL.normal=this.paramToFieldList(d,true);this.fields.SUBMITVALFAIL.hidden=this.paramToFieldList(c);this.fields.SUBMITVALFAIL.password=this.paramToFieldList(a);this.hasValidationError=true;this.log("submitvalfail",this.getFormLabels("submitvalfail"))};ns_p.onSubmit=function(b){if(!this.isFormActive||this.hasValidationError||this.isFormAbandoned){return}this.isFormSubmitted=true;this.isFormActive=false;var a=this;if(ns_API.isIE||!this.autoEvents||window.opera){this.log("submit",this.getFormLabels("submit"))}else{ns_API.addEvent(window,"unload",function(){a.log.call(a,"submit",a.getFormLabels("submit"))})}};ns_p.onAbandon=function(){if(this.isFormSubmitted||!this.isFormActive||this.isFormAbandoned){return}this.isFormAbandoned=true;this.log("submitabandon",this.getFormLabels("submitabandon"))};ns_p.getFormLabels=function(d,k){if(!/^(submitabandon|submit|submitvalfail)$/i.test(d)){return}d=d.toLowerCase();if(this.lastField&&/option/i.test(this.lastField.tagName)){this.lastField=this.lastField.parentNode}var b=new Date().getTime(),s=["&type=hidden","ns_fo_ev="+d,ns_API.forms.RESERVEDPREFIX+"id="+this.id,ns_API.forms.RESERVEDPREFIX+"la="+escape((this.lastField&&this.lastField.name)?this.lastField.name.toLowerCase():""),ns_API.forms.RESERVEDPREFIX+"sq="+this.sequence,ns_API.forms.RESERVEDPREFIX+"t0="+((typeof ns_API.startTime=="number")?b-ns_API.startTime:null),ns_API.forms.RESERVEDPREFIX+"t1="+((this.startTime)?b-this.startTime:null)].concat((k&&k instanceof Array)?k:[]).concat(this.error.getLabels(d));this.writeDebugStatement("<b>event</b>&nbsp;[<font color='green'>"+d+"</font>]");this.writeDebugStatement("<b>default labels:</b><br><font color='steelblue'>"+s.join("<br>")+"</font>");var f=new RegExp(),j=this.fields[d.toUpperCase()],c="";var r=[],m=[],o=[];var q=[],h=[],n=[];for(var l=0,a,g,p,e;(a=this.form[l]);l++){if(!a.name||!a.type){continue}if(a.type=="radio"&&c.indexOf(a.name)>-1){continue}e=this[a.type.replace(/\-/g,"_")+"Value"];p=a.name.replace(/([\$\[\]])/g,"\\$1");f.compile(p+";?","i");if((a.type=="hidden"&&(!!j.hidden&&(/^(submit|submitvalfail)$/i.test(d)&&j.hidden=="*")||f.test(j.hidden)))||(a.type=="password"&&(!!j.password&&(/^(submit|submitvalfail)$/i.test(d)&&j.hidden=="*")||f.test(j.password)))||((/^(submit|submitvalfail)$/i.test(d)&&j.normal=="*")||f.test(j.normal))){if(e instanceof Function){g=e.call(this,a);this.writeDebugStatement("<font color='steelblue'>called getFormLabel:</font><b>"+a.name+"</b>:<i>"+a.type+"</i>&nbsp;(<font color='green'>"+g+"</font>)");if(g){switch(a.type){case"hidden":m[m.length]=g.substring(0,g.indexOf("="));h[h.length]=g.substring(g.indexOf("=")+1);continue;case"password":o[o.length]=g.substring(0,g.indexOf("="));n[n.length]=g.substring(g.indexOf("=")+1);continue;default:if(typeof g=="string"){r[r.length]=g.substring(0,g.indexOf("="));q[q.length]=g.substring(g.indexOf("=")+1);continue}else{if(typeof g=="object"){r[r.length]=g[1].substring(0,g[1].indexOf("="));q[q.length]=g[1].substring(g[1].indexOf("=")+1)}}}}if(a.type=="radio"){c+=a.name+";"}}}}s.push(ns_API.forms.NORMALNAMEPREFIX+"="+r.join(";"));s.push(ns_API.forms.NORMALVALUEPREFIX+"="+q.join(";"));s.push(ns_API.forms.PASSWORDNAMEPREFIX+"="+o.join(";"));s.push(ns_API.forms.PASSWORDVALUEPREFIX+"="+n.join(";"));s.push(ns_API.forms.HIDDENNAMEPREFIX+"="+m.join(";"));s.push(ns_API.forms.HIDDENVALUEPREFIX+"="+h.join(";"));return s};ns_p.throwException=function(a){if(ns_API.forms.DEBUG){alert("Form API\n"+(a.message||a))}};ns_p.addEvents=function(){var a=this;ns_API.addEvent(this.form,"keydown",function(b){b=b||window.event;if(b.ctrlKey||b.altKey||b.shiftKey){return}a.onUserEvent.call(a,b,b.srcElement||b.target)});ns_API.addEvent(this.form,"mousedown",function(b){b=b||window.event;a.onUserEvent.call(a,b,b.srcElement||b.target)})};ns_p.onUserEvent=function(b,a){if(!(a&&a.form&&a.form==this.form)){return}if(a.type!="submit"){this.lastField=a}this.isFormSubmitted=false;this.hasValidationError=false;this.isValidated=true;if(!/^(input|textarea|select|option)$/i.test(a.tagName)||this.isFormActive){return}this.onStart()};ns_p.onStart=function(a){this.isFormActive=true;this.startTime=new Date().getTime();this.writeDebugStatement("<font color='red'>start of form <i>"+this.formName+"</i>:</font> "+new Date(this.startTime).toGMTString())};ns_p.writeDebugStatement=function(b){if(!ns_API.forms.DEBUG){return}var a=(top.debugWindow)?top.debugWindow.document.getElementById("debug"):document.getElementById("debug");if(a){a.innerHTML=b+"<hr>"+a.innerHTML}};ns_p.getScriptVersion=function(){return this.version};ns_p.getURL=function(){return this.url};ns_p.setURL=function(a){this.url=a};ns_p.setMaxFieldSize=function(a){a=a||0;this.MAXFIELDSIZE=(!isNaN(parseInt(a))&&parseInt(a)>0)?a:this.MAXFIELDSIZE};ns_p.select_oneValue=function(a){return ns_API.constructLabel(a.name.toLowerCase())+"="+escape(a.options[a.selectedIndex].value.substring(0,this.MAXFIELDSIZE))};ns_p.select_multipleValue=function(d){var a=[];for(var c=0,b;(option=d.options[c]);c++){if(option.selected){a.push(ns_API.constructLabel(d.name.toLowerCase())+"="+escape(option.value.substring(0,this.MAXFIELDSIZE)))}}return a.join("&")};ns_p.textValue=function(a){return ns_API.constructLabel(a.name.toLowerCase())+"="+escape(a.value.substring(0,this.MAXFIELDSIZE))};ns_p.textareaValue=function(a){return this.textValue(a)};ns_p.radioValue=function(d){var c="";for(var b=0,a;(a=d.form[d.name][b]);b++){if(a.checked){c=a.value;break}}return ns_API.constructLabel(d.name.toLowerCase())+"="+escape(c.substring(0,this.MAXFIELDSIZE))};ns_p.checkboxValue=function(a){if(a.checked){return["checkbox",ns_API.constructLabel(a.name.toLowerCase())+"="+escape(a.value.substring(0,this.MAXFIELDSIZE))]}};ns_p.hiddenValue=function(a){return ns_API.constructLabel(a.name.toLowerCase())+"="+escape(a.value.substring(0,this.MAXFIELDSIZE))};ns_p.passwordValue=function(a){return ns_API.constructLabel(a.name.toLowerCase())+"="+((a.value=="")?"no":"yes")};
/*@else 
  var ns_API = {};
  ns_API.form = function() {};
  ns_API.form.prototype.addSubmitEvent  = function() {};
  ns_API.form.prototype.addAbandonEvent = function() {};
  ns_API.forms = function() {};
  ns_API.forms.prototype.dispatchValidationError = function() {};
  @end
@*/

