function foldunfold(elementID,imgID) { if($(elementID).status == undefined) { $(elementID).status = 'folded'; Effect.BlindUp(elementID,{ duration: 0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowdown.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=1'); } else if($(elementID).status == 'folded') { $(elementID).status = 'unfolded'; Effect.BlindDown(elementID,{ duration :0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowright.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=0'); } else { $(elementID).status = 'folded'; Effect.BlindUp(elementID,{ duration: 0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowdown.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=1'); } } function unfoldfold(elementID,imgID) { if($(elementID).status == undefined) { $(elementID).status = 'unfolded'; Effect.BlindDown(elementID,{ duration :0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowright.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=0'); } else if($(elementID).status == 'folded') { $(elementID).status = 'unfolded'; Effect.BlindDown(elementID,{ duration :0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowright.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=0'); } else { $(elementID).status = 'folded'; Effect.BlindUp(elementID,{ duration: 0.3 }); $(imgID).src = 'http://www.garden-shopping.de/shop/images/arrowdown.png'; datasenthidden('http://www.garden-shopping.de/shop/admin/ajax_data.php?set=leftorder&box=' + elementID + '&md=1'); } } function setClass(elementID,elclass) { $(elementID).className = elclass; } function plzautocompleterL(eingabefeld) { return 'lplz=' + eingabefeld.value + '&landID=' + $('llandID').value; } function plzautocompleter(eingabefeld) { return 'plz=' + eingabefeld.value + '&landID=' + $('landID').value; } function setCityL(text, li) { if(Prototype.Browser.IE) { $('lort').value = li.childNodes[2].innerHTML; } else { $('lort').value = li.childNodes[3].innerHTML; } } function setCity(text, li) { if(Prototype.Browser.IE) { $('ort').value = li.childNodes[2].innerHTML; } else { $('ort').value = li.childNodes[3].innerHTML; } } function setBank(text, li) { if(Prototype.Browser.IE) { $('bank').value = li.childNodes[2].innerHTML; } else { $('bank').value = li.childNodes[3].innerHTML; } } function wysiwygAreaSave(element,varname,url) { var ed = tinyMCE.get(element); var poststring = 'clientquery=ajaxquery&' + varname + '=' + ed.getContent().replace(/&/g, "*ampersand*"); ed.setProgressState(1); new Ajax.Request(url, { asynchronous:true, method:'post', postBody:poststring, //FehlerMeldung Speichern nicht möglich on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; ed.setProgressState(0); }, on200:function(t) { ed.setContent(t.responseText); ed.setProgressState(0); } } ); } function removeElement(url) { if (confirm("Hiermit wird dieses Element endgueltig geloescht!!! \n Sind Sie sicher?")) { new Ajax.Request(url, { asynchronous:true, method:'post', postBody:'', //FehlerMeldung Speichern nicht möglich on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(t) { window.location = t.responseText; } } ); } } function viewworklayer(width,marginleft) { $('worklayerbody').innerHTML = ''; $('worklayer').style.width=width + 'px'; $('worklayer').style.marginLeft= '-' + marginleft + 'px'; $('worklayer').style.display='inline'; $('siteoverlay').style.display='inline'; /* var str=""; str=str + window.location; window.location = str.replace(/#/gi,"") + '#worklayer'; */ } function viewworklayer2(width,height,marginleft,margintop) { $('worklayerbody').innerHTML = ''; $('worklayer').style.width=width + 'px'; $('worklayer').style.height=height + 'px'; $('worklayer').style.marginLeft= marginleft + 'px'; $('worklayer').style.top= margintop + 'px'; $('worklayer').style.display='inline'; $('siteoverlay').style.display='inline'; /* var str=""; str=str + window.location; window.location = str.replace(/#/gi,"") + '#worklayer'; */ } function viewworklayernb(width,marginleft) { $('worklayerbody').innerHTML = ''; $('worklayer').style.width=width + 'px'; $('worklayer').style.marginLeft= '-' + marginleft + 'px'; $('worklayer').style.display='inline'; /* var str=""; str=str + window.location; window.location = str.replace(/#/gi,"") + '#worklayer'; */ } function hideworklayer() { $('worklayer').style.display='none'; $('siteoverlay').style.display='none'; $('worklayerbody').innerHTML = '
'; /* var str=""; str=str + window.location; window.location = str.replace(/#worklayer/gi,"#"); */ } function datasenthidden(url) { var poststring = 'clientquery=ajaxquery'; new Ajax.Request(url, {evalScripts2:true, asynchronous:true, method:'post', postBody:poststring } ); return false; } function datasent(url) { var poststring = 'clientquery=ajaxquery'; new Ajax.Request(url, {evalScripts2:true, asynchronous:true, method:'post', postBody:poststring, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(t) { $('success-div').innerHTML = t.responseText; $('success-div').style.display = 'inline'; } } ); return false; } function datasentwaiting(url) { var poststring = 'clientquery=ajaxquery'; new Ajax.Request(url, {evalScripts2:true, asynchronous:true, method:'post', postBody:poststring, onLoading:function(request){ $('siteoverlay').style.display='inline'; $('loadpic').style.display='inline'; }, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; }, on200:function(t) { $('success-div').innerHTML = t.responseText; $('success-div').style.display = 'inline'; $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; } } ); return false; } function testajax(url) { var poststring = 'clientquery=ajaxquery'; new Ajax.Request(url, {evalScripts:true, asynchronous:true, method:'post', postBody:poststring, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; } } ); return false; } /* CROSS-BROWSER EVENT HANDLER */ function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } /* END EVENT HANDLER */ /* PAGELOCATOR */ function PageLocator(propertyToUse, dividingCharacter) { this.propertyToUse = propertyToUse; this.defaultQS = ''; this.dividingCharacter = dividingCharacter; } PageLocator.prototype.getLocation = function() { return eval(this.propertyToUse); } PageLocator.prototype.getHash = function() { var url = this.getLocation(); if(url.indexOf(this.dividingCharacter)>-1) { var url_elements = url.split(this.dividingCharacter); return url_elements[url_elements.length-1]; } else { return this.defaultQS; } } PageLocator.prototype.getHref = function() { var url = this.getLocation(); var url_elements = url.split(this.dividingCharacter) return url_elements[0]; } PageLocator.prototype.makeNewLocation = function(new_qs) { return this.getHref() + this.dividingCharacter + new_qs.replace('http://www.garden-shopping.de/shop/',''); } /* END PAGELOCATOR */ /* AjaxIframesFixer */ function AjaxIframesFixer(iframeid) { this.iframeid = iframeid; if (document.getElementById('ajaxnav')) { this.alreadychanged = false; this.locator = new PageLocator("document.frames[this.iframeid].getLocation()", "?hash="); this.windowlocator = new PageLocator("window.location.href", "#"); this.timer = new Timer(this); this.delayInit(); } } AjaxIframesFixer.prototype.delayInit = function(){ this.timer.setTimeout("checkBookmark", 100, ""); } AjaxIframesFixer.prototype.checkBookmark = function(){ window.location = this.windowlocator.makeNewLocation(this.locator.getHash()); this.checkWhetherChanged(0); } AjaxIframesFixer.prototype.checkWhetherChanged = function(location){ if( (this.locator.getHash() != location) && (this.alreadychanged == false) && this.locator.getHash() != '') { set_new_div_data2(this.locator.getHash(),'mainWindow'); window.location = this.windowlocator.makeNewLocation(this.locator.getHash()); this.alreadychanged = false; } else { this.alreadychanged = false; } this.timer.setTimeout("checkWhetherChanged", 200, this.locator.getHash()); } /* END AjaxIframesFixer */ /* AjaxUrlFixer */ function AjaxUrlFixer() { this.locator = new PageLocator("window.location.href", "#"); this.timer = new Timer(this); this.checkWhetherChanged(0); this.alreadychanged = false; } AjaxUrlFixer.prototype.checkWhetherChanged = function(location){ if( (this.locator.getHash() != location) && (!this.alreadychanged) &&(this.locator.getHash() != '') ) { set_new_div_data2(this.locator.getHash(),'mainWindow',this.alreadychanged); } else { this.alreadychanged = false; } this.timer.setTimeout("checkWhetherChanged", 200, this.locator.getHash()); } /* END AjaxUrlFixer */ function FixBackAndBookmarking() { if(!document.getElementById || !document.getElementsByTagName) return; if(document.iframesfix) { fix = new AjaxIframesFixer('ajaxnav'); } else { fix = new AjaxUrlFixer(); } } function set_new_div_data2(url,div_to_show) { var poststring = 'clientquery=ajaxquery'; var x = new Ajax.Updater( div_to_show, url, { evalScripts:true, checkCodes:true, method:'post', postBody:poststring, onLoading:function(request){ $('siteoverlay').style.display='inline'; $('loadpic').style.display='inline'; }, on400: function(t) { $(t.statusText).innerHTML = t.responseText; $(t.statusText).style.display = 'inline'; return false; }, on200:function(request){ $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; return true; }, onComplete:function() { $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; return true; } }); return true; } function pt2cart(url,div_to_show,artikelID) { var poststring = 'clientquery=ajaxquery'; var x = new Ajax.Updater( div_to_show, url, { evalScripts:true, checkCodes:true, method:'post', postBody:poststring, onLoading:function(request){ $('siteoverlay').style.display='inline'; $('loadpic').style.display='inline'; }, on400: function(t) { $(t.statusText).innerHTML = t.responseText; $(t.statusText).style.display = 'inline'; return false; }, on200:function(request){ $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; $('p2cacc_' + artikelID).style.display='inline'; }, onComplete:function() { $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; return true; } }); return true; } function set_new_div_data(url,div_to_show) { var poststring = 'clientquery=ajaxquery'; var x = new Ajax.Updater( div_to_show, url, { evalScripts:true, checkCodes:true, method:'post', postBody:poststring, onLoading:function(request) { }, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(request){ } }); } function formSend(formular,url) { var stringtosend =''; stringtosend = Form.serialize( formular ); new Ajax.Request(url, { evalScripts:true, checkCodes:true, asynchronous:true, method:'post', postBody:stringtosend + '&savedata=1&clientquery=ajaxquery', on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(t){$('success-div').innerHTML = t.responseText;$('success-div').style.display = 'inline';} } ); } function formSend2relocate(formular,url) { var stringtosend =''; stringtosend = Form.serialize( formular ); new Ajax.Request(url, { evalScripts:true, asynchronous:true, method:'post', postBody:stringtosend + '&savedata=1&clientquery=ajaxquery', on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(t){ window.location= t.responseText; } } ); } function formSend2update(formular,url1,div1update) { var stringtosend =''; stringtosend = Form.serialize( formular ); stringtosend = stringtosend + '&clientquery=ajaxquery'; var x = new Ajax.Updater( div1update, url1, { evalScripts:true, checkCodes:true, method:'post', postBody:stringtosend, onLoading:function(request){ $('siteoverlay').style.display='inline'; $('loadpic').style.display='inline'; }, on200:function(request){ $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; }, onComplete:function() { $('siteoverlay').style.display='none'; $('loadpic').style.display='none'; }, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; } }); } function send_kontakt(formular) { var form=formular; var stringtosend =''; stringtosend = Form.serialize( form ); stringtosend = stringtosend + '&clientquery=ajaxquery'; new Ajax.Request('http://www.garden-shopping.de/shop/kontakt.php', { asynchronous:true, method:'post', postBody:stringtosend, on400: function(t) { $('error-div').innerHTML = t.responseText; $('error-div').style.display = 'inline'; }, on200:function(){$('kontakt-reply').style.display='inline'; form.absenden.disabled = true;form.zsetzen.disabled=true;} } ); } function Timer(){ this.obj = (arguments.length)?arguments[0]:window; return this; } Timer.prototype.setInterval = function(func, msec){ var i = Timer.getNew(); var t = Timer.buildCall(this.obj, i, arguments); Timer.set[i].timer = window.setInterval(t,msec); return i; } Timer.prototype.setTimeout = function(func, msec){ var i = Timer.getNew(); Timer.buildCall(this.obj, i, arguments); Timer.set[i].timer = window.setTimeout("Timer.callOnce("+i+");",msec); return i; } Timer.prototype.clearInterval = function(i){ if(!Timer.set[i]) return; window.clearInterval(Timer.set[i].timer); Timer.set[i] = null; } Timer.prototype.clearTimeout = function(i){ if(!Timer.set[i]) return; window.clearTimeout(Timer.set[i].timer); Timer.set[i] = null; } Timer.set = new Array(); Timer.buildCall = function(obj, i, args){ var t = ""; Timer.set[i] = new Array(); if(obj != window){ Timer.set[i].obj = obj; t = "Timer.set["+i+"].obj."; } t += args[0]+"("; if(args.length > 2){ Timer.set[i][0] = args[2]; t += "Timer.set["+i+"][0]"; for(var j=1; (j+2)