'; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; $(html).insertAfter('meta[name=viewport]'); return false; }); /*-------------------------------------------------------*/ window.addEventListener("orientationchange", function() { setTimeout(function() { if(detectOrientation() == 'portrait') { $('body').addClass('p'); } else { $('body').removeClass('p'); } }, 500); }, false); if(detectOrientation() == 'portrait') { $('body').addClass('p'); } /*-------------------------------------------------------*/ $('#top a.sitemap.xml').click(); var pass = getCookie('pass'); if(pass) { $('form').show().find('input').val(pass).end().submit().find('input').val(''); } else { $('form').show(); if(!is_mobile) { $('input').focus(); } } }); function getScreenSize() { var screen_size = {}; if(window.innerWidth) { screen_size['w'] = window.innerWidth; screen_size['h'] = window.innerHeight; } else if(document.documentElement && document.documentElement.clientWidth) { screen_size['w'] = document.documentElement.clientWidth; screen_size['h'] = document.documentElement.clientHeight; } else if(document.body && document.body.clientWidth) { screen_size['w'] = document.body.clientWidth; screen_size['h'] = document.body.clientHeight; } return screen_size; } function is_iOS() { if(/iPad|iPhone|iPod/.test(navigator.platform)) { return true; } else { return navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform); } } function detectOrientation() { if(window.innerHeight > window.innerWidth) { return 'portrait'; } else { return 'landscape'; } } function setCookie(name, value, domain, expires) { if(!expires) { expires = new Date(); expires.setTime(expires.getTime() + (1000 * 86400 * 365)); } document.cookie = name + "=" + encodeURIComponent(value) + "; expires=" + expires.toGMTString() + "; path=/; domain=" + domain; } function getCookie(name) { var cookie_name = name + "="; var cookie_length = document.cookie.length, cookie_begin = 0; while(cookie_begin < cookie_length) { var value_begin = cookie_begin + cookie_name.length; if(document.cookie.substring(cookie_begin, value_begin) == cookie_name) { var value_end = document.cookie.indexOf(";", value_begin); if(value_end == -1) { value_end = cookie_length; } return decodeURIComponent(document.cookie.substring(value_begin, value_end)); } cookie_begin = document.cookie.indexOf(" ", cookie_begin) + 1; if(cookie_begin == 0) { break; } } return null; }