var cmbDone = 0;

function init() {
    // quit if this function has already been called
	if (arguments.callee.done) {
	    return;
	}
		
	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
		
	// kill the timer
	if (_timer) {
	    clearInterval(_timer);
		_timer = null;
	}
		
	ts = document.getElementById("sections");
	if(typeof(Ninbar) != "undefined") {
	    ninbar = new Ninbar();
		if(ninbar.headlineTicker != null) {
		    setTimeout("ninbar.headlineTicker.nextHeadline(1, 0)", 300 );
		} else {
		    if(ts) {
			    ts.style.display = "none";
			}
		}
	} else {
	    if(ts) {
		   ts.style.display = "none";
		}
	}
	
	var skipAds = 0;

	/*@cc_on @*/
	/*@if (@_win32)
	
	skipAds = 1;
	/*@end @*/
	
	// browser is not ie
	if( (typeof(adBucketInit) != "undefined") && (skipAds === 0) ) {
	    adsPainted = adBucketInit();
	}
		
	
	if(typeof(initScrollers) != "undefined") {
	    initScrollers();
	}
	
	if(typeof(cycloMaticInit) != "undefined") {
	    if (typeof TOTAL_IMAGES != "undefined") {
	        if(TOTAL_IMAGES > 0) {
	            cycloMaticInit();
	        }
	    }
	}
	
	if(typeof(myCounterInit) != "undefined") {
	    myCounterInit();
	}
	
	if(typeof(extInit) != "undefined") {
	    extInit();
	}

	if(typeof(addBookmarkLink) != "undefined") {
        addBookmarkLink();
    }
	
	if((typeof(zSr) != "undefined") && (zSr != null)) {
	    if(typeof(contentMatchBootstrap) != "undefined") {
	        contentMatchBootstrap();
			cmbDone = 1;
	    }
	}
	
};
	
/* for Mozilla */
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, null);
}

/* for Internet Explorer */
/*@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") {
			init(); // call the onload handler
		}
	};
/*@end @*/
	
/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 10);
}
