if (typeof($) == 'undefined'){
document.write('<scr'+'ipt src="'+cms_www+'/cms_js/jquery.js"></scri'+'pt>');
}

/*CONTACT US*/
function contactUs(e,mail){
	window.location.href = "mailto:"+e+"@"+mail;
}

/*ADD TO FAVORITES*/
/* Modified to support Opera */
function addToFavorites(){
	url = window.document.location;	
	title = window.document.title;
	
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

/*print article*/
function printArticle(artid){
	if (typeof(template_http_www) != 'undefined'){
	window.open(template_http_www+"/print/"+artid);
	}
}

/*menu selected item*/
function cms_ilykit_things(){
if (typeof(pgid) != 'undefined'){
	var pageActiveLink = document.getElementById('pg_'+pgid);
	if (pageActiveLink)
	pageActiveLink.parentNode.className='activePage';
}
		
var menuTags=document.getElementsByTagName("ul");
if (menuTags.length>0){
for(i=0;i<=menuTags.length-1;i++)
	{ 
	if (menuTags[i].id.indexOf('menu_')>-1)
	{
		var aTags=menuTags[i].getElementsByTagName("a");
		if (aTags.length>0){
		for (b=0;b<=aTags.length-1;b++)
			{
				aTags[b].parentNode.onclick = function(){
					document.location.href = this.childNodes[0].href;
					};
			}
		}
	}
}
}

jQuery.fn.noSelect=function(){var a='none';return this.bind('selectstart dragstart mousedown',function(){return false}).css({MozUserSelect:a,msUserSelect:a,webkitUserSelect:a,userSelect:a})};

if (page_url!='steunisraa')
$('#mainColumn').noSelect();
$(document).bind("contextmenu",function(e){return false;}); 
	   
if (top == self){
		/*checking counter*/
		if(typeof(cms_www)!="undefined" && document.getElementById('counterPlaceHolder')){
		var newCounter = document.createElement('iframe');
		newCounter.style.display = 'none';
		newCounter.src = cms_www+'/cms_plugins/counter/counter.php';
		document.body.appendChild(newCounter);
		}
	
	/*stats*/
	if (typeof(template) != "undefined"){
		var q="?t="+new Date();
		if (typeof(pgid) != "undefined")
		q +="&pgid="+pgid;
		if (typeof(artid) != "undefined")
		q+="&artid="+artid;
		if(typeof(auid) != "undefined")
		q+="&auid="+auid;	
		q += "&template="+template;
		var newStats = document.createElement('iframe');
		newStats.style.display = 'none';
		newStats.src = cms_www+'/cms_plugins/statistics/statistics.php'+q;
		document.body.appendChild(newStats);
	}
	
	/*function iframe*/
	var newIframe = document.createElement('iframe');
	if (typeof(fIframeShow) != 'undefined')
		newIframe.style.display = fIframeShow
		else
		newIframe.style.display = 'none';
		newIframe.id = 'fIframe';
		newIframe.name = 'fIframe';
		document.body.appendChild(newIframe);
}

if(document.getElementsByClassName('articleHits').length>0){
	var newHits = document.createElement('script');
		newHits.type = 'text/javascript';
		newHits.src = cms_www+'/cms_plugins/statistics/get_hits.js';
		document.body.appendChild(newHits);
}
}

if (window.addEventListener)
window.addEventListener("load", function(){cms_ilykit_things()},false)
else if (window.attachEvent)
window.attachEvent("onload", function(){cms_ilykit_things()})
else if (document.getElementById)
window.onload=function(){cms_ilykit_things()};
