/******************************************************************************
 * Jelen programkód tulajdonosa: FotoMarket Kft.                              *
 *                                                                            *
 * A kód részének vagy egészének felhasználása a tulajdonos írásos engedélye  *
 * nélkül SZIGORÚAN TILOS!                                                    *
 *                                                                            *
 * Copyright (c) FotoMarket Kft. 2001-2006. Minden jog fenntartva.            *
 ******************************************************************************/

var previewwnd;
function showBigPic(picdir, picfile) {
  previewwnd = window.open('bigpic.php?picdir='+picdir+'&picfile='+picfile,'previewwnd','toolbar=no,resizable=no,width=420,height=420,top='+Math.floor((screen.height-420)/2)+',left='+Math.floor((screen.width-420)/2));
  previewwnd.focus();		
}

function changeImage(imageid, newimage) {
  var imagecontrol = document.getElementById(imageid);
  if (imagecontrol) {
    imagecontrol.src = newimage;
  }
}

var infownd;
function showInfoWindow(infopage) {
  infownd = window.open('info/?infopage='+infopage,'infownd','scrollbars=no,toolbar=no,resizable=no,width=530,height=400,top='+Math.floor((screen.height-400)/2)+',left='+Math.floor((screen.width-530)/2));
  infownd.focus();		
}

var infownd2;
function showInfoWindow2(infopage) {
  infownd2 = window.open('info/?infopage='+infopage,'infownd2','scrollbars=no,toolbar=no,resizable=no,width=530,height=450,top='+Math.floor((screen.height-450)/2)+',left='+Math.floor((screen.width-530)/2));
  infownd2.focus();		
}

var infownd3;
function showInfoWindow3(infopage) {
  infownd3 = window.open('info/?infopage='+infopage,'infownd3','scrollbars=no,toolbar=no,resizable=no,width=400,height=250,top='+Math.floor((screen.height-250)/2)+',left='+Math.floor((screen.width-400)/2));
  infownd3.focus();		
}

var printerfriendlypage;
function printPage(prodid) {
  var pagewidth = 580;
  var pageheight = 700;
  
  printerfriendlypage = window.open('product.php?pid='+prodid+'&printerfriendly=1','printerfriendlypage','scrollbars=yes,toolbar=no,resizable=yes,width='+pagewidth+',height='+pageheight+',top='+Math.floor((screen.height-pageheight)/2)+',left='+Math.floor((screen.width-pagewidth)/2));
  printerfriendlypage.focus();		
}

function openWindow(url, windowname, width, height) {
  var newpage = window.open(url, windowname, 'scrollbars=yes,toolbar=no,resizable=no,width='+width+',height='+height+',top='+Math.floor((screen.height-height)/2)+',left='+Math.floor((screen.width-width)/2));
  newpage.focus();		
}

function openPresents(){
        var width = 500;
        var height = 540;
        var args = openPresents.arguments;
        var param = '';
        var ok = false;
        if(navigator.userAgent.indexOf('Opera') != -1) ok = false; else
        if(navigator.userAgent.indexOf('MSIE') != -1) ok = true; else
        if(navigator.userAgent.indexOf('Mozilla/5.') != -1) ok = true;
        if(ok){
                if(args.length > 0) param='&partner='+escape(args[0]);
                if(args.length > 1) param='&file='+escape(args[1]);
                var win = open('presents/'+param, 'presents', 'resizable=no,width='+width+',height='+height+',left='+Math.floor((screen.width-width)/2)+',top='+Math.floor((screen.height-height)/2-30));
                win.focus();
        }else{
                alert('Az Ön böngészője nem alkalmas a varázsló futtatására!\nKérjük használja az alábbi programok valamelyikét:\n\nInternet Explorer 4.0 - vagy újabb\nNetscape 7.0 - vagy újabb\nMozilla 1.0 - vagy újabb');
        }
}

function openCalendars(){
        var width = 500;
        var height = 490;
        var args = openCalendars.arguments;
        var param = '';
        var ok = false;
        if(navigator.userAgent.indexOf('Opera') != -1) ok = false; else
        if(navigator.userAgent.indexOf('MSIE') != -1) ok = true; else
        if(navigator.userAgent.indexOf('Mozilla/5.') != -1) ok = true;
        if(ok){
                if(args.length > 0) param='?partner='+escape(args[0]);
                if(args.length > 1) param='?file='+escape(args[1]);
                var win = open('calendar/'+param, 'calendar', 'resizable=no,width='+width+',height='+height+',left='+Math.floor((screen.width-width)/2)+',top='+Math.floor((screen.height-height)/2-30));
                win.focus();
        }else{
                alert('Az Ön böngészője nem alkalmas a varázsló futtatására!\nKérjük használja az alábbi programok valamelyikét:\n\nInternet Explorer 4.0 - vagy újabb\nNetscape 7.0 - vagy újabb\nMozilla 1.0 - vagy újabb');
        }
}


var currentpartnerlist = 0;
var partnerlist;

function rotatePartnerList() {
  partnerlist.filter(":eq(" + currentpartnerlist + ")").hide();

  currentpartnerlist++;
  if (currentpartnerlist >= partnerlist.length) {
    currentpartnerlist = 0;
  }

  partnerlist.filter(":eq(" + currentpartnerlist + ")").fadeIn(1000);

  setTimeout(rotatePartnerList, 6000);
}

$(function() {
  partnerlist = $(".rotatingpartnerlist").hide().filter(":first").show().end();
  setTimeout(rotatePartnerList, 6000);
});
