function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}
}
function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
	return true;
	}
	else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else{
   		return false;
 	}
}

(function(){
 /*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand;
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */
		}
	}
	catch(oh){};
})();

function jsemail(email) {
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
}

function jsemail(email) {
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
}

function jsemaillink(email, link) {
	document.write('<a href="'+link+'">');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('</a>');
}

function jsmailto(emailto, email, classname) {
	document.write('<a href="');
	for(i=emailto.length-1; i>=0; i--)
		document.write(emailto.charAt(i));
	document.write('"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('</a>');
}
function jsmailto_orig(email, cim) {
	document.write('<a href="');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('">'+cim+'</a>');
}

function vidstat(vid) {
	var xmlHttpReq = false;
	if (window.XMLHttpRequest)
		xmlHttpReq = new XMLHttpRequest();
	// IE
	else if (window.ActiveXObject)
		xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	xmlHttpReq.open("POST", "vidstat.php", true);
	xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttpReq.onreadystatechange = function() {
		if (xmlHttpReq.readyState==4) {
			if (xmlHttpReq.status==200) {}
        	}
	}
	xmlHttpReq.send("vid="+vid);
}
vidt=[];
function getUpdate(typ,pr1,pr2,swf) {
	if (vidt[swf]==undefined) {
		vidt[swf]=[];
		vidt[swf]['send']=0;
	}
	if (typ=='load' && pr1==0 && vidt[swf]['send']==0) {
		vidt[swf]['send']=1;
		var s=swf.split('|');
		vidstat(s[0]);
	}
}

villogok=[];
villogasstatusz=false;
function villogas(){
	for(var i=0; i<villogok.length; i++) {
		villogok[i].style.visibility=villogasstatusz ? '' : 'hidden';
	}
	villogasstatusz=!villogasstatusz;
}
function villogasinit(){
	var tags=document.getElementsByTagName("span");
	for(var i=0; i<tags.length; i++){
		if(tags[i].className=="villogo"){
			villogok[villogok.length]=tags[i];
		}
	}
	setInterval("villogas()", 500);
}
addEvent(window, 'load', villogasinit);

