function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i < ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; } var urlFragment = window.location.hash; if ( urlFragment == "#noredirect" ) { setCookie("mobile-status2","normal",365); var redirect_status = 'normal'; //alert('set cookie as normal'); // var website=""; // self.location=website; } else { var redirect_status=getCookie("mobile-status2"); if ( redirect_status == 'normal') { //alert("mobile_redirect GET not set, cookie is " + redirect_status); } else { var redirect_status = 'mobile'; } } //alert('Redirecting you to ' + redirect_status + ' site'); if (redirect_status == 'normal') { window.onload = function(){ document.body.prependChild = function(newChild) { this.insertBefore(newChild, this.firstChild); }; function createDiv() { var divTag = document.createElement("div"); divTag.id = "mobile-toggle"; divTag.setAttribute("align","center"); divTag.style.margin = "0px auto"; divTag.style.padding = "10px"; divTag.style.color = "#FFF"; divTag.style.border = "#c0c0c0 1px dotted"; divTag.style.background = "#000"; divTag.innerHTML = 'Tap to view mobile website'; document.body.prependChild(divTag); } createDiv(); } } //Oh, hi to you.