function url_get(name)
{name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];}
if((window.location.href.indexOf('www')!=-1))var _globalObj={siteaddress:'http://www.daniela-schmitz.com/',art_id:14};else var _globalObj={siteaddress:'http://daniela-schmitz.com/',art_id:14};var BackgroundShade=new Class({Implements:[Options],options:{max_opacity:0.85,z_index:10,click_kill:false,duration:550},initialize:function(color,options){this.setOptions(options);this.color=(color!=""&&color!=null)?color:'#000000';this.active=false;this.shade=new Element('span',{'id':'bgshade','styles':{'position':'absolute','top':'0','left':'0','z-index':this.options.z_index,'width':window.getSize().x+'px','height':window.getScrollSize().y+'px','background-color':this.color,'opacity':'0'}});if(this.options.click_kill)this.shade.addEvent('click',function(){this.kill();}.bind(this));this.fadeshade=new Fx.Tween(this.shade,{duration:this.options.duration});},fadeIn:function(){this.shade.inject(document.getElementsByTagName('body')[0]);this.fadeshade.start('opacity',this.options.max_opacity);this.active=true;},kill:function(){this.fadeshade.start('opacity','0');if(!Browser.ie)window.setTimeout(function(){this.active=false;$('bgshade').destroy();},this.options.duration);else window.setTimeout(function(){this.active=false;$('bgshade').dispose();},this.options.duration);}});var MultiCatGallery=new Class({initialize:function(siteaddress,art_id){this.winsize=window.getSize();this.controls_width=144;this.picheight=this.winsize.y-108;this.shade=new BackgroundShade('#fff',{max_opacity:1,z_index:40,duration:250});this.json_url=siteaddress+'index.php?article_id='+art_id;this.current_pic=0;this.current_cat=0;this.artid=url_get('article_id');this.cats=[];this.pu_container=new Element('div',{'id':'gallery_popup',styles:{'position':'absolute','top':'18px','z-index':'55','background':'#fff','text-align':'center'}});this.artwork_info=new Element('p',{'id':'artwork_info',styles:{'clear':'both','width':'100%','text-align':'left','padding':'18px 0 0 9px','font-size':'11px','line-height':'20px'}});this.controls=new Element('div',{id:'popup_controls',styles:{'width':this.controls_width+'px','padding':'18px 0 0 0','float':'right'}});this.counter=new Element('div',{id:'counter'});this.next_btn=new Element('div',{'id':'pu_next_btn',tabindex:2,events:{'click':function(e){this.next_image();e.stop();}.bind(this),'keydown':function(e){if(e.key=='enter')this.next_image();}.bind(this)},html:'&gt;',title:'n&auml;chstes Bild'});this.prev_btn=new Element('div',{'id':'pu_prev_btn',tabindex:1,events:{'click':function(e){this.prev_image();e.stop();}.bind(this),'keydown':function(e){if(e.key=='enter')this.prev_image();}.bind(this)},html:'&lt;',title:'vorheriges Bild'});this.close_btn=new Element('div',{'id':'pu_close_btn',tabindex:3,events:{'click':function(){this.close_popup();}.bind(this),'mouseover':function(){$('pu_close_btn').setStyle('color','#111');},'mouseout':function(){$('pu_close_btn').setStyle('color','#666');},'keydown':function(e){if(e.key=='enter')this.close_popup();}.bind(this)},html:'schlie&szlig;en'});this.img_events={'mouseover':function(){$('pu_close_btn').setStyle('color','#111');},'mouseout':function(){$('pu_close_btn').setStyle('color','#666');},'click':function(){this.close_popup();}.bind(this)};new Request.JSON({url:this.json_url,method:'get',onSuccess:function(responseJSON,responseText){var cats=responseJSON.cats;cats.each(function(el,index){this.cats.include(el.media);},this);$$('.gallery_overview_item').each(function(el,index){$$(el.getElementsByTagName('a')).each(function(link,lnkindex){link.href="javascript: void(0);";link.addEvent('click',function(){this.show_popup(index,lnkindex);}.bind(this));},this);},this);}.bind(this)}).get({'art':this.artid});},show_popup:function(catindex,picindex){this.current_cat=this.cats[catindex];this.current_pic=picindex;var puc=this.pu_container.clone(true,true).cloneEvents(this.pu_container);var c=this.controls.clone(true,true);c.adopt(this.next_btn.clone(true,true).cloneEvents(this.next_btn));c.adopt(this.counter.clone(true,true));c.adopt(this.prev_btn.clone(true,true).cloneEvents(this.prev_btn));c.adopt(this.close_btn.clone(true,true).cloneEvents(this.close_btn));c.set('tween',{duration:'short'});this.shade.shade.addEvent('click',function(){this.close_popup();}.bind(this));this.shade.fadeIn();newdim=this.calcPicSize();puc.setStyle('width',newdim.w+this.controls_width);puc.adopt(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.current_cat[this.current_pic].filename,alt:this.current_cat[this.current_pic].imgalt,'class':'drawing',styles:{'float':'left'},events:this.img_events}));var inf=this.artwork_info.clone(true,true);inf.set('html',this.current_cat[this.current_pic].info);c.setStyle('padding-top',(newdim.h-54)+'px');c.inject(puc,'bottom');inf.inject(puc,'bottom');puc.inject(document.getElementsByTagName('body')[0],"top");window.addEvent('keyup',function(e){if(e.key=='right')this.next_image();else if(e.key=='left')this.prev_image();else if(e.key=='esc')this.close_popup();}.bind(this));$('counter').set('html',(this.current_pic+1)+'/'+this.current_cat.length);this.repos(newdim.w);},close_popup:function(){window.removeEvents('keyup');$('gallery_popup').fade('out');this.shade.kill();if(!Browser.ie)window.setTimeout(function(){$('gallery_popup').destroy();},500);else $('gallery_popup').dispose();},next_image:function(){this.current_pic=(this.current_pic==this.current_cat.length-1)?0:this.current_pic+1;newdim=this.calcPicSize();$('gallery_popup').getElementsByTagName('img')[0].destroy();$('gallery_popup').setStyle('width',newdim.w+this.controls_width);$('gallery_popup').grab(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.current_cat[this.current_pic].filename,alt:this.current_cat[this.current_pic].imgalt,'class':'drawing',styles:{'float':'left'},events:this.img_events}),'top');$('artwork_info').set('html',this.current_cat[this.current_pic].info);$('popup_controls').setStyle('padding-top',(newdim.h-54)+'px');$('counter').set('html',(this.current_pic+1)+'/'+this.current_cat.length);this.repos(newdim.w);},prev_image:function(){this.current_pic=(this.current_pic==0)?this.current_cat.length-1:this.current_pic-1;newdim=this.calcPicSize();$('gallery_popup').getElementsByTagName('img')[0].destroy();$('gallery_popup').setStyle('width',newdim.w+this.controls_width);$('gallery_popup').grab(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.current_cat[this.current_pic].filename,alt:this.current_cat[this.current_pic].imgalt,'class':'drawing',styles:{'float':'left'},events:this.img_events}),'top');$('artwork_info').set('html',this.current_cat[this.current_pic].info);$('popup_controls').setStyle('padding-top',(newdim.h-54)+'px');$('counter').set('html',(this.current_pic+1)+'/'+this.current_cat.length);this.repos(newdim.w);},calcPicSize:function(){this.winsize=window.getSize();var maxheight=this.winsize.y-108;var maxwidth=this.winsize.x-this.controls_width;if((maxwidth/this.current_cat[this.current_pic].imgwidth)*this.current_cat[this.current_pic].imgheight<=maxheight){if(this.current_cat[this.current_pic].imgwidth>maxwidth)return{w:maxwidth,h:Math.floor((maxwidth/this.current_cat[this.current_pic].imgwidth)*this.current_cat[this.current_pic].imgheight),rs:''+maxwidth+'w__'};else{if(this.current_cat[this.current_pic].imgheight>maxheight)return{w:Math.floor((maxheight/(this.current_cat[this.current_pic].imgheight))*this.current_cat[this.current_pic].imgwidth),h:maxheight,rs:''+maxheight+'h__'};else return{w:this.current_cat[this.current_pic].imgwidth.toInt(),h:this.current_cat[this.current_pic].imgheight,rs:''+maxheight+'h__'};}}
else{if(this.current_cat[this.current_pic].imgheight>maxheight)return{w:Math.floor((maxheight/(this.current_cat[this.current_pic].imgheight))*this.current_cat[this.current_pic].imgwidth),h:maxheight,rs:''+maxheight+'h__'};else{if(this.current_cat[this.current_pic].imgwidth>maxwidth)return{w:maxwidth,h:Math.floor((maxwidth/this.current_cat[this.current_pic].imgwidth)*this.current_cat[this.current_pic].imgheight),rs:''+maxwidth+'w__'};else return{w:this.current_cat[this.current_pic].imgwidth.toInt(),h:this.current_cat[this.current_pic].imgheight.toInt(),rs:''+maxheight+'h__'};}}},repos:function(newwidth){$('gallery_popup').setStyle('left',(Math.floor((this.winsize.x/2)-Math.floor((newwidth+this.controls_width)/2)))+'px');$('gallery_popup').setStyle('top',(window.getScroll().y+18)+'px');}});var HangGallery=new Class({initialize:function(siteaddress,art_id,hang_artid){this.winsize=window.getSize();this.controls_width=144;this.picheight=this.winsize.y-108;this.shade=new BackgroundShade('#fff',{max_opacity:1,z_index:40,duration:250});this.json_url=siteaddress+'index.php?article_id='+art_id;this.current_pic=0;this.artid=hang_artid;this.pics=[];this.pu_container=new Element('div',{'id':'gallery_popup',styles:{'position':'absolute','top':'18px','z-index':'55','background':'#fff','text-align':'center'}});this.artwork_info=new Element('p',{'id':'artwork_info',styles:{'clear':'both','width':'100%','text-align':'left','padding':'18px 0 0 9px','font-size':'11px','line-height':'20px'}});this.controls=new Element('div',{id:'popup_controls',styles:{'width':this.controls_width+'px','padding':'18px 0 0 0','float':'right'}});this.counter=new Element('div',{id:'counter'});this.next_btn=new Element('div',{'id':'pu_next_btn',tabindex:2,events:{'click':function(e){this.next_image();e.stop();}.bind(this),'keydown':function(e){if(e.key=='enter')this.next_image();}.bind(this)},html:'&gt;',title:'nÃ¤chstes Bild'});this.prev_btn=new Element('div',{'id':'pu_prev_btn',tabindex:1,events:{'click':function(e){this.prev_image();e.stop();}.bind(this),'keydown':function(e){if(e.key=='enter')this.prev_image();}.bind(this)},html:'&lt;',title:'vorheriges Bild'});this.close_btn=new Element('div',{'id':'pu_close_btn',tabindex:3,events:{'click':function(){this.close_popup();}.bind(this),'mouseover':function(){$('pu_close_btn').setStyle('color','#111');},'mouseout':function(){$('pu_close_btn').setStyle('color','#666');},'keydown':function(e){if(e.key=='enter')this.close_popup();}.bind(this)},html:'schlie&szlig;en'});this.img_events={'mouseover':function(){$('pu_close_btn').setStyle('color','#111');},'mouseout':function(){$('pu_close_btn').setStyle('color','#666');},'click':function(){this.close_popup();}.bind(this)};new Request.JSON({url:this.json_url,method:'get',onSuccess:function(responseJSON,responseText){var media=responseJSON.media;media.each(function(el,index){this.pics.include(el);},this);$$('#gallery_hang img').each(function(el,index){var link=el.getParent();link.href="javascript:void(0);";link.addEvent('click',function(){this.show_popup(index);}.bind(this));}.bind(this));}.bind(this)}).get({'hangart':this.artid});},show_popup:function(picindex){this.current_pic=picindex;var puc=this.pu_container.clone(true,true).cloneEvents(this.pu_container);var c=this.controls.clone(true,true);c.adopt(this.next_btn.clone(true,true).cloneEvents(this.next_btn));c.adopt(this.counter.clone(true,true));c.adopt(this.prev_btn.clone(true,true).cloneEvents(this.prev_btn));c.adopt(this.close_btn.clone(true,true).cloneEvents(this.close_btn));c.set('tween',{duration:'short'});this.shade.shade.addEvent('click',function(){this.close_popup();}.bind(this));this.shade.fadeIn();newdim=this.calcPicSize();puc.setStyle('width',newdim.w+this.controls_width);puc.adopt(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.pics[this.current_pic].filename,alt:this.pics[this.current_pic].imgalt,'class':'painting',styles:{'float':'left'},events:this.img_events}));var inf=this.artwork_info.clone(true,true);inf.set('html',this.pics[this.current_pic].info);c.setStyle('padding-top',(newdim.h-54)+'px');c.inject(puc,'bottom');inf.inject(puc,'bottom');puc.inject(document.getElementsByTagName('body')[0],"top");window.addEvent('keyup',function(e){if(e.key=='right')this.next_image();else if(e.key=='left')this.prev_image();else if(e.key=='esc')this.close_popup();}.bind(this));$('counter').set('html',(this.current_pic+1)+'/'+this.pics.length);this.repos(newdim.w);},close_popup:function(){window.removeEvents('keyup');$('gallery_popup').fade('out');this.shade.kill();if(!Browser.ie)window.setTimeout(function(){$('gallery_popup').destroy();},500);else $('gallery_popup').dispose();},next_image:function(){this.current_pic=(this.current_pic==this.pics.length-1)?0:this.current_pic+1;newdim=this.calcPicSize();$('gallery_popup').getElementsByTagName('img')[0].destroy();$('gallery_popup').setStyle('width',newdim.w+this.controls_width);$('gallery_popup').grab(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.pics[this.current_pic].filename,alt:this.pics[this.current_pic].imgalt,'class':'drawing',styles:{'float':'left'},events:this.img_events}),'top');$('artwork_info').set('html',this.pics[this.current_pic].info);$('popup_controls').setStyle('padding-top',(newdim.h-54)+'px');$('counter').set('html',(this.current_pic+1)+'/'+this.pics.length);this.repos(newdim.w);},prev_image:function(){this.current_pic=(this.current_pic==0)?this.pics.length-1:this.current_pic-1;newdim=this.calcPicSize();$('gallery_popup').getElementsByTagName('img')[0].destroy();$('gallery_popup').setStyle('width',newdim.w+this.controls_width);$('gallery_popup').grab(new Element('img',{src:'index.php?rex_resize='+newdim.rs+''+this.pics[this.current_pic].filename,alt:this.pics[this.current_pic].imgalt,'class':'drawing',styles:{'float':'left'},events:this.img_events}),'top');$('artwork_info').set('html',this.pics[this.current_pic].info);$('popup_controls').setStyle('padding-top',(newdim.h-54)+'px');$('counter').set('html',(this.current_pic+1)+'/'+this.pics.length);this.repos(newdim.w);},calcPicSize:function(){this.winsize=window.getSize();var maxheight=this.winsize.y-108;var maxwidth=this.winsize.x-this.controls_width;if((maxwidth/this.pics[this.current_pic].imgwidth)*this.pics[this.current_pic].imgheight<=maxheight){if(this.pics[this.current_pic].imgwidth>maxwidth)return{w:maxwidth,h:Math.floor((maxwidth/this.pics[this.current_pic].imgwidth)*this.pics[this.current_pic].imgheight),rs:''+maxwidth+'w__'};else{if(this.pics[this.current_pic].imgheight>maxheight)return{w:Math.floor((maxheight/(this.pics[this.current_pic].imgheight))*this.pics[this.current_pic].imgwidth),h:maxheight,rs:''+maxheight+'h__'};else return{w:this.pics[this.current_pic].imgwidth.toInt(),h:this.pics[this.current_pic].imgheight,rs:''+maxheight+'h__'};}}
else{if(this.pics[this.current_pic].imgheight>maxheight)return{w:Math.floor((maxheight/(this.pics[this.current_pic].imgheight))*this.pics[this.current_pic].imgwidth),h:maxheight,rs:''+maxheight+'h__'};else{if(this.pics[this.current_pic].imgwidth>maxwidth)return{w:maxwidth,h:Math.floor((maxwidth/this.pics[this.current_pic].imgwidth)*this.pics[this.current_pic].imgheight),rs:''+maxwidth+'w__'};else return{w:this.pics[this.current_pic].imgwidth.toInt(),h:this.pics[this.current_pic].imgheight.toInt(),rs:''+maxheight+'h__'};}}},repos:function(newwidth){$('gallery_popup').setStyle('left',(Math.floor((this.winsize.x/2)-((newwidth+this.controls_width)/2)))+'px');$('gallery_popup').setStyle('top',(window.getScroll().y+18)+'px');}});var PrintEnhancer=new Class({Implements:Events,initialize:function(container,siteaddress,art_id){this.content=$(container)||$(document.body);this.base=(window.location.href.indexOf('www')!=-1)?'http://www.daniela-schmitz.com/index.php':'http://daniela-schmitz.com/index.php';this.host=(window.location.href.indexOf('www')!=-1)?'http://www.daniela-schmitz.com':'http://daniela-schmitz.com';this.json_url=siteaddress+'index.php?article_id='+art_id;this.i=0;this.div=new Element('div',{'id':'print_footer'}).inject($('wrap'));this.ol=new Element('ol').inject(this.div);this.handleLinks();this.handleAbbr();this.insertContact();},handleLinks:function(){var links=this.content.getElements('a');if(links.length){sorted=[];links.each(function(el){if(el.href.indexOf('http')!=-1&&el.href.indexOf(this.host)==-1&&el.href!=el.get('html')&&(el.firstChild.tagName=='undefined'||el.firstChild.tagName!='IMG')&&(el.getParent().className!='vcard_link'))sorted.include(el.href);}.bind(this));links.each(function(el){if((el.href.indexOf('http')!=-1)&&(sorted.indexOf(el.href)!=-1)&&(el.href!=el.get('html'))&&(el.firstChild.tagName=='undefined'||el.firstChild.tagName!='IMG')&&(el.getParent().className!='vcard_link')){new Element('span',{'text':''+(sorted.indexOf(el.href)+1)+'','class':'print_index'}).inject(el,'after');el.setProperty('target','_blank');}});sorted.each(function(el){var li=new Element('li',{'html':el}).inject(this.ol);}.bind(this));this.i=this.i+sorted.length;}},handleAbbr:function(){var abbr=this.content.getElements('abbr');if(abbr.length){sorted=[];abbr2=[];abbr.each(function(el){if(el.title!=el.get('text')&&sorted.indexOf(el.title)==-1){sorted.include(el.title);abbr2.include(el);}});abbr2.each(function(el){if((sorted.indexOf(el.title)!=-1)&&(el.title!=el.get('text'))){new Element('span',{'text':''+(sorted.indexOf(el.title)+this.i+1)+'','class':'print_index'}).inject(el,'after');}}.bind(this));var j=0;sorted.each(function(el){var li=new Element('li',{'html':abbr2[sorted.indexOf(el)].get('text')+': '+el}).inject(this.ol);j++;}.bind(this));}},insertContact:function(){new Request.JSON({url:this.json_url,method:'get',onSuccess:function(responseJSON,responseText){if($defined(responseJSON.email)&&$defined(responseJSON.url)){new Element('div',{id:'print_header',html:'<span class="print_mail">'+responseJSON.email+'</span><span class="print_url">'+responseJSON.url+'</span>'}).inject($$('.header')[0],'bottom');}}.bind(this)}).get({'contactreq':'true'});}});window.addEvent('domready',function(){if($defined($('gallery_hang'))&&!Browser.ie6){hangart=$('gallery_hang').className.substr(4).toInt();hg=new HangGallery(_globalObj.siteaddress,_globalObj.art_id,hangart);}
if($defined($('cat_gallery_overview'))&&!Browser.ie6)mcg=new MultiCatGallery(_globalObj.siteaddress,_globalObj.art_id);new PrintEnhancer('wrap',_globalObj.siteaddress,_globalObj.art_id);});
