/* ################################################################### */ /* © 2011 MyArtSide */ /* all rights reserved */ /* ################################################################### */ //routenplaner function google_setAddress(){ document.search_route.saddr.value = document.search_route.strasse.value+', '+document.search_route.plz.value+' '+document.search_route.ort.value document.search_route.submit(); } function myPage_checkBrowserName(name){ var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf(name.toLowerCase())>-1) { return true; } return false; } function __ajax(id,load){ $('#'+id).load(load); } /* Popup */ var request = false; function myPage_setRequest(content) { //erzeuge div wenn nicht vorhanden! if (!$('div#ajax').length) { $("body").append('
'); } if (window.XMLHttpRequest) { request = new XMLHttpRequest(); // Mozilla, Safari, Opera } else if (window.ActiveXObject) { try { request = new ActiveXObject('Msxml2.XMLHTTP'); // IE 5 } catch (e) { try { request = new ActiveXObject('Microsoft.XMLHTTP'); // IE 6 } catch (e) {} } } if (!request) { alert("Kann keine XMLHTTP-Instanz erzeugen"); return false; } else { var url = "http://www.copythek.com/mypage/incl/ajax.php"; var value = content; request.open('post', url, true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); request.send('var='+value); request.onreadystatechange = myPage_interpretRequest; } } function myPage_interpretRequest() { switch (request.readyState) { case 4: if (request.status != 200) { alert("Fehler:"+request.status); } else { var xmlDoc = request.responseXML; var content = xmlDoc.getElementsByTagName('html')[0].firstChild.nodeValue; document.getElementById('ajax').style.display = 'block'; document.getElementById('ajax').innerHTML = content; document.body.style.overflowY = 'hidden'; if(myPage_checkBrowserName('MSIE')){ document.getElementById('MyPagePopup').style.top = document.body.scrollTop+'px'; } } break; default: break; } } function myPage_popupClose(){ document.getElementById('ajax').innerHTML = ''; document.body.style.overflowY = 'auto'; document.getElementById('ajax').style.display = 'none'; } function myPage_checkSlidebox(id){ if(document.getElementById('slide_'+id).style.display == 'none'){ document.getElementById('link_'+id).innerHTML = ''; }else{ document.getElementById('link_'+id).innerHTML = ''; } } function myPage_slide(id){ $("#slide_"+id).slideToggle("slow"); window.setInterval( function() {myPage_checkSlidebox(id)}, 1000); } //php 2 js function strpos (haystack, needle, offset) { var i = (haystack + '').indexOf(needle, (offset || 0)); return i === -1 ? false : i; } function explode (delimiter, string, limit) { var emptyArray = { 0: '' }; // third argument is not required if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') { return null; } if (delimiter === '' || delimiter === false || delimiter === null) { return false; } if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') { return emptyArray; } if (delimiter === true) { delimiter = '1'; } if (!limit) { return string.toString().split(delimiter.toString()); } // support for limit argument var splitted = string.toString().split(delimiter.toString()); var partA = splitted.splice(0, limit - 1); var partB = splitted.join(delimiter.toString()); partA.push(partB); return partA; } function str_replace (search, replace, subject, count) { j = 0, temp = '', repl = '', sl = 0, fl = 0, f = [].concat(search), r = [].concat(replace), s = subject, ra = Object.prototype.toString.call(r) === '[object Array]', sa = Object.prototype.toString.call(s) === '[object Array]'; s = [].concat(s); if (count) { this.window[count] = 0; } for (i = 0, sl = s.length; i < sl; i++) { if (s[i] === '') { continue; } for (j = 0, fl = f.length; j < fl; j++) { temp = s[i] + ''; repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]; s[i] = (temp).split(f[j]).join(repl); if (count && s[i] !== temp) { this.window[count] += (temp.length - s[i].length) / f[j].length; } } } return sa ? s : s[0]; } function chancequantity(id){ ItemAtCart(id,'setquantity') loadcart(); } function ItemAtCart(id,p){ var anz = document.getElementById('quantity_'+id).value; var frml = $('#product_details').serializeArray(); //console.log(frml); var json_text = JSON.stringify(frml); ajax('shopping_cart','mypage/incl/module/shop/ajax.php?var=ItemAddCart::|GUIsys|::'+id+'::|GUIsys|::'+anz+'::|GUIsys|::'+json_text); } function ItemClearFromCart(id){ ajax('shopping_cart','mypage/incl/module/shop/ajax.php?var=ItemClearFromCart::|GUIsys|::'+id); ajax('checkout_cart_content','mypage/incl/module/shop/ajax.php?var=reloadcheckout'); } function loadcart(){ ajax('shopping_cart','mypage/incl/module/shop/ajax.php?var=loadcart'); ajax('checkout_cart_content','mypage/incl/module/shop/ajax.php?var=reloadcheckout'); } function setAction(action,subit){ document.forms['checkout'].action.value = action; if(subit == "true") { document.forms['checkout'].submit(); } } function printorder(id) { if(id == undefined){ var id=''; } var url = "http://www.copythek.com/mypage/incl/module/shop/print_order.php?order="+id; var windowName = "copythek.com"; var windowSize = "width=800,height=600,scrollbars=yes,left=100,top=100"; var printpage = window.open(url+','+windowName+','+windowSize); printpage.focus(); printpage.print(); return false; }