<!--

var xmlhttp=null;
var rpts=0;
var coid=null;
var st1 = new Image(); st1.src = "/g/g_star_on.gif";
var st2 = new Image(); st2.src = "/g/g_star_out.gif";
var st3 = new Image(); st3.src = "/g/g_comment.gif";
var st4 = new Image(); st4.src = "/g/up_a.gif";
var st5 = new Image(); st5.src = "/g/dn_a.gif";
var st6 = new Image(); st6.src = "/g/re_a.gif";

var bonce = false;
var fonce = false;

function centerXY(wdt,hgt){var xp=0,yp=0,txt;
if((parseInt(navigator.appVersion)>=4)){xp=(screen.width-wdt)/2;yp=(screen.height-hgt)/2;}
txt=',height='+hgt+',width='+wdt+',screenx='+xp+',screeny='+yp+',left='+xp+',top='+yp; return(txt);}

function rbox(url){window.open('/'+url,"rwin","location=0,status=0,scrollbars=0"+centerXY(350,300));}

function check1(){
if(document.login_form.l_username.value.length==0 || document.login_form.l_password.value.length==0){alert('Prosím zadajte prihlasovacie meno / heslo!'); return false;} else {return true;}
}

function not_member(){
alert('Ľutujeme ale nie ste prihlásený!\n\nAk chcete použiť túto funkciu, musíte sa prihlásiť.\n\nAk nie ste naším členom, tak sa ním môžete stať po kliknutí na odkaz "registrácia" hore vpravo.');
}

function getobj(id){
if(document.getElementById)var rvar=document.getElementById(id);
else if(document.all)var rvar=document.all[id];
else if(document.layers)var rvar=document.layers[id];
return rvar;
}


function xmlreq(a,b){
if(window.XMLHttpRequest)xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

if(xmlhttp!=null){
if(b==0)xmlhttp.onreadystatechange=fav; else
if(b==1)xmlhttp.onreadystatechange=rfav; else
if(b==2)xmlhttp.onreadystatechange=editcom; else
if(b==3)xmlhttp.onreadystatechange=rfav; else
if(b==4)xmlhttp.onreadystatechange=copy2layer; else
if(b==5)xmlhttp.onreadystatechange=copy2layer; else
if(b==6)xmlhttp.onreadystatechange=tfr; else
if(b==7)xmlhttp.onreadystatechange=rfav; else
if(b==8)xmlhttp.onreadystatechange=h_pform; else
if(b==9)xmlhttp.onreadystatechange=rmsg;

    if(b==3 || b==5 || b==6 || b==8){

    xmlhttp.open('POST','http://www.mojevideo.sk/f_xmlhttp.php',true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.setRequestHeader("Content-length", a.length);
    xmlhttp.setRequestHeader("Connection", "close");
    xmlhttp.send(a);

    } else {

    xmlhttp.open('GET','http://www.mojevideo.sk/f_xmlhttp.php?p='+ a +'&rnd='+ Math.random() +'',true);
    xmlhttp.send(null);

    }


}   else alert("Váš prehliadač nepodporuje XMLHTTP. Prosím stiahnite si novší!\nNapríklad FireFox -> www.getfirefox.com");
}

function fav(){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){
       var x=getobj("favtxt");
        if(x!=null) x.innerHTML = 'pridané!'; else alert('Problém pri čítaní XMLHTTP.');
   }  else    alert("Problém pri čítaní XMLHTTP.");
}
}

function rmsg(){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){
        var x=getobj("pbox");x.innerHTML=xmlhttp.responseText;
        var x=getobj("newmess");x.style.visibility='hidden';        
        pm();
   }  else alert("Problém pri čítaní XMLHTTP.");
}
}

function rfav(){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){

reurl=unescape(window.location);
window.location=reurl;


} else    alert("Problém pri čítaní XMLHTTP.");
}}

function copy2layer(){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){
       var x=getobj("comlayer");
       if(x!=null){
        var rptxt=xmlhttp.responseText;var xp=rptxt.indexOf(';');rpts=rptxt.substr(0,xp);x.innerHTML =rptxt.substr(xp+1);
       }else alert('Problém pri čítaní XMLHTTP.');
   }  else    alert("Problém pri čítaní XMLHTTP.");
}}

function tfr(){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){
       var x=getobj("wr" + coid);
       if(x!=null){
        x.innerHTML ='<div style="float:right;font-size:10px;color:#ffffff;padding-right:4px">ďakujeme za hodnotenie!</div>';
       }else alert('Problém pri čítaní XMLHTTP.');
   }  else    alert("Problém pri čítaní XMLHTTP.");
}}


function rate_video(pts){
if(window.XMLHttpRequest)xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if(xmlhttp!=null){xmlhttp.onreadystatechange=closerate;
xmlhttp.open('GET','http://www.mojevideo.sk/g_rated.php?xid='+ rxid +'&pts='+ pts +'&vid='+ rvid + '',true);
xmlhttp.send(null);}}

function closerate(){var date = new Date();
date.setTime(date.getTime()+(365*24*3600*1000));
document.cookie = "rated_video_"+ rvid +"=1; expires=" + date.toGMTString() + '; path=/';
var x=getobj('stars');x.innerHTML='<img width="113px" height="21px" src="/g_rated.php?rating='+ rvid +'">';
var x=getobj('ratedvideo');x.innerHTML='ďakujeme!';
}


function sucom(fobj,re){
var msg=document.comment_form.message.value;
if(document.comment_form.message.value.length==0){
alert('Chyba: zadali ste prázdny komentár!');
document.comment_form.message.focus();
} else {
xmlreq('p='+ra+'&t='+encodeURIComponent(msg)+'&re='+re,5);
hideCom(fobj);
}
}

function rcom(va,cid){xmlreq('p='+va,6);coid=cid;}

function von(img_name,n){
var rates=new Array("úbohé","nič moc","priemerné","dobré","perfektné");
for(i=0;i<(n+1);i++){
img_name='s'+i;
document[img_name].src = '/g/g_star_on.gif';
}
var x=getobj('ratedvideo');
if(bonce==false){ bratings = x.innerHTML;bonce=true; }
x.innerHTML='(' + rates[n] + ')';
}

function vout(){
var img_name;
for(i=0;i<5;i++){
img_name='s'+i;
document[img_name].src = '/g/g_star_out.gif';
}
var x=getobj('ratedvideo');
x.innerHTML=bratings;
}

function hideCom(fobj){
if(fobj==0)var x=getobj("dyc"); else var x=getobj(fobj);
x.innerHTML='';}

function showCom(fobj,re,nod){
if(rpts>0){hideCom(0);for(q=0;q<rpts;q++)hideCom('rpt'+q+'');}
if(fobj==0){
var x=getobj("dyc");
x.innerHTML='<div style="padding:5px 15px 2px 15px;"><form method="post" accept-charset="utf-8" name="comment_form" style="margin:0px;padding:0px;"><div style="font-size:10px;font-weight:bold;color:#ffffff;line-height:17px">komentár:<a href="javascript:hideCom(0);" style="display:block;color:#c00000;float:right;text-decoration:none">zavrieť</a></div><div><textarea style="border: #ffb510 1px solid; width:520px; background: #141b28; color: #ffffff; font-size: 11px; font-family:Verdana; overflow: auto; padding-left:2px;" rows="6" name="message"></textarea></div><div style="padding:8px 0 0 0"><a href="javascript:javascript:sucom(\'dyc\',0);"><img src="/g/g_addcomment.png" width="91px" height="17px" border="0"></a></div></form></div>';
} else {
var x=getobj(fobj);var mtit='vaša odpoveď';var hc='\''+fobj+'\'';
x.innerHTML='<div style="padding:0 0 0 5px;"><form method="post" accept-charset="utf-8" name="comment_form" style="margin:0px;padding:0px;"><table bgcolor="#000000" cellpadding="0" cellspacing="0"><tr><td><div><div style="float:left"><b>'+mtit+':</b></div><div style="float:right;"><img src="/g/discard.png" border="0"><a href="javascript:hideCom('+hc+');">zavrieť</a></div></td></tr><tr><td><textarea style="border: #ffb510 1px solid; background-color: #171b1e; color: #ffffff; font-size: 11px; font-family:Verdana; width:'+(510-nod*20)+'px; overflow: auto; padding-left:2px;padding-right:2px" rows="7" name="message"></textarea></td></tr><tr><td style="padding:8px 0 16px 0"><a href="javascript:sucom('+hc+','+re+');"><img src="/g/g_addcomment.png" width="91px" height="17px" border="0" /></a></td></tr></table></form></div>';
}

}

if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {

		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {

			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}


deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else {
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}

deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}

deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}

if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}

if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;


function plv(v,rurl,adult,vol,w,h,div){

 var so = new SWFObject("/vp.swf", "myvideo", w, h, "9", "#000000");
    so.addParam("allowfullscreen", "true");
    so.addParam("wmode", "transparent");
    so.addParam("quality", "high");
    so.addVariable("v",v);
    so.addVariable("rurl",rurl);
    so.addVariable("adult",adult);
    so.addVariable("vol",vol);
    so.addVariable("width", w);
    so.addVariable("height", h);
    so.write(div);

    var x=getobj('fh');
    x.onmouseover = function() {
        var y=getobj('favtxt');
        if(fonce==false){ bfavorites = y.innerHTML; fonce=true; }
        y.innerHTML='k obľúbeným?';
        return true;
    }

}

function kp(id){ var x=getobj("rt"+id); x.innerHTML='dobrý príspevok';}
function km(id){ var x=getobj("rt"+id); x.innerHTML='zlý príspevok';}
function ko(id){ var x=getobj("rt"+id); x.innerHTML='hodnoť:';}

function pm(){

        var xScroll, yScroll, windowWidth, windowHeight;

		if (window.innerHeight && window.scrollMaxY) {
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		if (self.innerHeight) {
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth;
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		if(yScroll < windowHeight)pageHeight = windowHeight; else pageHeight = yScroll;
		if(xScroll < windowWidth)pageWidth = xScroll; else pageWidth = windowWidth;

        yp=window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

var y=getobj('ublack');
y.style.width=pageWidth + 'px';
y.style.height=pageHeight + 'px';
y.style.visibility="visible";

var y=getobj('pbox');
y.style.left=(windowWidth/2-223) + 'px';
y.style.top=yp +  (windowHeight / 2 - 110) + 'px';
y.style.visibility="visible";

}

function sp(re){
var y=getobj('pbox');
y.innerHTML='<div style="background-color:#2a3958;padding:4px"><ul style="list-style-type:none;padding:10px 20px 20px 20px;margin:0;background:#23304b;line-height:33px;color:#ffb103"><li>predmet:<span style="padding-left:340px"><a href="javascript:h_pform();"><img src="/g/button_close.png" align="middle" hspace="2"></a><a href="javascript:h_pform();">zavrieť</a></span><br><form name="postform"><input type="text" maxlength="32" style="border:#e6520a 1px solid; background:#181f2e; color: #ffffff; font-size: 11px; font-family:Verdana; width:240px; overflow: auto; padding:2px;" name="subj"><br>text správy:<br><textarea onkeyup="m_len(this, 1024);" style="width:460px;border: #e6520a 1px solid; background:#181f2e; color: #ffffff; font-size: 11px; font-family:Verdana; overflow: auto; padding:2px;" rows="9" name="mess"></textarea></form></li><li style="padding-top:10px"><a href="javascript:p_msg('+re+');"><img src="/g/button_send.png"></a></li></ul></div>';
pm();y.style.visibility='visible';
}

function p_rep(){
var d=document.postform;
if(d.mess.value.length<2)alert('Text odpovede musí byť dlhý minimálne 2 znaky!'); else xmlreq("p="+d.p.value+"&t="+encodeURIComponent(d.mess.value)+"", 8);
}

function p_msg(re){
var d=document.postform;
if(d.subj.value.length<2)alert('Predmet správy musí byť dlhý minimálne 2 znaky!');
else if(d.mess.value.length<2)alert('Text správy musí byť dlhý minimálne 2 znaky!');
else xmlreq("p="+uas+"&re="+re+"&s="+encodeURIComponent(d.subj.value)+"&t="+encodeURIComponent(d.mess.value)+"", 8);
}

function h_pform(){var x=getobj('pbox');x.style.visibility="hidden";var y=getobj('ublack');y.style.visibility="hidden";}

function m_len(obj, ml){
    if(obj.value.length > ml){
        obj.value = obj.value.substr(0, ml);
        alert('Prekročili ste maximálnu dĺžku textu ('+ml+' znakov)!');
    }

}

function act(i){
   var x = document.getElementById('mi1');x.setAttribute("class", "mid");x.setAttribute("className", "mid");
            if(i==1){ var x = document.getElementById('mi1');x.setAttribute("class", "mia");x.setAttribute("className", "mia"); showCom(0,0,0); }
    else    if(i==2){ var x = document.getElementById('mi2');x.setAttribute("class", "mia");x.setAttribute("className", "mia");x = getobj('dyc'); x.innerHTML='2'; }
    else    if(i==3){ var x = document.getElementById('mi3');x.setAttribute("class", "mia");x.setAttribute("className", "mia");x = getobj('dyc'); x.innerHTML='3'; }

}


//-->
