if (top.location != self.location) { top.location = self.location.href; }

function videohirdeto() {}
var SLsystem={

isdefined:function(variable) {
return (typeof(window[variable]) == "undefined")?  false: true;
},

setsessioncookie:function(cookieName, cookieValue) {
document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/" + "; domain=.filmhirado.hu";
return true;
},

setsavedcookie:function (CookieName, CookieValue, periodType, offset) {

var expireDate = new Date ();
offset = offset / 1;
  
var myPeriodType = periodType;
switch (myPeriodType.toLowerCase()) {
case "years":
expireDate.setYear(expireDate.getFullYear()+offset);
break;
case "months":
expireDate.setMonth(expireDate.getMonth()+offset);
break;
case "days":
expireDate.setDate(expireDate.getDate()+offset);
break;
case "hours":
expireDate.setHours(expireDate.getHours()+offset);
break;
default:
expireDate.setMinutes(expireDate.getMinutes()+offset);
break;
} 
  
document.cookie = escape(CookieName ) + "=" + escape(CookieValue) + "; expires=" + expireDate.toGMTString() + "; path=/" + "; domain=.filmhirado.hu";
},

getcookievalue:function (cookieName) {
var exp = new RegExp (escape(cookieName) + "=([^;]+)");
if (exp.test (document.cookie + ";")) {
exp.exec (document.cookie + ";");
return unescape(RegExp.$1);
}
else return false;
},

deletecookie:function (cookieName) {
if (SLgetcookievalue (cookieName)) SLsetsavedcookie (cookieName,"0","years", -1);  
return true;     
},

urlencode:function(str) {
str = escape(str);
str = str.replace("+", "%2B");
str = str.replace("%20", "+");
str = str.replace("*", "%2A");
str = str.replace("/", "%2F");
str = str.replace("@", "%40");
return str;
},

datatodiv:function(http_request, divid, msg, after) {

var error=0;
if (http_request.readyState == 4 && http_request.status==200) {
var res=http_request.responseText;
if (res) {
if (res.length>1 && document.getElementById(divid)) {
document.getElementById(divid).innerHTML=res;
if (after.length>0) {
eval(after);
}
}
} else {
error=1;
}
} else {
//error=1;
}
if (error==1) {
if (document.getElementById(divid)) {
document.getElementById(divid).innerHTML=msg;
}
}

},

datatoeval:function(http_request, after) {

var error=0;
if (http_request.readyState == 4 && http_request.status==200) {
var res=http_request.responseText;
if (res) {
if (res.length>1) {
after=after.replace(/RESULT/g, res);
eval(after);
}
} else {
error=1;
}
} else {
//error=1;
}
if (error==1) {
//on error!!!
}

},

loadedobjects:"-",
loadnext:"0",

extloadfile:function(fileType,fileName,requestType,loadAfter) {
if (!document.getElementById)
return
var fileref=""
if (this.loadedobjects.indexOf(fileName)==-1){
if (fileType=="js") {
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", fileName);
} else if (fileType=="css") {
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", fileName);
} else if (fileType=="html" && requestType=="GET") {
//+ajax load get
} else if (fileType=="html" && requestType=="POST") {
//+ajax load post
} else if (fileType=="html" && requestType=="FILE") {
//+iframe load file
}
}
if (fileref!=""){
this.loadnext=loadAfter;
document.getElementsByTagName("head").item(0).appendChild(fileref)
this.loadedobjects+=fileName+" "
}

},

extloadpage:function(method,url,divid,data,cach,emsg,after) {
if (method=="GET" || method=="POST") {
var http_request=false;
if (window.XMLHttpRequest) {
http_request=new XMLHttpRequest();
} else if (window.ActiveXObject) { 
try {
http_request=new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e){
try{
http_request=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
} else {
return false
}
http_request.onreadystatechange=function(){
if (divid=="0") {
SLsystem.datatoeval(http_request, after);
} else {
SLsystem.datatodiv(http_request, divid, emsg, after);
}
}
if (cach!=0) {
var cachparam=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
}

var sendvalue=null;
if (method=="POST") {
if (data.indexOf("=")==-1) {
data="QUERY="+data;
}
http_request.open(method, url+cachparam, true)
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", data.length);
http_request.setRequestHeader("Connection", "close");
sendvalue=data;
} else {
http_request.open(method, url+cachparam, true);
}
http_request.send(sendvalue);
}


}

var SLmks={
megkereso:function() {
if (document.getElementById("VadSitesearchbox1").value.length>3) {
//var word=this.makewords(document.getElementById("VadSitesearchbox1").value);
//window.location="http://www.filmhirado.hu/megkereso/--/0-0-"+word+"/";
var w=document.getElementById('VadSitesearchbox1').value.toLowerCase();
window.location="http://www.filmhirado.hu/keres/?"+w+"";
}
},

keycheck:function(ev) {
var keyCode = ev.keyCode ? ev.keyCode : ev.which ? ev.which : ev.charCode;
if(keyCode==13){
MEGKERESO.start();
return false;
} else {
return true;
}
},

makewords:function(inp) {
var a=new Array(" ","-","/","_",":",".","&","\"","'","+","!","%","=","(",")","{","[","]","}","@","#","<",">","?",";","*","\\");
var result=inp;
var c="";
for (var b=0;b<a.length;b++) {
if (result.indexOf(a[b])!=-1) {
c=eval("/"+a[b]+"/g");
result=result.replace(c, ",");
}
}
var i=eval("/"+decodeURI("%C5%90")+"/g");
result=result.replace(i, "&&336;");
i=eval("/"+decodeURI("%C5%91")+"/g");
result=result.replace(i, "&&337;");
i=eval("/"+decodeURI("%C5%B0")+"/g");
result=result.replace(i, "&&368;");
i=eval("/"+decodeURI("%C5%B1")+"/g");
result=result.replace(i, "&&369;");
result=encodeURIComponent(result);
return result;
}

}

var Vsystem={
"limits":{
"listmax":{"0":"20","1":"30","2":"40"}
},
"defaults":{
"listlength":{"0":"10","1":"30","2":"30"}
},
"values":{
"type":0,"cat":0,"sub":0,"title":document.title
},

updatedeafults:function() {

}

}

var Vsite={
sitevars:{"veiltimera":0,"veiltimerb":0,"curscrollx":0,"curscrolly":0,"all":"VadCatAdsbody","tipcnt":1},

sendmessage:function(n) {
var err="";
var ecnt=0;
if (document.getElementById("CNTorder"+n).checked || document.getElementById("CNTinterest"+n).checked) {
if (document.getElementById("CNTemail"+n).value.length>5 || document.getElementById("CNTphone"+n).value.length>6) {
if (!document.getElementById("CNTcallback"+n).checked || (document.getElementById("CNTcallback"+n).checked && document.getElementById("CNTphone"+n).value.length>6)) {

} else {
err=", Visszahíváshoz a telefonszámot meg kell adni"+err;
ecnt++;
}
if (document.getElementById("CNTemail"+n).value.length>5) {
if (document.getElementById("CNTemail"+n).value.indexOf("@")!=-1 && document.getElementById("CNTemail"+n).value.indexOf("@")<document.getElementById("CNTemail"+n).value.lastIndexOf(".")) {

} else {
err=", Az emailcím hibás"+err;
ecnt++;
}
}
if (!document.getElementById("CNTcallback"+n).checked && document.getElementById("CNTtext"+n).value.length>1) {

} else {
err=", Kérjük írjon üzenetet (megrendelés / kérdés)"+err;
ecnt++;
}
} else {
err=", Elérhetöséget meg kell adni"+err;
ecnt++;
}
} else {
err="megkeresés típusa (megrendelés / érdeklödés)"+err;
ecnt++;
}
if (ecnt==0) {
var ready=false;
var o="";
if (document.getElementById("CNTorder"+n).checked) {
document.getElementById("CNTsubject"+n).value=document.getElementById("CNTcontacting"+n).title;
ready=confirm("Ön most megrendeli az alabbi szolgáltatást\n\n"+document.getElementById("CNTcontacting"+n).title);
o="MEGRENDELÉS: "+document.getElementById("CNTcontacting"+n).title+"\n\n";
} else {
ready=true;
}
if (ready) {
document.getElementById("CNTtext"+n).value=o+document.getElementById("CNTtext"+n).value;
document.getElementById("CNTpage"+n).value=document.location.href;
document.getElementById("CNTcontacting"+n).submit();
}
} else {
alert("Kitöltési híbák, kérjük javítsa!\n\n("+err+")");
}
},

initialize:function(div, url, widths, heights, scrollings, vspaces, hspaces) {  
if (document.getElementById("IF_"+div)) {
dropid("IF_"+div);
}
var JSiframe=document.createElement("IFRAME");  
JSiframe.id="IF_"+div;  
JSiframe.name="IF_"+div;
JSiframe.src=url;
JSiframe.width=widths;
JSiframe.height=heights;
JSiframe.frameBorder="0"
JSiframe.border="0"
JSiframe.scrolling=scrollings
JSiframe.marginWidth="0"
JSiframe.marginHeight="0"
JSiframe.vspace=vspaces;
JSiframe.hspace=hspaces;
document.getElementById(div).appendChild(JSiframe);
},

dropid:function(div) {
var Node = document.getElementById(div);
Node.parentNode.removeChild(Node);
},

nexttipp:function(div) {
this.dropid("IF_"+div);
this.sitevars.tipcnt++;
this.initialize(div,"http://q--sla.videohirdeto.hu/engines/showtipp/cat/"+this.sitevars.tipcnt+"/0/","750", "60","no", 1, 1);
},

startofferaprice:function() {
this.initialize("VadTopContainercnts", "http://q--ld0.videohirdeto.hu/specials/0/0/offeraprice.html", "798px", "538px", "no", "2px", "2px");
document.getElementById("VadTopContainercnts").style.display="block";
document.getElementById("VadSpecialofferaprice").style.display="none";
},

headfill:0,

headhistory:function(elem,dir) {
if (dir==1) {
if (this. headfill==0) {
document.getElementById("VheadhistoryVH").innerHTML="";
document.getElementById("VheadhistoryVC").innerHTML="<div style=\"font-family:sans-serif;text-align:center;font-size:12px;color:#222222\">- Cégbemutató filmgyártás<br>- Esküv&#337;i videó<br>- A reklámfilmek internetes megjelentetése<br>- Zártláncú televíziós bemutatás<br>- Banner ajánlataink<br>- Kiemelt reklámhelyeink<br>- PR cikkek megjelentetése fényképpel<br>- PR riportvideók gyártása<br>- Termékbemutató videók<br>- Nyomdai tevékenység<br>- Honlapkészítés<br>- Látogatottságnövelés</div>";
this.headfill=1;
}
document.getElementById("VheadhistoryVH").style.display="none";
document.getElementById("VheadhistoryVC").style.display="none";
document.getElementById("Vheadhistory"+elem).style.display="block";
} else {
document.getElementById("Vheadhistory"+elem).style.display="none";
}
},

search:{

doonenter:function(ev, funct) {
var keyCode = ev.keyCode ? ev.keyCode : ev.which ? ev.which : ev.charCode;
if(keyCode==13){
eval(funct);
return false;
} else {
return true;
}
}

}

};

function loading() {
VADp.loadadtoviewer(VADAD.next);
}

function reloading() {

}

var Vadimagelist={

fillimagetab:function(adid, imgdiv){
if (VADAD.aditem[adid].body.image>0) {
var t=".png";
var u="http://q--med.videohirdeto.hu/img/";
if (VADAD.aditem[adid].header.image_format) {
t=VADAD.aditem[adid].header.image_format;
}
if (VADAD.aditem[adid].header.url_image) {
u=VADAD.aditem[adid].header.url_image;
}
var c=0;
var imgs="";
for (var a in VADAD.aditem[adid].body.imgids) {
imgs=imgs+"&#160;<img id=\"VPimgVnavl"+adid+"-"+c+"\" src=\""+u+VADAD.aditem[adid].body.imgids[a]+t+"\" border=\"0\" width=\"85\" height=\"70\" class=\"VPimglistno\" onmouseover=\"Vadimagelist.switchimg("+adid+","+c+")\" onclick=\"Vadimagelist.showlargeimg("+adid+","+c+")\">";
c++;
}
c=c*100;
document.getElementById(imgdiv).innerHTML="<div class=\"Fimages\" style=\"width: "+c+"px;\">"+imgs+"</div>";
document.getElementById(imgdiv).style.display="block";
//show first!!
//this.switchimg(adid,0);
//this.showlargeimg(adid);
var vi="&#160;<img id=\"VPvidVnav\" src=\""+u+VADAD.aditem[adid].body.videoimg+"\" border=\"0\" width=\"85\" height=\"70\" class=\"VPimglistno\"><br>";
if ("videoriport"=="kepriport") {
vi=vi+"KÉPEK:";
} else {
vi=vi+"VIDEÓ";
}
document.getElementById("Fvideotab").innerHTML=vi;
} else {
document.getElementById("Fmediatabs").style.display="none";
}
},

switchimg:function(adid,img) {
if (document.getElementById("SLPPimage").style.display=="block") {
document.getElementById("SLPPimage").style.backgroundImage="url("+document.getElementById("VPimgVnavl"+adid+"-"+img).src+")";
for (var a=0;a<100;a++) {
if (document.getElementById("VPimgVnavl"+adid+"-"+a)) {
document.getElementById("VPimgVnavl"+adid+"-"+a).className="VPimglistno";
} else {
a=101;
}
}
document.getElementById("VPimgVnavl"+adid+"-"+img).className="VPimgliston";
}
},

imgshow:0,

showlargeimg:function(adid,img) {
if (document.getElementById("SLPPimage").filters && document.getElementById("SLPPimage").style.display=="none") {
document.getElementById("SLPPimage").style.filter="progid:DXImageTransform.Microsoft.Pixelate(duration=1)";
document.getElementById("SLPPimage").filters[0].Apply();                   
document.getElementById("SLPPimage").filters[0].Play();
}
document.getElementById("SLPPimage").style.display="block";
document.getElementById("SLPplayer").style.display="none";
if ("videoriport"=="kepriport") {
document.getElementById("Fvideotab").style.backgroundColor="#000000";
} else {
document.getElementById("Fvideotab").style.backgroundColor="#312d28";
}
document.getElementById("Fimagetab").style.backgroundColor="#000000";
Vadimagelist.switchimg(adid,img);
},

switchvideo:function() {
if ("videoriport"!="kepriport") {
document.getElementById("SLPPimage").style.display="none";
document.getElementById("SLPplayer").style.display="block";
document.getElementById("Fvideotab").style.backgroundColor="#000000";
document.getElementById("Fimagetab").style.backgroundColor="#312d28";
}
},

switchtoselect:function(adid) {
document.getElementById("VPimgVV"+adid).style.display="none";
document.getElementById("VPimgVnav"+adid).style.display="block";
clearTimeout(this.imgshow);
}

}


VADAD={

aditem:{},
next:0

}

VADp={

finishadload:function(adid) {
VADAD.aditem[adid]=eval("SLVADV"+adid);
VADAD.next=adid;
},

loadadtoviewer:function(adid) {
if (VADAD.aditem[adid]) {
document.title=VADAD.aditem[adid]["body"]["title"];
document.getElementById("Vaduser").innerHTML="<!!--IMG--><a href=\"http://www.filmhirado.hu/kereso/?@"+VADAD.aditem[adid]["body"]["newusercode"]+"\">"+VADAD.aditem[adid]["body"]["username"]+"</a>";
document.getElementById("Vadtitle").innerHTML=VADAD.aditem[adid]["body"]["title"];
document.getElementById("Vadinfotop").innerHTML="<span><span>URL:&#160;</span>www."+VADAD.aditem[adid]["body"]["domain"]+"/"+adid+"</span>";
document.getElementById("Vadintrobox").innerHTML=VADAD.aditem[adid]["body"]["intro"];
var tab="";
if (VADAD.aditem[adid]["body"]["detail"].length>0) {
document.getElementById("Vadtextbox").innerHTML=VADAD.aditem[adid]["body"]["detail"];
tab=tab+"<li id=\"Vadtabtext\" onclick=\"VADp.controls.switchtabs('text')\" class=\"\">Részletek</li>";
}

//document.getElementById("Vaddetailbox").innerHTML=VADAD.aditem[adid]["body"]["title"];
document.getElementById("Vadinfobottom").innerHTML="<hr>Módosítva:&#160;"+VADp.makedate(VADAD.aditem[adid]["body"]["last_mod"])+"&#160;/&#160Megtekintve:&#160;"+this.TMPcountviewer(VADAD.aditem[adid]["header"]["viewcount"],VADAD.aditem[adid]["body"]["start"]);

if (VADAD.aditem[adid]["body"]["image"]>0) {
Vadimagelist.fillimagetab(adid,"Fimagetab");
} else {
document.getElementById("Fmediatabs").style.display="none";
}
if (VADAD.aditem[adid]["body"]["video"]==1) {
document.getElementById("SLPplayer").style.display="block";
var t=100;
if (VADAD.next!=0) {
t=500;
}
setTimeout("Vplayer.loadplayer("+adid+")",t);
tab="<li id=\"Vadtabdnld\" onclick=\"VADp.controls.downloadvideo('"+adid+"')\" class=\"\">Filmletöltés</li>"+tab;
} else if (VADAD.aditem[adid]["body"]["videoembed"].length>10) {
document.getElementById("SLPplayer").style.display="block";

document.getElementById("SLPplayer").innerHTML="<iframe src=\""+VADAD.aditem[adid]["body"]["videoembed"]+"\" width=\"600\" height=\"400\" frameborder=\"0\"></iframe>";
//document.getElementById("SLPplayer").innerHTML="<iframe src=\""+VADAD.aditem[adid]["body"]["videoembed"]+"\" width=\"460\" height=\"345\" frameborder=\"0\"></iframe>";

} else if (VADAD.aditem[adid]["body"]["sound"]==1) {
this.loadbgsound(adid);
}

if ("videoriport"=="kepriport") {
Vadimagelist.showlargeimg(adid,0);
}

if ("vad"=="vad") {
this.loadusertab(adid);
tab=tab+"<li id=\"Vadtabuser\" onclick=\"VADp.controls.switchtabs('user')\" class=\"\">Kontakt</li>";
}

document.getElementById("Fcnttabs").innerHTML="<ul>"+tab+"</ul>";
VADp.controls.switchtabs("text");

}
},

loadbgsound:function(adid) {

},

loadusertab:function(adid) {
var admail="";
var adphone="";
var homephone="";
var workphone="";
var adfax="";
var ademail="";
var adweb="";
if (VADAD.aditem[adid].body.mail) {
if (VADAD.aditem[adid].body.mail.length>1) {
var tmpmail=VADAD.aditem[adid].body.mail.split("|");
if (tmpmail.length>=5) {
if (tmpmail[0]=="901") {
tmpmail[0]="Magyarország";
}
admail=tmpmail[1]+", "+tmpmail[2]+", "+tmpmail[3]+" "+tmpmail[4]+" "+tmpmail[5]+". ("+tmpmail[0]+")";
admail="<tr><td align=\"left\" valign=\"top\" class=\"AdUsrTit\">Cím:</td><td align=\"left\" valign=\"top\" class=\"AdUsrDtl\">"+admail+"</td></tr>";
}
}
}
if (VADAD.aditem[adid].body.phone_work || VADAD.aditem[adid].body.phone_home) {
if (VADAD.aditem[adid].body.phone_home) {
var tmptel="";
for (var a in VADAD.aditem[adid].body.phone_home) {
tmptel=VADAD.aditem[adid].body.phone_home[a];
adphone=adphone+"&#160;&#160;"+tmptel+" ";
}
}
tmptel="";
if (VADAD.aditem[adid].body.phone_work) {
for (var b in VADAD.aditem[adid].body.phone_work) {
tmptel=VADAD.aditem[adid].body.phone_work[b];
adphone=adphone+"&#160;&#160;"+tmptel+" ";
}
}
adphone="<tr><td align=\"left\" valign=\"top\" class=\"AdUsrTit\">Telefon:</td><td align=\"left\" valign=\"top\" class=\"AdUsrDtl\">"+adphone+"</td></tr>";
}
if (VADAD.aditem[adid].body.fax) {
if (VADAD.aditem[adid].body.fax.length>1) {
adfax="<tr><td align=\"left\" valign=\"top\" class=\"AdUsrTit\">Telefax:</td><td align=\"left\" valign=\"top\" class=\"AdUsrDtl\">&#160;&#160;"+VADAD.aditem[adid].body.fax+"</td></tr>";
}
}
if (VADAD.aditem[adid].body.email) {
for (var c in VADAD.aditem[adid].body.email) {
ademail=ademail+"&#160;&#160;<a href=\"mailto:"+VADAD.aditem[adid].body.email[c]+"&subject=http://www.filmhirado.hu/"+adid+"\">"+VADAD.aditem[adid].body.email[c]+"</a>"+" ";
}
ademail="<tr><td align=\"left\" valign=\"top\" class=\"AdUsrTit\">E-mail:</td><td align=\"left\" valign=\"top\" class=\"AdUsrDtl\">"+ademail+"</td></tr>";
}
if (VADAD.aditem[adid].body.web) {
for (var d in VADAD.aditem[adid].body.web) {
adweb=adweb+"&#160;&#160;<a href=\"http://"+VADAD.aditem[adid].body.web[d]+"/\"  target=\"hirdetoweb_videohirdeto\">"+VADAD.aditem[adid].body.web[d]+"</a>"+" ";
}
adweb="<tr><td align=\"left\" valign=\"top\" class=\"AdUsrTit\">Internet:</td><td align=\"left\" valign=\"top\" class=\"AdUsrDtl\">"+adweb+"</td></tr>";
}
document.getElementById("Vadcntuser").innerHTML=VADAD.aditem[adid].body.username+"<br><a href=\"http://www.filmhirado.hu/keres/?@"+VADAD.aditem[adid].body.newusercode+"\">(összes videóriport)</a><br><br><table>"+admail+adphone+adfax+ademail+adweb+"</table>";
},

controls:{

downloadvideo:function(adid) {
if (VADAD.aditem[adid]["body"]["video"]==1) {
if (!VADAD.aditem[adid]["header"]["downloadlink"]) {
var a=Math.round(1+Math.random());
var v=".wmv";
//if (VADAD.aditem[adid].header.video_format) {
//v=VADAD.aditem[adid].header.video_format;
//}
VADAD.aditem[adid]["header"]["downloadlink"]="http://videoletoltes-"+a+".videohirdeto.hu/"+VADAD.aditem[adid]["body"]["videoid"]+""+v+"";
}
window.location=VADAD.aditem[adid]["header"]["downloadlink"];
}
},

switchtabs:function(tab) {
if (document.getElementById("Vadtabtext")) {
document.getElementById("Vadtabtext").className="no";
document.getElementById("Vadcnttext").style.display="none";
}
if (document.getElementById("Vadtabuser")) {
document.getElementById("Vadtabuser").className="no";
document.getElementById("Vadcntuser").style.display="none";
}
document.getElementById("Vadtab"+tab).className="current";
document.getElementById("Vadcnt"+tab).style.display="block";
}

},

noadshow:function() {
var a=confirm("A keresett hirdetés vagy riport nem található, vagy lejárt");
if (a) {
this.returntocat();
} else {
this.returntocat();
}
},

returntocat:function() {
window.location="http://www.filmhirado.hu/";
},

makedate:function(str) {
var newdate="";
var adate=new Array();
adate["20100903"]="Ma";
adate["20100904"]="Holnap";
adate["20100902"]="Tegnap";
if (adate[str]) {
newdate=adate[str];
} else {
var year=str.substring(0, 4);
var month=str.substring(4, 6);
var day=str.substring(6, 8);
newdate=year+"."+month+"."+day+".";
}
return newdate;
},

TMPcountviewer:function(view,post) {
if (view) {
view=3.347532*view;
} else {
var today="20100903";
var diff=post*1;
diff=today-diff;
diff=diff/(1000/365);
if (diff>300) {
view=(diff-300)/2+480;
} else if (diff>210) {
view=(diff-210)*(2/3)+420;
} else if (diff>150) {
view=(diff-150)*1+360;
} else if (diff>60) {
view=(diff-60)*2+180;
} else {
view=diff*3.2;
}
}
view=Math.round(view);
return view;
},

swicthtonexttab:function() {}

}

var doplay=0;

var Vplayer={

loadplayer:function(adid) {
var vidurl=VADAD.aditem[adid].header.video_format;
var type=VADAD.aditem[adid].header.video_format;
if ((type==".wmv" && doplay==1) || type==".flv") {
this.unloadplayer();
Vsite.initialize("SLPbox", "", "600px", "375px", "no", "0", "0");
if (vidurl==".flv") {
vidurl=".swf";
var vurl=VADAD.aditem[adid].header.url_video.replace("/fl/","/videoplayer/")
vidurl=""+vurl+"1283529406."+VADAD.aditem[adid].body.videoid+".00000/FH-PLAYER"+vidurl;
} else {
vidurl=""+VADAD.aditem[adid].header.url_video+VADAD.aditem[adid].body.videoid+""+vidurl;
}
var vidid=new Date();
vidid=vidid.getTime();
vidid="SLVmp"+vidid+Math.round(Math.random()*1000);
var vp="";
var scr="";
var wmscr="function loading(){ifSLvp.status.loaded=1;}function unloading(){ifSLvp.status.loaded=2;if (document.getElementById(ifSLvp.video.player)) {ifSLvp.basics.dropid(ifSLvp.video.player);}parent.Vplayer.unloadplayer();}videohirdeto=parent.videohirdeto;var ifSLvp={basics:{setsessioncookie:function(cookieName, cookieValue) {document.cookie = escape(cookieName) + '=' + escape(cookieValue) + '; path=/' + '; domain=.';return true;},getcookievalue:function (cookieName) {var exp = new RegExp (escape(cookieName) + '=([^;]+)');if (exp.test (document.cookie + ';')) {exp.exec (document.cookie + ';');return unescape(RegExp.$1);}else return false;},dropid:function(div) {var Node = document.getElementById(div);Node.parentNode.removeChild(Node);}},video:{adid:0,player:'',url:'"+vidurl+"',vimg:'',loaddata:function() {}},controls:{videohover:function(dir) {if (ifSLvp.status.playing==0 && document.getElementById(ifSLvp.video.player).uiMode=='invisible') {var bg=new Array ('url(http://q--sli0.videohirdeto.hu/VP/SLPreplay.png)','url(http://q--sli0.videohirdeto.hu/VP/SLPreplayh.png)');document.getElementById('SLPPvideop').style.cursor='pointer';document.getElementById('SLPPvideop').style.backgroundImage=bg[dir];} else {document.getElementById('SLPPvideop').style.cursor='auto';}},videoclick:function() {if (ifSLvp.status.playing==0 && document.getElementById(ifSLvp.video.player).uiMode=='invisible') {document.getElementById(ifSLvp.video.player).uiMode='none';ifSLvp.action.startnow();}},hover:function(el,dir) {if (document.getElementById(el)) {var pos=new Array ('top center','bottom center');document.getElementById(el).style.backgroundPosition=pos[dir];}},openvolume:function(dir,wait) {wait=wait*600;clearTimeout(ifSLvp.status.volumeopen);ifSLvp.status.volumeopen=setTimeout('ifSLvp.controls.volumeboxopen('+dir+')',wait);ifSLvp.status.volumebox=dir;},volumeboxopen:function(dir) {if (dir==0 || (dir==1 && ifSLvp.status.playing!=0)) {disp=new Array ('none','block');document.getElementById('SLPvolume').style.display=disp[dir];}},setsound:function(mark) {if (ifSLvp.status.playing!=0) {ifSLvp.action.setvolume(0,mark);}},muteit:function(place) {if (ifSLvp.status.playing!=0) {ifSLvp.action.mutenow();if (ifSLvp.status.muted==0 && place==1) {document.getElementById(ifSLvp.video.player).settings.volume=5;}}},infobutton:function() {top.location='http://www.videohirdeto.info/segitseg/';},playbutton:function() {if (ifSLvp.status.interstitial!=2) {if (ifSLvp.status.playing==1) {ifSLvp.action.pausenow();} else if (ifSLvp.status.started==0) {ifSLvp.action.startnow();} else {ifSLvp.action.playnow();}}},pausebutton:function() {if (ifSLvp.status.playing!=0 && ifSLvp.status.interstitial!=2) {ifSLvp.action.pausenow();}},allowdrag:function(dir) {if (ifSLvp.status.playing==1) {if (dir==1) {document.getElementById('SLPscroller').style.cursor='e-resize';document.getElementById('SLPscrollerbg').style.cursor='e-resize';window.clearInterval(ifSLvp.status.durationcounter);} else if (dir==0) {document.getElementById('SLPscroller').style.cursor='pointer';document.getElementById('SLPscrollerbg').style.cursor='pointer';window.clearInterval(ifSLvp.status.durationcounter);setTimeout('ifSLvp.controls.allowdrag(2)',700);} else {ifSLvp.status.durationcounter=window.setInterval('ifSLvp.action.showstate()',1000);dir=0;}ifSLvp.status.dragallowed=dir;}},changeposition:function(event, drag) {if (ifSLvp.status.playing==1) {ifSLvp.action.reposition(event,drag);}},gotoposition:function(event) {if (ifSLvp.status.playing==1) {ifSLvp.action.toposition(event);}}},status:{BR:0,loaded:0,videotype:'',volumebox:0,volumeopen:0,started:0,playing:0,muted:0,interstitials:0,lastvolume:50,duration:0,durationbar:212,currentduration:0,durationcounter:0,dragposition:0,dragallowed:0,startdrag:0,allowinterstitial:0,interstitial:1,interstitialmax:0,interstitialurl:'http://q--med.videohirdeto.hu/vid/int',setinterstitial:function(ints) {if (this.allowinterstitial==1) {if (ints==0) {this.interstitial=0;} else {this.interstitial=1;}} else {this.interstitial=0;}},uniqueurl:function() {var link=0;}},auto:{useraction:function(type, nButton, nShiftState, fX, fY) {},playingstatus:function(state) {if (state) {switch (state) {case 1:ifSLvp.action.stopnow();break;case 2:ifSLvp.status.playing=2;break;case 3:ifSLvp.action.startnow();break;case 8:ifSLvp.action.stopnow();break;case 10:break;}}}},action:{calcvolumemark:function(level) {var mark=95/6;mark=(level-5)/mark;mark=Math.round(mark);return mark;},calcvolumelevel:function(mark) {var level=95/6;level=(mark*level)+5;level=Math.round(level);if (level>100) {level=100;}return level;},mutenow:function() {if (ifSLvp.status.muted==0) {ifSLvp.status.muted=1;document.getElementById('SLPsound').style.backgroundImage='url(http://q--sli0.videohirdeto.hu/VP/SLPsound0.png)';ifSLvp.status.lastvolume=document.getElementById(ifSLvp.video.player).settings.volume;document.getElementById(ifSLvp.video.player).settings.volume=0;this.showvolumebar(0,0);} else {ifSLvp.status.muted=0;document.getElementById('SLPsound').style.backgroundImage='url(http://q--sli0.videohirdeto.hu/VP/SLPsound.png)';if (ifSLvp.status.lastvolume<5) {ifSLvp.status.lastvolume=5;}document.getElementById(ifSLvp.video.player).settings.volume=ifSLvp.status.lastvolume;this.showvolumebar(ifSLvp.status.lastvolume,0);}document.getElementById(ifSLvp.video.player).settings.mute=ifSLvp.status.muted;ifSLvp.basics.setsessioncookie('tmpSLPsound',ifSLvp.status.muted+'&&'+ifSLvp.status.lastvolume);},setvolume:function(level,mark) {this.showvolumebar(level,mark);if (mark>0 && level==0) {level=this.calcvolumelevel(mark);}if (document.getElementById(ifSLvp.video.player).settings.volume!=level) {document.getElementById(ifSLvp.video.player).settings.volume=level;ifSLvp.basics.setsessioncookie('tmpSLPsound',ifSLvp.status.muted+'&&'+level);}},showvolumebar:function(level,mark) {if (mark==0 && level!=0) {mark=this.calcvolumemark(level);}for (var a=0;a<=mark;a++) {if (document.getElementById('SLPvolume'+a)) {document.getElementById('SLPvolume'+a).style.backgroundPosition='top center';}}if (mark==0) {document.getElementById('SLPvolume0').style.backgroundPosition='bottom center';} else {document.getElementById('SLPvolume0').style.backgroundPosition='top center';document.getElementById('SLPsound').style.backgroundImage='url(http://q--sli0.videohirdeto.hu/VP/SLPsound.png)';}for (var b=a;b<7;b++) {document.getElementById('SLPvolume'+b).style.backgroundPosition='bottom center';}},controlcheck:function(type) {var result=false;if (document.getElementById(ifSLvp.video.player)) {if (document.getElementById(ifSLvp.video.player).controls && ifSLvp.status.interstitials!=3) {result=true;if (ifSLvp.status.BR>='50') {result=document.getElementById(ifSLvp.video.player).controls.isAvailable(type);}}}return result;},startnow:function() {if (document.getElementById(ifSLvp.video.player).uiMode!='none') {document.getElementById(ifSLvp.video.player).uiMode='none';}ifSLvp.status.started=1;this.playnow();ifSLvp.status.playing=1;var vols=ifSLvp.basics.getcookievalue('tmpSLPsound');if (vols) {var vol=vols.split('&&');if (vol[0]==1) {document.getElementById('SLPsound').style.backgroundImage='url(http://q--sli0.videohirdeto.hu/VP/SLPsound0.png)';document.getElementById(ifSLvp.video.player).settings.volume=0;this.showvolumebar(0,0);ifSLvp.status.lastvolume=vol[1];} else {if (vol[1]<5) {vol[1]=5;}this.setvolume(vol[1],0);}} else {this.setvolume(0,3);}if (document.getElementById(ifSLvp.video.player).currentMedia) {ifSLvp.status.duration=document.getElementById(ifSLvp.video.player).currentMedia.duration;}if (ifSLvp.status.interstitial!=2) {window.clearInterval(ifSLvp.status.durationcounter);ifSLvp.status.durationcounter=window.setInterval('ifSLvp.action.showstate()',1000);}},stopnow:function() {ifSLvp.status.started=0;ifSLvp.status.playing=0;if (this.controlcheck('Stop')) {document.getElementById(ifSLvp.video.player).controls.stop();}window.clearInterval(ifSLvp.status.durationcounter);document.getElementById('SLPscroller').style.marginLeft='0px';if (ifSLvp.status.interstitial==1 && ifSLvp.status.loaded==1) {document.getElementById('SLPscrollbar').style.width=ifSLvp.status.durationbar+'px';document.getElementById('SLPscroller').style.visibility='hidden';document.getElementById('SLPtime').innerHTML='';ifSLvp.action.showinterstitial();} else {if (ifSLvp.status.interstitial==2) {ifSLvp.action.afterinterstitial();document.getElementById('SLPscroller').style.visibility='visible';}document.getElementById('SLPscrollbar').style.width='1px';document.getElementById('SLPtime').innerHTML='00:00';document.getElementById(ifSLvp.video.player).uiMode='invisible';parent.Vplayer.shownextad();}},playnow:function() {if (this.controlcheck('Play')) {document.getElementById(ifSLvp.video.player).controls.play();ifSLvp.status.playing=1;}},pausenow:function() {if (this.controlcheck('Pause')) {document.getElementById(ifSLvp.video.player).controls.pause();ifSLvp.status.playing=2;}},showstate:function() {if (document.getElementById(ifSLvp.video.player)) {if (document.getElementById(ifSLvp.video.player).controls) {var cur=document.getElementById(ifSLvp.video.player).controls.currentPosition;var tim1=0;var tim2=0;if (cur<60) {tim2=cur;} else {tim1=cur/60;tim1=Math.floor(tim1);tim2=cur-(tim1*60);}if (tim1<10) {tim1='0'+tim1;}tim2=Math.round(tim2);if (tim2<10) {tim2='0'+tim2;}if (cur>0 && ifSLvp.status.duration>0) {cur=cur/ifSLvp.status.duration;cur=ifSLvp.status.durationbar*cur;cur=Math.round(cur);if (!isNaN(cur) && cur>0 && cur<=ifSLvp.status.durationbar) {ifSLvp.status.currentduration=cur;document.getElementById('SLPscrollbar').style.width=cur+'px';document.getElementById('SLPscroller').style.marginLeft=cur+'px';document.getElementById('SLPtime').innerHTML=tim1+':'+tim2;}}}}},jumpposition:function(topercent) {if (topercent) {window.clearInterval(ifSLvp.status.durationcounter);var newp=topercent/100;newp=newp*ifSLvp.status.duration;newp=Math.round(newp);document.getElementById(ifSLvp.video.player).controls.currentPosition=newp;ifSLvp.status.currentduration=newp;ifSLvp.controls.allowdrag(0);}},toposition:function(event) {if (event) {var here=0;window.clearInterval(ifSLvp.status.durationcounter);if (event.offsetX) {here=event.offsetX;} else {var a=document.getElementById('SLPscrollerbg');while (a.offsetParent){here+= a.offsetLeft;a=a.offsetParent;}here+=a.offsetLeft;here=event.pageX-here;}here=here-14;var cur=here/ifSLvp.status.durationbar;if (cur>1) {cur=0.97;} else if (cur<0.01) {cur=0.01;}cur=cur*100;this.jumpposition(cur);}},reposition:function(event,drag) {var here=0;if (drag==0) {document.getElementById('SLPscroller').style.cursor='pointer';document.getElementById('SLPscrollerbg').style.cursor='pointer';ifSLvp.status.startdrag=0;} else if (ifSLvp.status.dragallowed!=0) {window.clearInterval(ifSLvp.status.durationcounter);document.getElementById('SLPscroller').style.cursor='e-resize';document.getElementById('SLPscrollerbg').style.cursor='e-resize';ifSLvp.status.startdrag=document.getElementById(ifSLvp.video.player).controls.currentPosition;if (event.offsetX) {here=event.offsetX;} else {var a=document.getElementById('SLPscrollerbg');while (a.offsetParent){here+= a.offsetLeft;a=a.offsetParent;}here+=a.offsetLeft;here=event.pageX-here;}ifSLvp.status.dragposition=here;if (here>0 && here<=ifSLvp.status.durationbar) {var cur=here/ifSLvp.status.durationbar;cur=cur*ifSLvp.status.duration;cur=Math.round(cur);var tim1=0;var tim2=0;if (cur<60) {tim2=cur;} else {tim1=cur/60;tim1=Math.floor(tim1);tim2=cur-(tim1*60);}if (tim1<10) {tim1='0'+tim1;}tim2=Math.round(tim2);if (tim2<10) {tim2='0'+tim2;}document.getElementById('SLPscrollbar').style.width=here+'px';document.getElementById('SLPscroller').style.marginLeft=here+'px';document.getElementById('SLPtime').innerHTML=tim1+':'+tim2;}}},getinterstitial:function(cnt) {var vid=9999;if (cnt<10) {vid=ifSLvp.status.interstitialmax-0.2;vid=0.6+Math.floor(Math.random()*vid);vid=Math.round(vid);var played=parent.Vplayer.interstitials;if (played[vid]) {if (played[vid]==1) {cnt++;vid=this.getinterstitial(cnt);}}}return vid;},showinterstitial:function() {if (ifSLvp.status.interstitial==1) {ifSLvp.status.interstitial=2;var vid=this.getinterstitial(0);if (vid==9999) {this.stopnow();} else {vid=ifSLvp.status.interstitialurl+vid+'.wmv';parent.Vplayer.interstitials[vid]=1;document.getElementById(ifSLvp.video.player).URL=vid;document.getElementById('SLPmessage').style.display='block';document.getElementById('SLPmessage').innerHTML='Kis türelmet! (Kiemelt rövidfilm lejátszás)';setTimeout('ifSLvp.action.startinterstitial()',400);}}},startinterstitial:function() {if (ifSLvp.status.interstitial==2) {document.getElementById(ifSLvp.video.player).controls.play();}},afterinterstitial:function() {ifSLvp.status.interstitial=3;document.getElementById('SLPmessage').style.display='none';document.getElementById(ifSLvp.video.player).URL=ifSLvp.video.url;document.getElementById(ifSLvp.video.player).controls.stop();}}}";
var wmvp="";
var c=Math.random()*10*adid;
c=Math.round(c);
var flvp="<object id=\""+vidid+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0\" width=\"600\" height=\"375\"><param name=\"movie\" value=\""+vidurl+"?pad="+Math.random()+"\"><param name=\"quality\" value=\"high\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"False\" /><embed src=\""+vidurl+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"600\" height=\"375\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"False\"></embed></object>";
if (type==".wmv") {
vp=wmvp;
scr=wmscr;
} else if (type==".flv") {
vp=flvp;
scr=wmscr;
}
var vpcnt="<html><meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-2\"><meta http-equiv=\"imagetoolbar\" content=\"no\"><scr"+"ipt type=\"text/jav"+"ascript\">"+scr+"</scr"+"ipt><scr"+"ipt type=\"text/jav"+"ascript\" FOR=\""+vidid+"\"  EVENT=\"Error()\">document."+vidid+".error.clearErrorQueue();</scr"+"ipt><scr"+"ipt type=\"text/jav"+"ascript\" FOR=\""+vidid+"\" EVENT=\"PlayStateChange(NewState)\">if (NewState) {ifSLvp.auto.playingstatus(NewState);};</scr"+"ipt><scr"+"ipt type=\"text/jav"+"ascript\" FOR=\""+vidid+"\" EVENT=\"Click(nButton, nShiftState, fX, fY)\">ifSLvp.auto.useraction(\"Click\", nButton, nShiftState, fX, fY);</scr"+"ipt><scr"+"ipt type=\"text/jav"+"ascript\" FOR=\""+vidid+"\" EVENT=\"DoubleClick(nButton, nShiftState, fX, fY)\">ifSLvp.auto.useraction(\"DoubleClick\", nButton, nShiftState, fX, fY);</scr"+"ipt><head></head><body style=\"margin:0;padding:0;background-color:#000000;\" onload=\"loading()\" onunload=\"unloading()\" >"+vp+"</body></html>";
var vpwin=document.getElementById("IF_SLPbox").contentDocument;
if (vpwin == undefined || vpwin == null) {
vpwin=document.getElementById("IF_SLPbox").contentWindow.document;
}
vpwin.open();
vpwin.write(vpcnt);
vpwin.close();
this.setplayerparam(type,adid,vidid);
} else {

}
},

unloadplayer:function() {
if (document.getElementById("IF_SLPbox")) {
Vsite.dropid("IF_SLPbox");
}
document.getElementById("SLPbox").innerHTML="";
},

setplayerparam:function(type,adid,vidid) {
if (document.getElementById("IF_SLPbox")) {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp) {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status) {
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.videotype=type;
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.setinterstitial(VADAD.aditem[adid].body.interstitial);
}
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.video) {
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.video.player=vidid;
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.video.adid=VADAD.aditem[adid].body.videoid;
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.video.loaddata();
}
}
}
},

interstitials:{},

pauseplay:function() {
if (document.getElementById("IF_SLPbox")) {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.loaded==1 && document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.videotype==".wmv") {
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.controls.pausebutton();
}
}
},

restartplay:function() {
if (document.getElementById("IF_SLPbox")) {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.loaded==1 && document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.videotype==".wmv") {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.playing==2) {
document.getElementById("IF_SLPbox").contentWindow.ifSLvp.controls.playbutton();
}
}
}
},

shownextad:function() {
if (document.getElementById("IF_SLPbox").contentWindow.ifSLvp.status.loaded==1) {
//document.getElementById("IF_SLPbox").contentWindow.unloading();
//SHOW NEXT AD!!!

}
}


}
