Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
<script type='text/javascript' src='http://ваш сайт/popunder.js'></script>
<!--[if lt IE 7]>
<script type="text/javascript">
var isIE6 = true;
</script>
<![endif]-->
<!--[if IE 7]>
<script type="text/javascript">
var isIE7 = true;
</script>
<![endif]-->
<script type="text/javascript">
var MG_domen = 'http://ваш сайт'; <!--/наш домен-->
var timepop = 1;
var popunder = 'http://сайт'; <!--/страница которую нужно открытвать-->
</script>
var isIE6 = false;
var isIE7 = false;
var ua = navigator.userAgent.toLowerCase();
// Opera
var isOpera = (ua.indexOf("opera") != -1);
// Определим Internet Explorer
var isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1);
// Gecko = Mozilla + Firefox + Netscape
var isGecko = (ua.indexOf("gecko") != -1);
function MGsetCookie( name, value, path, domain, time ) {
var secure = '';
var today = new Date();
today.setTime( today.getTime() );
if (time == ''){
expires = 1 * 1000 * 60 * 60 * 6;
} else expires = 1 * 1000 * 60 * 60 * time;
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function MGgetCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function mgopen(event){
global:timepop;
global:MG_domen;
if (document.cookie == '' || navigator.userAgent.toLowerCase().indexOf('linux') > 0) return;
if (isGecko){
if (event.button==2) return;
if (!MGgetCookie('MG_popunder')){
MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop);
window.open(popunder ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
self.focus();
}
}
}
function mgopenie(){
global:MG_domen;
global:timepop;
if (document.cookie == '') return;
if (window.event && window.event.type && window.event.type == 'click' && !MGgetCookie('MG_popunder')){
MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop);
window.open(popunder ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
self.focus();
}
}
function mgopenie7(){
global:MG_domen;
global:timepop;
if (document.cookie == '') return;
if (window.event && window.event.type && window.event.type == 'click' && !MGgetCookie('MG_popunder')){
MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop);
window.open(popunder ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
self.focus();
}
}
function mgopera(event){
global:MG_domen;
global:timepop;
if (document.cookie == '') return;
if (window.event && window.event.type && window.event.type == 'click' && !MGgetCookie('MG_popunder')){
MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop);
window.open(popunder ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
}
}
function in_array(needle, haystack, argStrict) {
var found = false, key, strict = !!argStrict;
for (key in haystack) {
if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
found = true;
break;
}
}
return found;
}
function MG_showPop(event){
global:MG_domen;
global:timepop;
//alert(document.cookie);
//if (document.cookie == '') return;
//alert(window.event);
//alert(window.event + '==' + window.event.type + '===');
if (isGecko && event.button==2) return;
if (!MGgetCookie('MG_popunder')){
MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop);
var mg_new_win = window.open(popunder , "", "scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0");
mg_new_win.blur();
window.focus();
}
}