/*@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(a!=encodeURIComponent(a)) return encodeURIComponent(a);
		else return a;
	}
}
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,myId)
{
	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=myId? myId: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"
		}
		if (this.id) this.id = escape(this.id) + "_" + new Date().getTime();			// mod id
        else 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		// leerzeichen entfernen
	return(b)?/\s*\*\s*/.test(b)?(a)?"*":null:b.replace(/\s*;\s*/g,";"):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.title)?this.lastField.title.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.title||!a.type)
		{
			continue
		}
		if(a.type=="radio"&&c.indexOf(a.title)>-1)
		{
			continue
		}
		e=this[a.type.replace(/\-/g,"_")+"Value"];
		p=a.title.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.title+"</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.title+";"
				}
			}
		}
	}
	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.title.toLowerCase())+"="+encodeURIComponent(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.title.toLowerCase())+"="+encodeURIComponent(option.value.substring(0,this.MAXFIELDSIZE)))
		}
	}
	return a.join("&")
};
ns_p.textValue=function(a)
{
	return ns_API.constructLabel(a.title.toLowerCase())+"="+encodeURIComponent(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.title.toLowerCase())+"="+encodeURIComponent(c.substring(0,this.MAXFIELDSIZE))
};
ns_p.checkboxValue=function(a)
{
	if(a.checked)
	{
		return["checkbox",ns_API.constructLabel(a.title.toLowerCase())+"="+encodeURIComponent(a.value.substring(0,this.MAXFIELDSIZE))]
	}
};
ns_p.hiddenValue=function(a)
{
	return ns_API.constructLabel(a.title.toLowerCase())+"="+encodeURIComponent(a.value.substring(0,this.MAXFIELDSIZE))
};
ns_p.passwordValue=function(a)
{
	return ns_API.constructLabel(a.title.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 @*/
