Validation.addAllThese([['validate-alpha','Please use letters only (a-z or A-Z) in this field.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-ZäöüÄÖÜß]+$/.test(v);}],['validate-alphanum','Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-Z0-9äöüÄÖÜß]+$/.test(v);}],['validate-nick','Please use only letters (a-z or A-Z) or numbers (0-9) or Dot(.) or Underscore(_) or Minus(-) only in this field. No spaces or other characters are allowed.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-Z0-9äöüÄÖÜß._-]+$/.test(v);}],['validate-names','Please use only letters (a-z or A-Z) or numbers (0-9) or Dot(.) or Underscore(_) or Minus(-) or Slash(/) or Single Quote (\') only in this field. No spaces or other characters are allowed.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-ZäöüÄÖÜß \'\/.-]+$/.test(v);}],['validate-person-names','Please use only letters (a-z or A-Z) or numbers (0-9) or Dot(.) or Underscore(_) or Minus(-) or Slash(/) or Single Quote (\') only in this field. No spaces or other characters are allowed.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-ZäöüÄÖÜß \'\/._-]+$/.test(v);}],['validate-city','Please use letters only (a-z or A-Z) in this field.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-zA-Z- äöüÄÖÜß]+$/.test(v);}],['validate-street','Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.',function(v){return Validation.get('IsEmpty').test(v)||/^[0-9a-zA-ZäöüÄÖÜß. \-\/,]{4,}$/.test(v);}],['validate-email','Please enter a valid email address. For example johndoe@domain.com.',function(v){return Validation.get('IsEmpty').test(v)||/^[a-z0-9-zA,!\#\$%&'\*\+\/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+\/=\?\^_`\{\|}~-]+)*@[a-z0-9-ZäöüÄÖÜß]+(\.[a-z0-9-]+)*\.([a-z]{2,})$/i.test(v);}],['required-forgott','Bitte fülle mindestens ein Feld aus!',function(v){if($('nickname_password')){return!Validation.get('IsEmpty').test(v)||!Validation.get('IsEmpty').test($('nickname_password').value);}}],['validate-email-norequired','Please enter a valid email address. For example johndoe@domain.com.',function(v){return /^[a-z0-9-zA,!\#\$%&'\*\+\/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+\/=\?\^_`\{\|}~-]+)*@[a-z0-9-ZäöüÄÖÜß]+(\.[a-z0-9-]+)*\.([a-z]{2,})$/i.test(v);}]]);Validation.add('validate-nickname','The username is invalid.</br>There are only letters, numbers, dot, underscore and minus allowed and a length of 2 to 50 characters.',{minLength:2,maxLength:50,include:['validate-nick']});Validation.add('validate-name','Ungültiger Eintrag.<br />Es sind nur Buchstaben, Punkt, Unterstrich, Leerzeichen, Slash, Single Quote und Minus mit einer Länge von 2 bis 50 Zeichen möglich.',{minLength:2,maxLength:50,include:['validate-names']});Validation.add('validate-agb','Unsere AGB\'s wurden noch nicht bestätigt',{include:['validate-select']});Validation.add('validate-citys','Invalid entry.<br/>Only letters, spaces and minus with a length of 3 to 50 characters are possible.',{minLength:3,maxLength:50,include:['validate-city']});;function sendCartAjaxRequest(url,action)
{var ajaxLoader='<img style="margin:50px 100px" src="/skin/frontend/default/default/images/opc-ajax-loader.gif" />';url+='isajax/1';new Ajax.Request
(url,{method:'post',onCreate:function(){$('pbclub_cart_loader').innerHTML='<div style="margin:0px 0px 10px 25px;"><img style="margin-right:5px;" alt="loader" src="/skin/frontend/dotsource/preisbock2009/images/opc-ajax-loader.gif"/>Bitte warten ...</div>';var text='';if(action=='add'){text='Produkt wird in den Warenkorb gelegt!';}else{text='Produkt wird aus dem Warenkorb entfernt!';}
loader(true,text);},onSuccess:function(transport){if(transport&&transport.responseText){$('div_cart_sidebar_main').update(transport.responseText);transport.responseText.evalScripts();}},onComplete:function(transport){loader(false);}});}
function addProductToCartAjax(url)
{if(!navigator.cookieEnabled){window.location='/cookies-aktivieren';}else{sendCartAjaxRequest(url,'add');window.scroll(0,0);}}
function deleteProductFromCartAjax(url)
{if(!navigator.cookieEnabled){window.location='/cookies-aktivieren';}else{sendCartAjaxRequest(url,'delete');}}
function deleteProductFromCartAjax(url,isProductViewed)
{sendCartAjaxRequest(url,'delete');if(isProductViewed){viewed_product_buyed=0;}};function check_date(_day,_month,_year,_dobHidden){var day;var month;var year;var leap=0;var err=0;err=0;if(_dobHidden==''){return true;}
day=document.getElementsByName(_day)[0].value;month=document.getElementsByName(_month)[0].value;year=document.getElementsByName(_year)[0].value;if(_dobHidden=='opt'&&day==''&&year==''&&month==''){return true;}
if(day.length!=2){day='0'+day}
if(month.length!=2){month='0'+month}
if((month<1)||(month>12)){err=21;}
if(day<1||(day>31)){err=22;}
if(year==''){err=13;}
if((year%4==0)||(year%100==0)||(year%400==0)){leap=1;}
if((month==2)&&(leap==1)&&(day>29)){err=23;}
if((month==2)&&(leap!=1)&&(day>28)){err=24;}
if((day>31)&&((month=="01")||(month=="03")||(month=="05")||(month=="07")||(month=="08")||(month=="10")||(month=="12"))){err=25;}
if((day>30)&&((month=="04")||(month=="06")||(month=="09")||(month=="11"))){err=26;}
if(err==0){return true;}
else{alert("Das von Dir eingegebene Datum ist ungültig! Bitte versuche es noch einmal.");return false;}};if(typeof Product=='undefined'){var Product={};}
Product.Zoom=Class.create();var isInitialized=false;function ZoomIsActive(){return isInitialized;}
Product.Zoom.prototype={initialize:function(imageEl,trackEl,handleEl,zoomInEl,zoomOutEl,hintEl){if(!isInitialized){this.containerEl=$(imageEl).parentNode;this.imageEl=$(imageEl);this.handleEl=$(handleEl);this.trackEl=$(trackEl);this.hintEl=$(hintEl);this.containerDim=Element.getDimensions(this.containerEl);this.imageDim=Element.getDimensions(this.imageEl);this.imageDim.ratio=this.imageDim.width/this.imageDim.height;this.floorZoom=1;if(this.imageDim.width>this.imageDim.height){this.ceilingZoom=this.imageDim.width/this.containerDim.width;}else{this.ceilingZoom=this.imageDim.height/this.containerDim.height;}
if(this.imageDim.width<=this.containerDim.width&&this.imageDim.height<=this.containerDim.height){return;}
this.imageX=0;this.imageY=0;this.imageZoom=1;this.sliderSpeed=0;this.sliderAccel=0;this.zoomBtnPressed=false;this.showFull=false;this.selects=document.getElementsByTagName('select');this.draggable=new Draggable(imageEl,{starteffect:false,reverteffect:false,endeffect:false,snap:this.contain.bind(this)});this.slider=new Control.Slider(handleEl,trackEl,{axis:'horizontal',minimum:0,maximum:88,alignX:0,increment:1,sliderValue:0,onSlide:this.scale.bind(this),onChange:this.scale.bind(this)});this.scale(0);Event.observe($(zoomInEl),'mousedown',this.startZoomIn.bind(this));Event.observe($(zoomInEl),'mouseup',this.stopZooming.bind(this));Event.observe($(zoomInEl),'mouseout',this.stopZooming.bind(this));Event.observe($(zoomOutEl),'mousedown',this.startZoomOut.bind(this));Event.observe($(zoomOutEl),'mouseup',this.stopZooming.bind(this));Event.observe($(zoomOutEl),'mouseout',this.stopZooming.bind(this));isInitialized=true;}},toggleFull:function(){this.showFull=!this.showFull;for(i=0;i<this.selects.length;i++){this.selects[i].style.visibility=this.showFull?'hidden':'visible';}
val_scale=!this.showFull?this.slider.value:1;this.scale(val_scale);this.trackEl.style.visibility=this.showFull?'hidden':'visible';this.containerEl.style.overflow=this.showFull?'visible':'hidden';this.containerEl.style.zIndex=this.showFull?'1000':'9';return this;},scale:function(v){var centerX=(this.containerDim.width*(1-this.imageZoom)/2-this.imageX)/this.imageZoom;var centerY=(this.containerDim.height*(1-this.imageZoom)/2-this.imageY)/this.imageZoom;this.imageZoom=this.floorZoom+(v*(this.ceilingZoom-this.floorZoom));this.imageEl.style.width=(this.imageZoom*this.containerDim.width)+'px';if(this.containerDim.ratio){this.imageEl.style.height=(this.imageZoom*this.containerDim.width*this.containerDim.ratio)+'px';}
this.imageX=this.containerDim.width*(1-this.imageZoom)/2-centerX*this.imageZoom;this.imageY=this.containerDim.height*(1-this.imageZoom)/2-centerY*this.imageZoom;this.contain(this.imageX,this.imageY,this.draggable);return true;},startZoomIn:function()
{this.zoomBtnPressed=true;this.sliderAccel=.002;this.periodicalZoom();this.zoomer=new PeriodicalExecuter(this.periodicalZoom.bind(this),.05);return this;},startZoomOut:function()
{this.zoomBtnPressed=true;this.sliderAccel=-.002;this.periodicalZoom();this.zoomer=new PeriodicalExecuter(this.periodicalZoom.bind(this),.05);return this;},stopZooming:function()
{if(!this.zoomer||this.sliderSpeed==0){return;}
this.zoomBtnPressed=false;this.sliderAccel=0;},periodicalZoom:function()
{if(!this.zoomer){return this;}
if(this.zoomBtnPressed){this.sliderSpeed+=this.sliderAccel;}else{this.sliderSpeed/=1.5;if(Math.abs(this.sliderSpeed)<.001){this.sliderSpeed=0;this.zoomer.stop();this.zoomer=null;}}
this.slider.value+=this.sliderSpeed;this.slider.setValue(this.slider.value);this.scale(this.slider.value);return this;},contain:function(x,y,draggable){var dim=Element.getDimensions(draggable.element);var xMin=0,xMax=this.containerDim.width-dim.width;var yMin=0,yMax=this.containerDim.height-dim.height;x=x>xMin?xMin:x;x=x<xMax?xMax:x;y=y>yMin?yMin:y;y=y<yMax?yMax:y;this.imageX=x;this.imageY=y;this.imageEl.style.left=this.imageX+'px';this.imageEl.style.top=this.imageY+'px';return[x,y];}};var BBCode={insert:function(f,text,form){f=$(form)[f];if(document.selection){f.focus();var sel=document.selection.createRange();sel.text=text;}else if(f.selectionStart||f.selectionStart=='0'){var startPos=f.selectionStart;var endPos=f.selectionEnd;f.value=f.value.substring(0,startPos)+text+f.value.substring(endPos,f.value.length);}else{f.value+=text;}
f.focus();},tag:function(t,f,form,startTag,endTag){f=$(form)[f];if(!startTag){if(!startTag){if(t=='quote'){startTag="["+t+"] ";}
else{startTag="["+t+"]";}}}
if(!endTag){if(!endTag){if(t=='quote'){endTag=" [\/"+t+"]";}
else{endTag="[\/"+t+"]";}}}
if(document.selection){f.focus();var selected=document.selection.createRange().text;var sel=document.selection.createRange();sel.text=startTag+selected+endTag;}else if(f.selectionStart||f.selectionStart=='0'){var oldScrollTop=f.scrollTop;var startPos=f.selectionStart;var endPos=f.selectionEnd;var text=startTag+f.value.substring(startPos,endPos)+endTag;f.value=f.value.substring(0,startPos)+text+f.value.substring(endPos,f.value.length);f.selectionStart=startPos+startTag.length;f.selectionEnd=startPos+text.length-endTag.length;f.scrollTop=oldScrollTop;}else{f.value+=startTag+endTag;}
f.focus();},url:function(f,url,form){var link;var name;link=prompt("Bitte geben Sie Ihren Link ein:");name=prompt("Bitte geben Sie den Namen des Links ein:");var http="http://";var Ergebnis=link.search(http);if(Ergebnis==-1){BBCode.tag('',f,form,'[url='+http+link+']'+name,'[/url]');}
else{BBCode.tag('',f,form,'[url='+link+']'+name,'[/url]');}},mail:function(f,mail,form){if(mail){BBCode.tag('mail',f,form);BBCode.tag('',f,form,'[mail='+mail+']','[/mail]');}
BBCode.tag('mail',f,form);},quote:function(f,text,form){if(text){BBCode.tag('',f,form,'[quote='+text+'] ',' [/quote]');}
BBCode.tag('quote',f,form);},list:function(f,form){BBCode.tag('',f,form,"[list]\n[*] ",'\n[/list]');},listItem:function(f,form){BBCode.tag('',f,form,"\n[*] ",' ');},image:function(f,form){var link;var name;link=prompt("Bitte geben Sie Ihren Link ein:");name=prompt("Bitte geben Sie den Namen des Bildes ein:");var http="http://";var Ergebnis=link.search(http);if(Ergebnis==-1){BBCode.tag('',f,form,'[simg='+http+link+']'+name,'[/simg]');}
else{BBCode.tag('',f,form,'[simg='+link+']'+name,'[/simg]');}},smiley:function(myValue,f,form){myField=$(form)[f];if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=myValue;}
else if(myField.selectionStart||myField.selectionStart=='0'){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;myField.value=myField.value.substring(0,startPos)
+myValue
+myField.value.substring(endPos,myField.value.length);}else{myField.value+=myValue;}
myField.focus();}};
