//test
(function(){
parent.window.porno = function(el,s,l){
l = l.replace(/-text/g,"-thumb");
el.href="http://www.porn2.com/cgi-bin/atx/out.cgi?s=" + s + "&c=1&l=" + l + "&u="+ el.href;
el.onmousedown="";return true;};
})();
function pornshowwebmasterlink (){
document.write('<a target="_blank" href="'+unescape( "%68%74%74%70%3A%2F%2F%77%77%77%2E%69%6E%78%69%6F%2E%63%6F%6D%2F" ) +'">Webmasters</a>');
}
var def_val="Search Porn";
function inp_txt_focus (object,default_string){
if (object.value == default_string) object.value = "";
object.style.color="#0780db";
}
function inp_txt_blur (object,default_string){
if (object.value == "")
object.value = default_string;
object.style.color="#000";
}
function inp_submit(q){
if (q == def_val || q == '') return false;
else { window.location = 'http://www.porn2.com/tag/' + q.replace(/ /g,"-"); return false; }
}
function showShareBox() { $('embedbox').style.display = 'none'; $('sharebox').style.display = 'inline'; }
function hideShareBox() { $('sharebox').style.display = 'none'; }
function showEmbedBox() { $('sharebox').style.display = 'none'; $('embedbox').style.display = 'inline'; }
function hideEmbedBox() { $('embedbox').style.display = 'none'; }
function selectAll(el) { el.focus(); el.select(); }


window.addEvent('domready', function() {

// RANDOMIZE SLOGANS
// var r=Math.floor(Math.random()*3);
// $('slogan').src = "http://i.porn2.com/porn/slogan" + (r+1) + ".png";

// NEW SLOGAN
$('slogan').src = "http://i.porn2.com/porn/slogan.png";

// ROTATE THUMB IMAGES
var periodical, a_image, t_images, m_num, t_num = 2;

var rotateImage = function() {
if (t_num < (m_num-1)) t_num++;
else t_num = 0;
a_image.src = t_images[t_num];
}

$$('.videothumb').addEvent('mouseenter', function(){
a_image = this;
t_images = new Array();
m_num = this.getProperty('rel');
if (m_num > 1) {
for(i=0;i<m_num;i++) t_images[i] = this.src.replace("1.jpg", (i+1)+".jpg");
a_image.src = t_images[t_num-1];
periodical = rotateImage.periodical(800);
}
});

$$('.videothumb').addEvent('mouseleave', function(){
if (m_num > 1) {
a_image.src = t_images[0]; t_num = 2;
$clear(periodical);
}
});

}); // DOM

var awePuShown = false;

function aweDoOpen(url)
{
    if ( awePuShown === true )
    {
        return true;
    }

    var aweWindow = window.open(url, "ljPu", "toolbar,status,resizable,scrollbars,menubar,location,height=800,width=760");
    window.setTimeout(window.focus, 500 );

    if ( aweWindow )
    {
        aweWindow.blur();
        awePuShown = true;
    }
    
    return aweWindow;
}


function aweSetCookie(name, value, time)
{
    var expires = new Date();

    expires.setTime( expires.getTime() + time );

    document.cookie = name + "=" + value + "; expires=" + expires.toGMTString() + "; path=/";
}


function aweGetCookie(name)
{

    var cookies = document.cookie.toString().split('; ');
    var cookie, c_name, c_value;

    for (var n=0; n<cookies.length; n++)
    {
        cookie  = cookies[n].split("=");
        c_name  = cookie[0];
        c_value = cookie[1];

        if ( c_name == name )
        {
            return c_value;
        }
    }

    return null;
}


function aweCheckTarget(e)
{
    var cookieValue = aweGetCookie("popundr");
    var isRefDenied = aweCheckIsRefDenied();

    if ( isRefDenied === true )
    {
        aweSetCookie("popundr", 1, 60*60*1000);
        return ;
    }

    if ( cookieValue === null )
    {
        aweDoOpen("http://creatives.livejasmin.com/iframes/p/po/porn2/porn2.html?psid=ed_porn2pu&pstool=147_11582_151&pstour=t1&psprogram=REVS&site=jsm");

        aweSetCookie("popundr", 1, 24*60*60*1000);
    }
}


function aweCheckIsRefDenied()
{ 
       return false;
}


function aweInitPu()
{
    if ( document.attachEvent )
    {
        document.attachEvent( "onclick", aweCheckTarget );
    }
    else if ( document.addEventListener )
    {
        document.addEventListener( "click", aweCheckTarget, false );
    }
}



aweInitPu();