Clickunder от маркетгида

Статус
В этой теме нельзя размещать новые ответы.

Akcium

Мой дом здесь!
Регистрация
11 Июн 2007
Сообщения
452
Реакции
253
Собственно хотел позаимствовать у них, но что-то не выходит:
в шапке...
PHP:
<head>
    <script type="text/javascript">  
        var isIE6 = false;
        var isIE7 = false;
    </script>
    <!--[if lt IE 7]>
    <script type="text/javascript">
    var isIE6 = true;
    var isIE7 = false;
    </script>
    <![endif]-->
    <!--[if IE 7]>
    <script type="text/javascript">
    var isIE6 = false;
    var isIE7 = true;
    </script>
    <![endif]-->  
<script type="text/javascript">
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));
}
var MG_domen = '.marketgid.com';
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);
var timepop1 = 1;
var timepop2 = 10/60/60;
var popunder1_ff = 'http://marketgid.com/npnews-new.marketgid.com.html';
var popunder1_o = 'http://marketgid.com/npnews-new2.marketgid.com.html';
var popunder1_ie6 = 'http://marketgid.com/npnews-new2.marketgid.com.html';
var popunder1_ie7 = 'http://marketgid.com/npnews-new2.marketgid.com.html';
popunder1_other = 'http://marketgid.com/npnews-new2.marketgid.com.html';
var popunder2 = 'http://marketgid.com/marketgid-bestsellers.html'; 
function mgopen(event){
	return;
    global:timepop1,timepop2,popunder1_ff, popunder2;
    global:MG_domen;
    if (document.cookie == '') return;
    if (isGecko){
        if (event.button==2) return;
        if (!MGgetCookie('MG_popunder')){
            MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop1);
            MGsetCookie('MG_popunder2', 1, '/', MG_domen, timepop2);
            MGsetCookie('MG_popunder3', 0, '/', MG_domen, 0);
            window.open(popunder1_ff ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
            self.focus();
        }
        if (MGgetCookie('MG_popunder') && !MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')) && popunder2 != ''){
            MGsetCookie('MG_popunder3', 1, '/', MG_domen, timepop1 - timepop2);
            window.open(popunder2 ,'tr1','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
            self.focus();
        }
    }
}
</script>
 </head>
<body onclick="mgopen(event);">
перед body:
PHP:
<script type="text/javascript">
function opera(event){
	return;
    global:MG_domen;
    global:timepop1,timepop2,popunder1_o, popunder2;
    if (document.cookie == '') return;
    if (!MGgetCookie('MG_popunder')){
        MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop1);
        MGsetCookie('MG_popunder2', 1, '/', MG_domen, timepop2);
        MGsetCookie('MG_popunder3', 0, '/', MG_domen, 0);
        window.open(popunder1_o ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
    }
    if (MGgetCookie('MG_popunder') && !MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')) && popunder2 != ''){
        MGsetCookie('MG_popunder3', 1, '/', MG_domen, timepop1 - timepop2);
        window.open(popunder2 ,'tr1','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
    }
}
if (isOpera){
    var m = document.getElementsByTagName("a");
    for (key in m)
    {
		current=m[key];
		if (current.target=='_blank') {
			current.onclick='return opera(event)';
		}
    }
}
function openOther(){
	return;
    global:MG_domen;
    global:timepop1,timepop2,popunder1_other, popunder2;
    if (document.cookie == '') return;
    if (!MGgetCookie('MG_popunder')){
        MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop1);
        MGsetCookie('MG_popunder2', 1, '/', MG_domen, timepop2);
        MGsetCookie('MG_popunder3', 0, '/', MG_domen, 0);
        var s = new Date();
        var test = window.open(popunder1_other ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
    }
    if (MGgetCookie('MG_popunder') && !MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')) && popunder2 != ''){
        MGsetCookie('MG_popunder3', 1, '/', MG_domen, timepop1 - timepop2);
        window.open(popunder2 ,'tr1','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
        self.focus();
    }
}
if (!isOpera && !isIE7 && !isIE6 && !isGecko){
    var m = document.getElementsByTagName("a");
    for (i=0;i<m.length;i++)
    {   
        var current=m[i];
        if (!MGgetCookie('MG_popunder') || (!MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')))) current.target = '';
        current.onclick = function(){openOther();};
    }
}
function openie(){
	return;
    global:MG_domen;
    global:timepop1,timepop2,popunder1_ie6, popunder2;
    if (document.cookie == '') return;
    if (!MGgetCookie('MG_popunder')){
        MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop1);
        MGsetCookie('MG_popunder2', 1, '/', MG_domen, timepop2);
        MGsetCookie('MG_popunder3', 0, '/', MG_domen, 0);
        var s = new Date();
        window.open(popunder1_ie6 ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
        self.focus();
    }        
    if (MGgetCookie('MG_popunder') && !MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')) && popunder2 != ''){
        MGsetCookie('MG_popunder3', 1, '/', MG_domen, timepop1 - timepop2);
        window.open(popunder2 ,'tr1','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
        self.focus();
    }    
}
function openie7(){
	return;
	global:MG_domen;
    global:timepop1,timepop2,popunder1_ie7, popunder2;
    if (document.cookie == '') return;
    if (!MGgetCookie('MG_popunder')){
        MGsetCookie('MG_popunder', 1, '/', MG_domen, timepop1);
        MGsetCookie('MG_popunder2', 1, '/', MG_domen, timepop2);
        MGsetCookie('MG_popunder3', 0, '/', MG_domen, 0);
        var s = new Date();
        window.open(popunder1_ie7 ,'tr','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
        self.focus();
    }        
    if (MGgetCookie('MG_popunder') && !MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')) && popunder2 != ''){
        MGsetCookie('MG_popunder3', 1, '/', MG_domen, timepop1 - timepop2);
        window.open(popunder2 ,'tr1','toolbar=1,location=1,status=1, menubar=1,scrollbars=1,resizable=1');
        self.focus();
    } 
}
if (isIE6){
    var m = document.getElementsByTagName("a");
    for (i=0;i<m.length;i++)
    {   
        var current=m[i];
         if (!MGgetCookie('MG_popunder') || (!MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')))){
            current.target = '';
            current.onclick = function(){openie();};
        }
    }
}
if (isIE7){
    var m = document.getElementsByTagName("a");
    for (i=0;i<m.length;i++)
    {   
        var current=m[i];
        if (!MGgetCookie('MG_popunder') || (!MGgetCookie('MG_popunder2') && !parseInt(MGgetCookie('MG_popunder3')))){
            current.target = '';
            current.onclick = function(){openie7();};
        }
    }
}
</script>
</body>
может я что-то пропустил? почему не пашет?? (var MG_domen = '.marketgid.com'; поменял)
 
банит за него Яндекс, будьте бдительны. Лучше заюзать что-нить другое
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху