function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(12)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}



function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}


function btn()
{
if (which == 0) document.getElementById('back').style.display='none' 
else document.getElementById('back').style.display='' 
if (which == photos.length-1) document.getElementById('forw').style.display='none' 
else document.getElementById('forw').style.display=''
}

function backward(){
if (which>0){
which--
//applyeffect()
document.images.photoslider.src=photos[which]
document.getElementById('kepnev').firstChild.nodeValue=kepnev[which];
// document.getElementById('forras').firstChild.nodeValue=forras[which];
// document.getElementById('datum').firstChild.nodeValue=datum[which];
btn()
playeffect()
keeptrack()
}
}

function forward(){
if (which<photos.length-1){
which++
//applyeffect()
document.images.photoslider.src=photos[which]
document.getElementById('kepnev').firstChild.nodeValue=kepnev[which];
// document.getElementById('forras').firstChild.nodeValue=forras[which];
// document.getElementById('datum').firstChild.nodeValue=datum[which];
btn()
playeffect()
keeptrack()
}
}

function selected(number, max, mod){
applyeffect()
document.images.photoslider.src=photos[number]

if (which != photos.length)
{
which=number;
}

if(mod===true)
{
    document.getElementById('categ').firstChild.nodeValue=categoryname[which];
    document.getElementById('kepnev').firstChild.nodeValue=kepnev[which];
    // document.getElementById('forras').firstChild.nodeValue=forras[which];
    // document.getElementById('datum').firstChild.nodeValue=datum[which];
}
else    
{
   $('kepnev').innerHTML=kepnev[which];
}
for(i=0;i<max;i++){
	document.getElementById('a' + i).style.borderColor = '#EBE2CE';
}
document.getElementById('a' + which).style.borderColor = '#77160D';
// Ki kellet iktatnom mert az ie keresi a gombokat amikre hivatkozik
//btn()
playeffect()
// keeptrack()
}

function transport(name){
var pwidth=bigwidth[which];
var pheight=bigheight[which];

myleft=(screen.width)?(screen.width-pwidth)/2:100;
mytop=(screen.height)?(screen.height-pheight)/2:100;

f_popup = open("","cartridge_popup","width="+pwidth+",height="+pheight+",left="+myleft+", top="+mytop+",status=yes,toolbar=no,menubar=no,resizable=no");
	f_popup.document.open();
	f_popup.document.write("<HTML><HEAD><TITLE>"+categoryname[which]+" - "+kepnev[which]+"</TITLE></HEAD>");
	f_popup.document.write("<script type='text/javascript'>");
	f_popup.document.write("function FitPic() { ");
	f_popup.document.write("var NS = (navigator.appName=='Netscape')?true:false;");
	f_popup.document.write("iWidth = (NS)?window.innerWidth:document.body.clientWidth; ");
	f_popup.document.write("iHeight = (NS)?window.innerHeight:document.body.clientHeight; ");
	f_popup.document.write("iWidth = document.images[0].width - iWidth; ");
	f_popup.document.write("iHeight = document.images[0].height - iHeight; ");
	f_popup.document.write("window.resizeBy(iWidth, iHeight); ");
	f_popup.document.write("self.focus(); } ");
	f_popup.document.write("</script>");
	f_popup.document.write("<BODY style='margin: 0px 0px 0px 0px; padding: 0px;' bgcolor='#000000'  onload='FitPic();'>");
	f_popup.document.write("<a href='javascript:;' onClick='javascript:window.close();'><img src='"+bigphotos[which]+"' title='" + name + "' border='0'></a>");
	f_popup.document.write("</BODY></HTML>");
	f_popup.document.close();
}


