/* ################################################################### */ /* © 2011 MyArtSide */ /* all rights reserved */ /* ################################################################### */ function myPage_checkBrowserName(name){ var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf(name.toLowerCase())>-1) { return true; } return false; } /* 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.biomez.de/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 = 'mehr'; }else{ document.getElementById('link_'+id).innerHTML = 'zurück'; } } 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]; }