function detect() {
if (navigator.appName == 'Microsoft Internet Explorer' && navigator.platform == 'MacPPC') {
return true;
} else {
return false;
}
}
function ShowPic(URLtoOpen, title, popwidth, popheight) {
var Macit = detect();
var screenWidth = screen.availWidth;
var screenHeight = screen.availHeight;
var x = (screenWidth/2)-(popwidth/2);
var y = (screenHeight/2)-(popheight/2);
if (Macit == 1) {
popwidth2 = popwidth - 16;
popheight2 = popheight - 16;
} else {
popwidth2 = popwidth;
popheight2 = popheight;
}
var winParams = "height=" + popheight2 + ",width=" + popwidth2 +",resizable=0,directories=0,dependent=1,toolbar=0,scrollbar=0,toolbar=0,screenX=" + x + ",screenY=" + y + ",left=" + x + ",top=" + y;
newWindow = window.open('image.php?i='+URLtoOpen,'_blank', winParams);
}

function ShowPic2(img, title, popwidth, popheight,partners) {
var prtn = (partners == 789456) ? 1 : 0;
var Macit = detect();
var screenWidth = screen.availWidth;
var screenHeight = screen.availHeight;
var x = (screenWidth/2)-(popwidth/2);
var y = (screenHeight/2)-(popheight/2);
if (Macit == 1) {
popwidth2 = popwidth - 16;
popheight2 = popheight - 16;
} else {
popwidth2 = popwidth;
popheight2 = popheight;
}
var winParams = "height=" + popheight2 + ",width=" + popwidth2 +",resizable=no,directories=0,dependent=1,toolbar=0,scrollbar=0,toolbar=0,screenX=" + x + ",screenY=" + y + ",left=" + x + ",top=" + y;
newWindow = window.open('img.php?img='+img+'&partners='+prtn,'_blank', winParams);
}


function ShowPic3(img, title, popwidth, popheight,partners) {
var Macit = detect();
var screenWidth = screen.availWidth;
var screenHeight = screen.availHeight;
var x = (screenWidth/2)-(popwidth/2);
var y = (screenHeight/2)-(popheight/2);
if (Macit == 1) {
popwidth2 = popwidth - 16;
popheight2 = popheight - 16;
} else {
popwidth2 = popwidth;
popheight2 = popheight;
}
var winParams = "height=" + popheight2 + ",width=" + popwidth2 +",resizable=no,directories=0,dependent=1,toolbar=0,scrollbar=0,toolbar=0,screenX=" + x + ",screenY=" + y + ",left=" + x + ",top=" + y;
newWindow = window.open('?Feladat=ModellKepForras&img='+img+'&partners='+partners,'_blank', winParams);
}


function validate(theform) {
    errors='';
    if(!theform.name.value) {
      errors+='A nevet elfelejtette megadni.\n'
    }
    if(!theform.address.value) {
      errors+='A címet elfelejtett megadni.\n'
    }
        if(!theform.phone.value) {
      errors+='Nem adta meg a telefonszámát.\n'
    }
        if(!theform.email.value) {
      errors+='Kérem adja meg e-mail címét.\n'
    }
        if(!theform.date.value) {
      errors+='Nem adta meg a szállítási időpontot\n'
    }
    if(!theform.opportunity.value) {
      errors+='Milyen alkalomra lesz a torta?\n'
    }
        if(!theform.slices.value) {
      errors+='Kérem adja meg a szeletek számát.\n'
    }
        if(errors) {
      alert('A kitöltés hiányos:\n\n'+errors);
    }
    document.is_valid=(errors=='');
}
function flashControl(SRC,WIDTH,HEIGHT,FLASHVARS,WMODE,BGCOLOR) {

        while ( FLASHVARS.search(' ') != -1 ) {
                FLASHVARS = FLASHVARS.replace(' ', '%20');
        }

        document.write('<object type="application/x-shockwave-flash" data=' + SRC+ ' width=' + WIDTH + ' height=' + HEIGHT + '>');
        document.write('<!--[if IE]><param name="movie" value=' + SRC+ '>< ![endif]-->');

        if ( FLASHVARS ) { document.write('<param name="flashvars" value=' + FLASHVARS + '>'); }
        if ( WMODE ) { document.write('<param name="wmode" value=' + WMODE + '>'); }
        if ( BGCOLOR ) { document.write('<param name="bgcolor" value=' + BGCOLOR + '>'); }

        document.write('<param name="quality" value="high">');
        document.write('<\/object>');
}
