/*	WhiteBox made by Damol(www.damol.hu,davemolnar(kukac)gmail(pont)com); LICENSZ: A WhiteBox sem kereskedelmi, sem magánjellegű oldalon nem használható fel a készítő beleegyezése nélkül! A forráskód a készítő tulajdona, és a hozzájárulása nélkül nem módosítható, továbbá pénzért harmadik félnek tovább nem adható! Bővebb információért érdeklődjön a fent megadott elérhetőségek egyikén! A script egyes részei a LightBox javascript jQuery verziója alapján készültek, de lefordítva, illetve újraírva, tehát ez nem ugyanaz! LICENSE: It's forbidden to use the WhiteBox without the permission of the author, both on commercial and private webpages! The sourcecode is the author's property, and without permission it's not editable, and forbidden to sell it to a third partner! For more information please visit the website above, or write an email! Parts of the script were made after the jQuery version of the LightBox, but translated, and rewritten, so it's not the same!; Version: 1.0; Last modified: 2009/07/16*/
(function($){$.fn.whiteBox=function(beallitasok){beallitasok=jQuery.extend({kepTomb:[],aktivKep:0,csoport:false,cim:false},beallitasok);var jQueryObjektum=this;function _inicializalas(){if(beallitasok.tipus!="html"){_kezdes(this,jQueryObjektum)}else if(beallitasok.tipus=="html"){_htmlepites(this)};return false};function _kezdes(objKatt,jQueryObjektum){$('embed, object, select').css({'visibility':'hidden'});beallitasok.kepTomb.length=0;beallitasok.aktivKep=0;if(!objKatt.getAttribute('rel')||objKatt.getAttribute('rel')==''){beallitasok.kepTomb.push(new Array(objKatt.getAttribute('href'),objKatt.getAttribute('title')));beallitasok.csoport=false}else{var reszCsop=$(jQueryObjektum).filter("a[rel="+objKatt.getAttribute('rel')+"]");for(var i=0;i<reszCsop.length;i++){beallitasok.kepTomb.push(new Array(reszCsop[i].getAttribute('href'),reszCsop[i].getAttribute('title')))}beallitasok.csoport=true;while(beallitasok.kepTomb[beallitasok.aktivKep][0]!=objKatt.getAttribute('href')){beallitasok.aktivKep++}};_feluletepites();_kepepites()};function _feluletepites(){var html='';html+='<div id="felulet"></div><div id="whitebox"><table width="0" border="0" cellspacing="0" cellpadding="0"><tr><td id="fb">&nbsp;</td><td id="fk">&nbsp;</td><td id="fj">&nbsp;</td></tr><tr><td id="kb">&nbsp;</td><td id="kk"><div id="whitebox-tarolo-kep-doboz"><div id="whitebox-tarolo-kep"><div id="whitebox-kep">';if(beallitasok.csoport){html+='<div id="whitebox-talca"><a href="#" id="elozo"></a><a href="#" id="bezaras"></a><a href="#" id="kovetkezo"></a></div>'}else{html+='<div id="whitebox-talca2"><a href="#" id="bezaras"></a></div>'};html+='<div id="cfb"></div><div id="cfj"></div><div id="cab"></div><div id="caj"></div>';if(beallitasok.cim){html+='<div id="cim"><span id="cim-szoveg"></span></div>'};html+='</div><div id="whitebox-toltes"><a href="#" id="whitebox-toltes-link"><img src="whitebox/images/toltes.gif" height="32" width="32" alt="Loading"/></a></div></div></div></td><td id="kj">&nbsp;</td></tr><tr><td id="ab">&nbsp;</td><td id="ak">&nbsp;</td><td id="aj">&nbsp;</td></tr></table></div>';$('body').append(html);$('#cim').css({opacity:0.1}).fadeIn();$('#cim').hover(function(){$(this).stop().animate({"opacity":.5},200)},function(){$(this).stop().animate({"opacity":.1},200)});var lapMeretek=_getPageSize();$('#felulet').css({background:'#000',opacity:0.8,width:lapMeretek[0]});if($(document.body).height()>lapMeretek[1]){$('#felulet').css({height:$(document.body).height()})}else{$('#felulet').css({height:lapMeretek[1]})};$('#felulet').fadeIn();var lapGorg=_getPageScroll();$('#whitebox').css({top:lapGorg[1]+(lapMeretek[3]/10),left:lapGorg[0]}).show();$('#felulet,#whitebox').click(function(){_vege()});$('#whitebox-toltes-link,#bezaras').click(function(){_vege();return false});$(window).resize(function(){var lapMeretek=_getPageSize();$('#felulet').css({width:lapMeretek[0]});if($(document.body).height()>lapMeretek[1]){$('#felulet').css({height:$(document.body).height()})}else{$('#felulet').css({height:lapMeretek[1]})};var lapGorg=_getPageScroll();$('#whitebox').css({top:lapGorg[1]+(lapMeretek[3]/10),left:lapGorg[0]})})};function _kepepites(){$('#whitebox-toltes').show();$('#whitebox-kep,#whitebox-talca,#elozo,#kovetkezo').hide();var kepElotolto=new Image();kepElotolto.onload=function(){$('#whitebox-kep').css({background:"url("+beallitasok.kepTomb[beallitasok.aktivKep][0]+")",width:kepElotolto.width,height:kepElotolto.height});_keptarolodoboz_ujrameretezes(kepElotolto.width,kepElotolto.height);kepElotolto.onload=function(){}};kepElotolto.src=beallitasok.kepTomb[beallitasok.aktivKep][0]};function _keptarolodoboz_ujrameretezes(kepSzel,kepMag){var aktKepSzel=$('#whitebox-tarolo-kep-doboz').width();var aktKepMag=$('#whitebox-tarolo-kep-doboz').height();var kepSzelKul=aktKepSzel-kepSzel;var kepMagKul=aktKepMag-kepMag;var lapMeretek=_getPageSize();$('#whitebox').animate({paddingLeft:((lapMeretek[0]-kepSzel-60)/2)},400);$('#whitebox-tarolo-kep-doboz').animate({width:kepSzel,height:kepMag},400,function(){_kepmegj(kepMag)});if((kepSzelKul==0)&&(kepMagKul==0)){if($.browser.msie){_szunet(250)}else{_szunet(100)}}};function _kepmegj(kepMag){$('#whitebox-toltes').hide();if(beallitasok.cim){$('#cim-szoveg').html(beallitasok.kepTomb[beallitasok.aktivKep][1]).fadeIn()};$('#whitebox-kep').fadeIn(function(){if(beallitasok.csoport){_navepites();_szomszed_elotoltes()}})};function _navepites(){$('#whitebox-talca').show();if(beallitasok.aktivKep==0){$('#bezaras').css({'margin-left':'34px'})}else{$('#bezaras').css({'margin-left':'4px'})};if(beallitasok.aktivKep!=0){$('#elozo').unbind().show().bind('click',function(){beallitasok.aktivKep=beallitasok.aktivKep-1;_kepepites();return false})};if(beallitasok.aktivKep!=(beallitasok.kepTomb.length-1)){$('#kovetkezo').unbind().show().bind('click',function(){beallitasok.aktivKep=beallitasok.aktivKep+1;_kepepites();return false})}};function _szomszed_elotoltes(){if((beallitasok.kepTomb.length-1)>beallitasok.aktivKep){kovKep=new Image();kovKep.src=beallitasok.kepTomb[beallitasok.aktivKep+1][0]};if(beallitasok.aktivKep>0){elozoKep=new Image();elozoKep.src=beallitasok.kepTomb[beallitasok.aktivKep-1][0]}};function _htmlepites(objKatt){$('embed, object, select').css({'visibility':'hidden'});beallitasok.kepTomb.length=0;beallitasok.aktivKep=0;beallitasok.kepTomb.push(objKatt.getAttribute('href'));var IE=($.browser.msie&&parseInt($.browser.version.substr(0,1))<9);if(!IE){$('body').append('<div id="felulet"></div><div id="whitebox"><table width="0" border="0" cellspacing="0" cellpadding="0"><tr><td id="fb">&nbsp;</td><td id="fk">&nbsp;</td><td id="fj">&nbsp;</td></tr><tr><td id="kb">&nbsp;</td><td id="kk"><div id="whitebox-tarolo-kep-doboz"><div id="whitebox-tarolo-kep"><div id="whitebox-kep"><div id="whitebox-talca2"><a href="#" id="bezaras"></a></div><div id="cfb"></div><div id="cfj"></div><div id="cab"></div><div id="caj"></div><object data="'+beallitasok.kepTomb[0]+'" type="text/html" id="object"></object></div><div id="whitebox-toltes"><a href="#" id="whitebox-toltes-link"><img src="whitebox/images/toltes.gif" height="32" width="32" alt="Loading"/></a></div></div></div></td><td id="kj">&nbsp;</td></tr><tr><td id="ab">&nbsp;</td><td id="ak">&nbsp;</td><td id="aj">&nbsp;</td></tr></table></div>')}else if(IE){$('body').append('<div id="felulet"></div><div id="whitebox"><table width="0" border="0" cellspacing="0" cellpadding="0"><tr><td id="fb">&nbsp;</td><td id="fk">&nbsp;</td><td id="fj">&nbsp;</td></tr><tr><td id="kb">&nbsp;</td><td id="kk"><div id="whitebox-tarolo-kep-doboz"><div id="whitebox-tarolo-kep"><div id="whitebox-kep"><div id="whitebox-talca2"><a href="#" id="bezaras"></a></div><div id="cfb"></div><div id="cfj"></div><div id="cab"></div><div id="caj"></div><iframe id="object" name="iframe" frameborder="0" hspace="0" src="'+beallitasok.kepTomb[0]+'"></iframe></div><div id="whitebox-toltes"><a href="#" id="whitebox-toltes-link"><img src="whitebox/images/toltes.gif" height="32" width="32" alt="Loading"/></a></div></div></div></td><td id="kj">&nbsp;</td></tr><tr><td id="ab">&nbsp;</td><td id="ak">&nbsp;</td><td id="aj">&nbsp;</td></tr></table></div>')};$('#object').css({width:beallitasok.htmlW,height:beallitasok.htmlH});$('#object a').attr({target:"_parent"}).click(function(){this.target="_parent"});var lapMeretek=_getPageSize();$('#felulet').css({background:'#000',opacity:0.8,width:lapMeretek[0]});if($(document.body).height()>lapMeretek[1]){$('#felulet').css({height:$(document.body).height()})}else{$('#felulet').css({height:lapMeretek[1]})};$('#felulet').fadeIn();var lapGorg=_getPageScroll();$('#whitebox').css({top:lapGorg[1]+(lapMeretek[3]/10),left:lapGorg[0]}).show();$('#felulet,#whitebox').click(function(){_vege()});$('#whitebox-toltes-link,#bezaras').click(function(){_vege();return false});$(window).resize(function(){var lapMeretek=_getPageSize();$('#felulet').css({width:lapMeretek[0]});if($(document.body).height()>lapMeretek[1]){$('#felulet').css({height:$(document.body).height()})}else{$('#felulet').css({height:lapMeretek[1]})};var lapGorg=_getPageScroll();$('#whitebox').css({top:lapGorg[1]+(lapMeretek[3]/10),left:lapGorg[0]})});$('#whitebox-kep').css({width:beallitasok.htmlW,height:beallitasok.htmlH});var lapMeretek=_getPageSize();$('#whitebox').animate({paddingLeft:((lapMeretek[0]-beallitasok.htmlW-60)/2)},400);$('#whitebox-tarolo-kep-doboz').animate({width:beallitasok.htmlW,height:beallitasok.htmlH+26},400,function(){$('#whitebox-toltes').hide();$('#whitebox-kep').fadeIn()})};function _vege(){$('#whitebox').fadeOut(0,function(){$('#whitebox').remove()});$('#felulet').fadeOut(function(){$('#felulet').remove()});$('embed, object, select').css({'visibility':'visible'})};function _getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize};function _getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft}arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll};function _szunet(ms){var datum=new Date();aktDatum=null;do{var aktDatum=new Date()}while(aktDatum-datum<ms)};return this.unbind('click').click(_inicializalas)}})(jQuery);