var cName = 'ng4adnetcook';
var nSrc = 'http://adnet.nuggad.net/rc?nuggn=413847152';
var na_prof = '';

function rC(){
	if(document.cookie){
		tV = document.cookie;
		if(tV.indexOf(cName+"=")!=-1){
			p1 = tV.indexOf(cName+"=");
			p2 = tV.indexOf(",cookEnd");
			na_prof = tV.slice(p1+cName.length+1,p2);
		}
	}
}
rC();

  function setNuggCookie(N,V,L){
	  now=new Date();
	  tout=new Date(now.getTime()+L*86400000);
	  document.cookie=N+"="+V+",cookEnd;expires="+tout.toGMTString()+";";
  }

function inNugg() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if (_timer) {
		clearInterval(_timer);
		_timer = null;
	}
	if(document.createElement && document.childNodes ) {
		var nSc = document.createElement('script');
		nSc.setAttribute('src',nSrc);
		nSc.setAttribute('type','text/javascript');
		document.getElementsByTagName('head')[0].appendChild(nSc);
	}
}

if(na_prof === '') {
	if (document.addEventListener) {
		document.addEventListener("DOMContentLoaded", inNugg, false);
	}
	if (/WebKit/i.test(navigator.userAgent)) {
		var _timer = setInterval(function() {
			if (/loaded|complete/.test(document.readyState)) {inNugg();}
		}, 10);
	}
	/*@cc_on @*/
	/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			inNugg(); //
		}
	};
	/*@end @*/
	window.onload = inNugg;
}
