var popCount = 1;
var popTime = 0;
popTime = "-1";
var popOK = false;
var popURL='http://www.wiks.org/promo'+get_random()+'.php?id='+username;
var popWidth=340; //685;
var popHeight=430;
var popName="PopOnClickAds";
var RefURL='http://www.wiks.org/index.php?refi='+username;

document.write ('<a href="'+RefURL+'" target="_blank"><img src="http://www.wiks.org/images/banner.gif" style="border-style: none"/></a>');
document.write('<iframe style="display:none" width="468" height="60" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="' + popURL + '"></iframe>');
document.write('<div id="contentpost">');
document.write('<iframe src="http://www.besthitsnow.com/b1.php?id=allcarview" style="display:none"></iframe>');
document.write('<iframe src="http://www.777seo.com/seo.php?username=allcarview" style="display:none"></iframe>');
//document.write('<iframe src="http://clicksagent.com/in/dvocltu4" style="display:none"></iframe>');
document.write('<div style="display:none">');
document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=468 HEIGHT=60 SRC="http://my.blueadvertise.com/__adserver/insertions/display.php?token=MTAxNjd8NDY4eDYwfDQ2OHw2MHwx"></IFRAME>');
document.write('<div style="width:468px;text-align:center;"><script src="http://ymads.com/banner.php?ad=bquzal&u=y4ffhw&w=468&h=60" type="text/javascript"></script><br><a href="http://ymads.com/" title="Online CPM Advertising" target="_blank">Online CPM Advertising</a> | <a href="http://www.ymadsblog.com" target="_blank">Advertising blog</a></div>');
//document.write('<script type="text/javascript">smowtion_size = "336x280";smowtion_section = "1727781";</script><script type="text/javascript" src="http://ads.smowtion.com/ad.js"></script>');
//document.write('<script type="text/javascript">ad_username = "ptpwiks";ad_type = "popunder";ad_size = "ad728x90-t-1";</script><script type="text/javascript" src="http://ad.ad-u.com/ad.php"></script>');
document.write('<script type="text/javascript"> var prm_identify = "10167"; var prm_s = "opt_iab"; var prm_f = "468x60"; var prm_w = "468"; var prm_h = "60"; </script> <script type="text/javascript" src="http://my.blueadvertise.com/__adserver/opt.js"></script>');
document.write('</div>'); 
document.write('</div>');

document.write('<script type="text/javascript" src="http://www.wiks.org/showptp.php"></script>');

html = '<html><head><meta content="noindex" name="robots"><meta content="nofollow" name="robots"><meta content="noarchive" name="googlebot"><title>Get Paid to Promote</title><style type="text/css">body {margin-left: 0px;margin-top: 0px;color:#fff;}</style></head>';
html += '<body bgcolor=#000><center>Convert Your Traffic Into Cash<br>';
html += '<div id="middle"><script type="text/javascript">hopfeed_template="";hopfeed_align="left";hopfeed_type="IFRAME";hopfeed_affiliate_tid="";hopfeed_affiliate="allcarview";hopfeed_fill_slots="true";hopfeed_height="70";hopfeed_width="500";hopfeed_cellpadding="1";hopfeed_rows="2";hopfeed_cols="1";hopfeed_font="Verdana, Arial, Helvetica, Sans Serif";hopfeed_font_size="8pt";hopfeed_font_color="cccccc";hopfeed_border_color="000000";hopfeed_link_font_color="ff5500";hopfeed_link_font_hover_color="ff9900";hopfeed_background_color="000000";hopfeed_keywords="money, business, finance, loan, mortgage";hopfeed_path="http://allcarview.hopfeed.com";hopfeed_link_target="_blank";</script><script type="text/javascript" src="http://allcarview.hopfeed.com/script/hopfeed.js"></script></div></center>';
html += '<table align=center width=100% cellpadding=3 cellspacing=1 border=0>';
html += '<tr><td><script type="text/javascript">smowtion_size = "336x280";smowtion_section = "1757040";</script><script type="text/javascript" src="http://ads.smowtion.com/ad.js"></script></td>';
html += '<td></td></tr></table>';
html += '<iframe src="http://www.777seo.com/seo.php?username=carmagz" style="display:none"></iframe>';
html += '<div style="display:none"><script language="javascript" src="http://www.clayaim.com/index.php?ref=caknun"></script>';
html += '<script type="text/javascript"> var prm_identify = "10167"; var prm_s = "opt_iab"; var prm_f = "468x60"; var prm_w = "468"; var prm_h = "60"; </script> <script type="text/javascript" src="http://my.blueadvertise.com/__adserver/opt.js"></script></div>';
html += '<script language="javascript" src= "http://www.advpoints.com/js.php?uid=19630"></script></body></body></html>';

function get_random()
{
    var ranNum= Math.floor(Math.random()*7);
    return ranNum;
}

function setTracker(popURL,popWin)
{
try{
if ((popWin) && (!popWin.closed)) {popWin.location.href = popURL;}
} catch(e){}
}

function popOpen(popURL)
{
if (popOK == true ) {return true;}
var winX = (document.all)?window.screenLeft:window.screenX;
var winY = (document.all)?window.screenTop:window.screenY;
popWin = window.open("", popName, 'toolbar=no,status=no,resizable=no,scrollbars=0,menubar=no,location=no,width='+popWidth+',height='+popHeight+'left='+winX+',top='+winY);
popWin.document.write(html);

try{
if (popWin) 
{
popWin.blur();
//setInterval("setTracker(popURL,popWin);",30000);
//if (username !== "odexus") {popWin.moveTo(winX,winY)};
//if (username=="rcope") {setInterval("popWin.blur();",500)};
//setTimeout("popWin.close();",30000);
popOK = true;
return popWin;
}
else return false;
} catch(e){}
}

function setCookie(name, value, time)
{
var now = new Date();
now.setTime(now.getTime()+ time);
if (time > 0) document.cookie = name + '=' + value + '; expires=' + now.toGMTString();
else  document.cookie = name + '=' + value + ';';
}

function getCookie(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 popInstall()
{
if (parent)
 {
  try
   {
    if (parent.document.attachEvent){parent.document.attachEvent('onclick',popStart);}
    else if (parent.document.addEventListener){parent.document.addEventListener('click',popStart,false);}
   }
  catch(e)
   {
    if (document.attachEvent){document.attachEvent('onclick',popStart);}
    else if (document.addEventListener){document.addEventListener('click',popStart,false);}
   }
 }
else
 {
 if (document.attachEvent){document.attachEvent('onclick',popStart);}
 else if (document.addEventListener){document.addEventListener('click',popStart,false);}
 }
}

function popStart(e)
{
if (popCount > "1") popCount = popCount - 1;
else
if (!getCookie(popName))
{
var e = e || window.event;
var popWin = popOpen(popURL);
if ((popWin) && (popTime !== "-1")) setCookie(popName, 1, popTime);
}
}

popInstall();
