function sho( pFileName, pWidth, pHeight ,pTitle ) {
  filename=pFileName.split("/").pop();
  ofsx=(screen.width-pWidth)/2; ofsy=(screen.height-pHeight)/4;
  Win=window.open( "", "_blank", "width="+ pWidth+ ",height="+pHeight+",status=no,scrollbars=no,menubar=no,resizable=no,screenX="+ofsx+",screenY="+ofsy+",left="+ofsx+",top="+ofsy);
  Win.document.write('<html><head><title>'+pTitle+'</title></head>');
  Win.document.title=pTitle;
  Win.document.write('<body topmargin="0" leftmargin="0" text="#FFFFFF" background="'+'pic/'+filename + '" style="background-repeat: no-repeat" onclick="self.close()" onblur="self.close()">');
  Win.document.write('<table border="0" width="100%" height="100%" cellspacing="5" cellpadding="0">');
  Win.document.write('<tr><td width="100%" valign="bottom" align="center"><b><i>');
  if (document.title.substring(0,6)=="Gambia") Win.document.write('(C) Pelican, 2001');
  else if (document.title.substring(0,5)=="Costa Rica 2003") Win.document.write('(C) Pelican, 2003');
  else if (filename.substring(0,4)=="RTWB") Win.document.write('(C) Len Bolle, 2003');
  else if (filename.substring(0,4)=="RTWJ") Win.document.write('(C) Jutka Bartalis, 2003');
  else if (filename.substring(0,4)=="HIV_") Win.document.write('(C) Hivekovics Ákos');
  else if (filename.substring(0,4)=="IMO_") Win.document.write('(C) Olasz Csaba');
  else if (filename.substring(0,4)=="JES_") Win.document.write('(C) Jessica Pociask');
  else if (filename.substring(0,4)=="PAC_") Win.document.write('(C) Patrick Campbell');
  else if (document.title!="Film" && document.title!="Top secret") Win.document.write('(C) Pelican');
  Win.document.write('</b></i></td></tr></table>');
  Win.document.write('</body></html>');
  Win.document.show;
  Win.document.close();
  if (navigator.appName.substring(0,8) == "Netscape") Win.focus();
}
function show( pFileName, pWidth, pHeight ,pTitle ) {
  ofsx=(screen.width-pWidth)/2; ofsy=(screen.height-pHeight)/4;
  Win = window.open( "", "_blank", "width="+ pWidth+ ",height="+pHeight+",status=no,scrollbars=no,menubar=no,resizable=no,screenX="+ofsx+",screenY="+ofsy+",left="+ofsx+",top="+ofsy);
  Win.document.write('<html><head><title>'+pTitle+'</title></head>');
  Win.document.title=pTitle;
  Win.document.write('<body topmargin="0" leftmargin="0" text="#FFFFFF" background="'+ pFileName + '" style="background-repeat: no-repeat">');
  Win.document.write('<table border="0" width="100%" height="100%" cellspacing="5" cellpadding="0">');
  Win.document.write('<tr><td width="100%" valign="bottom" align="center"><b><i>');
  if (document.title.substring(0,6)=="Gambia") Win.document.write('(C) Pelican, 2001');
  else if (document.title.substring(0,5)=="Costa") Win.document.write('(C) Pelican, 2003');
  else if (document.title!="Film") Win.document.write('(C) Pelican, 1999-2003');
  Win.document.write('</b></i></td></tr></table>');
  Win.document.write('</body></html>');
  Win.document.show;
  Win.document.close();
  if (navigator.appName.substring(0,8) == "Netscape") Win.focus();
}
function init() {
  if (parent.location==self.location) self.location="http://"+self.location.hostname;
  if (self.document.title!='') self.parent.document.title='PEL.HU - '+self.document.title;
}
function over(pTitle) {
  self.status=pTitle;
}
function out() {
  self.status='';
}
function hirdet0() {
  window.open("hirdet.htm","Hirdet","width=320,height=130,left=86,top=90,screenx=86,screeny=90");
}
function hirdet() {
  window.open("ftn.htm","FTN","width=120,height=240,left=86,top=90,screenx=86,screeny=90");
}
function info() {
  window.open("getpage.php?pg=info","Info","width=320,height=130,left=86,top=90,screenx=86,screeny=90");
}

function nameDefined(ckie,nme) {
   var splitValues
   var i
   for (i=0;i<ckie.length;++i)
   {
      splitValues=ckie[i].split("=")
      if (splitValues[0]==nme) return true
   }
   return false
}
function delBlanks(strng) {
   var result=""
   var i
   var chrn
   for (i=0;i<strng.length;++i) {
      chrn=strng.charAt(i)
      if (chrn!=" ") result += chrn
   }
   return result
}

function SetCookie(cookieName,cookieValue,nHours) {
 var today = new Date();
 var expire = new Date();
 if (nHours==null || nHours==0) nHours=1;
 expire.setTime(today.getTime() + 3600000*nHours);
 document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString()+";path=/";
}

function getCookieValue(ckie,nme) {
   var splitValues
   var i
   for(i=0;i<ckie.length;++i) {
      splitValues=ckie[i].split("=")
      if(splitValues[0]==nme) return splitValues[1]
   }
   return ""
}
function testCookie(cname, cvalue) {
   var cookie=document.cookie
   var chkdCookie=delBlanks(cookie)
   var nvpair=chkdCookie.split(";")
   if(nameDefined(nvpair,cname))
   {
      tvalue=getCookieValue(nvpair,cname)
      if (tvalue == cvalue) return true
   else return false
   }
   else return false
}
function log(pTitle) { if (!testCookie("MyComputerName","Pelican"))
  ;//top.frames["Header"].document.location="http://www.pel.hu/header.php?ref="+pTitle;
}
function makeArray(arraySize) {
  this.length = arraySize; return this
}
function getlastmod() {
  monthNames=new makeArray(12)
  monthNames[0]="január"; monthNames[1]="február"; monthNames[2]="március"; monthNames[3]="április";
  monthNames[4]="május"; monthNames[5]="június"; monthNames[6]="július"; monthNames[7]="augusztus";
  monthNames[8]="szeptember"; monthNames[9]="október"; monthNames[10]="november"; monthNames[11]="december"
  updated=new Date(document.lastModified);
  theMonth=monthNames[updated.getMonth()];
  theYear=updated.getYear(); if (theYear<2000) theYear+=1900;
  zero='';
  if (updated.getMinutes()<10) zero='0';
  return theYear+". "+theMonth+" "+updated.getDate()+". "+updated.getHours()+":"+zero+updated.getMinutes();
}
function getstat() {
  t=new Date();
  y=t.getYear() % 100; if (y<10) y="0"+y;
  m=t.getMonth()+1; if (m<10) m="0"+m;
  return "stats.php?ho="+y+m;
}
function getdays() {
  start=new Date(2003,09,27,0,0,0);  /* a hónapnál 1-el kevesebbet kell írni, mert 0-tól indul */
  curr=new Date();
  days=(Date.UTC(curr.getFullYear(),curr.getMonth(),curr.getDate(),0,0,0)
      - Date.UTC(start.getFullYear(),start.getMonth(),start.getDate(),0,0,0))/86400000;
  return days;
}

function popImage(imageURL,imageTitle) {
  var isNN,isIE;
  if (parseInt(navigator.appVersion.charAt(0))>=4) {
    isNN=(navigator.appName=="Netscape")?1:0;
    isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
  }
  var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
  var optIE='scrollbars=no,width=747,height=547,left='+PositionX+',top='+PositionY;
  if (isNN){imgWin=window.open('about:blank','',optNN);}
  if (isIE){imgWin=window.open('about:blank','',optIE);}
  with (imgWin.document){
    writeln('<html><head><title>Loading ...</title><style>body  {margin:0px;} </style>');writeln('<sc'+'ript>');
    writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
    writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
    writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
    writeln('width=100-(document.body.clientWidth-document.images[0].width);');
    writeln('height=100-(document.body.clientHeight-document.images[0].height);');
    writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
    writeln('window.innerWidth=document.images["IMG"].width;');writeln('window.innerHeight=document.images["IMG"].height;}}');
    writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
    if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()"  onClick="self.close()" >')
    else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" onClick="self.close()" >');
    writeln('<img name="IMG" src='+imageURL+' style="display:black"></body></html>');
    close();
  }
}

function Resize(pTitle) {
  var isNN,isIE,im;
  if (parseInt(navigator.appVersion.charAt(0))>=4) {
    isNN=(navigator.appName=="Netscape")?1:0;
    isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
    isOP=(navigator.appName.indexOf("Opera")!=-1)?1:0;
    isFF=(navigator.appName.indexOf("Firefox")!=-1)?1:0;
  }
  if (isIE) {
    window.resizeTo(150,50);
    width=100-(document.body.clientWidth-document.images[0].width);
    height=100-(document.body.clientHeight-document.images[0].height);
    document.images[0].width=1;
    document.images[0].height=1;
    window.resizeTo(width,height);
  }
  if (isOP) {
//    window.resizeTo(150,50);
//    im=document.getElementById('IMG');
//    document.body.clientWidth=im.width;
//    document.body.clientHeight=im.height;
//    im.width=1; im.height=1;
//    window.resizeTo(im.width+2,im.height+2);
//  document.documentelement.clientheight=im.height;
//  document.documentelement.clientwidth=im.width;
  im=document.body.background;

  window.clientX=im.width;
  window.clientY=im.height;
  window.resizeTo(600+8,412+27);

  }
  if (isNN) {
    window.innerWidth=document.images["IMG"].width;
    window.innerHeight=document.images["IMG"].height;
    document.images["IMG"].width=1;
    document.images["IMG"].height=1;
  }
  if (isFF) {
    window.innerWidth=document.images["IMG"].width;
    window.innerHeight=document.images["IMG"].height;
    document.images["IMG"].width=1;
    document.images["IMG"].height=1;
  }
  document.title=pTitle;
}

function sh(pFileName,pWidth,pHeight,pTitle) {
  filename=pFileName.split("/").pop();
  pWidth=150; pHeight=50;
  ofsx=(screen.width-pWidth)/2; ofsy=(screen.height-pHeight)/4;
  Win=window.open( "", "_blank", "width="+ pWidth+ ",height="+pHeight+",status=no,scrollbars=no,menubar=no,resizable=no,screenX="+ofsx+",screenY="+ofsy+",left="+ofsx+",top="+ofsy);
  Win.document.write('<html><head><title>Loading...</title>'); Win.document.title="Loading...";
  Win.document.write('<script type="text/javascript" src="/show.js"></script></head>');
//  Win.document.write('<body topmargin="0" leftmargin="0" text="#FF0000">');
  Win.document.write('<body topmargin="0" leftmargin="0" text="#FFFFFF" background="'+'/pic/'+filename+'" style="background-repeat: no-repeat" onclick="self.close()" onblur="self.close()">');
//  Win.document.write('<img id="IMG" name="IMG" src="/pic/'+filename+'">');
  Win.document.write('<script>Resize("'+pTitle+'");</script>');
  Win.document.write('<table border="0" width="100%" height="100%" cellspacing="5" cellpadding="0">');
  Win.document.write('<tr><td width="100%" valign="bottom" align="center"><b><i>');
  if (document.title.substring(0,6)=="Gambia") Win.document.write('(C) Pelican, 2001');
  else if (document.title.substring(0,5)=="Costa") Win.document.write('(C) Pelican, 2003');
  else if (document.title!="Film" && document.title!="Top secret") Win.document.write('(C) Pelican, 1999-2004');
  Win.document.write('</b></i></td></tr></table>');
  Win.document.write('</body></html>');
  Win.document.show;
//  Win.document.title=pTitle;
  Win.document.close();
  if (navigator.appName=="Netscape") Win.focus();
}
function hideimg(i,v) {
  el=document.getElementById('pic'+v+i);
  im=document.getElementById('im'+v+i);
  el.className='nodisp';
  im.className='nodisp';
}

function browser() {
  br='';
  if (navigator.appName=='Netscape') br='NS';
  if (navigator.appName=='Microsoft Internet Explorer') br='IE';
  if (navigator.appName=='Opera') br='OP';
  if (br=='') if (document.all && !window.opera) br='IE';
  if (br=='') br='IE';
  return br;
}

function setimg(i,v,evt) {
  el=document.getElementById('pic'+v+i);
  im=document.getElementById('im'+v+i);
  im.className='headimg';
  br=browser();
  mx=0; my=0;
  if (br=='IE') {
    mx=window.event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
    my=window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
    wi=document.documentElement.clientWidth;
  }
  if (br=='OP') {
    mx=event.pageX; my=event.pageY; wi=window.innerWidth-14;
  }
  if (br=='NS') {
    mx=evt.pageX; my=evt.pageY; wi=window.innerWidth-14;
  }
  xx=mx-Math.round(im.width/2);
  el.style.left=xx;
//  if (xx=='') xx=el.style.left.substring(0,el.style.left.length-2);
  if (xx<0) xx=0;
  if (xx+20+im.width>wi) xx=(wi*1-20-im.width);
  el.style.left=xx+'px';
  im.style.left=xx+7+'px';
  el.style.top='34px';
  im.style.top='41px';
  if (my>50) {
    el.style.top=Math.round(my/22-0.5)*22-170+'px';
    im.style.top=Math.round(my/22-0.5)*22-170+7+'px';
  }
  el.className='headpic';
  if (br=='IE') el.style.filter='alpha(opacity=50)'; else el.style.opacity='0.5';
}