/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Visit http://www.dynamicdrive.com/ for full script
* Re-Mix By !CrazyDavinci! - http://crazydavinci.net
* This notice must stay intact for use
******************************************/
Lebar=screen.availWidth;Tinggi=screen.availHeight;
var shakeTime=7000;
var startShow=1000;
var AdTop=parseInt(Tinggi/2-200) // location from top (ads height/2);
var AdLeft=parseInt(Lebar/2-160);// location from left (ads width/2)
var slideStep=15;var slideInternal=10;
var adDiv;var TO = null;var Slide = null;
var ns=(document.layers);var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
var curHeight = 0;var shakePos = 5;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
setTimeout("showAd();", startShow);}
function shakeAd(object,speed){
tmpobj = eval(object)
if (shakePos == 5)shakePos = -5;
else shakePos = 5;
tmpobj.left = parseInt(tmpobj.left) + shakePos + calunit;
tmpobj.top = parseInt(tmpobj.top) + shakePos + calunit;
tmpobj = object;sp = speed;TO = setTimeout("shakeAd(tmpobj,sp)",speed);
}
function stopshake(){
clearTimeout(TO);
}
function slideAd(){
var stopSlide = 1;
if(ie){
documentWidth = AdLeft+truebody().scrollLeft-20;
documentHeight = (slideStep>0 && curHeight<=AdTop+truebody().scrollTop-20) ? curHeight:AdTop+truebody().scrollTop;
stopSlide = !(slideStep>0 && curHeight<=AdTop+truebody().scrollTop-20);
}
else if (ns){
documentWidth=AdLeft+window.pageXOffset-20;
documentHeight = (slideStep>0 && curHeight<=AdTop+window.pageYOffset-20) ? curHeight:AdTop+window.pageYOffset-20;
stopSlide = !(slideStep>0 && curHeight<=AdTop+window.pageYOffset-20);
}
else if (w3){
documentWidth=AdLeft+window.pageXOffset-20;
documentHeight = (slideStep>0 && curHeight<=AdTop+window.pageYOffset-20) ? curHeight:AdTop+window.pageYOffset-20;
stopSlide = !(slideStep>0 && curHeight<=AdTop+window.pageYOffset-20);
}
adDiv.left=documentWidth+calunit;
adDiv.top =documentHeight+calunit;
curHeight=curHeight+slideStep;
if(stopSlide){
clearTimeout(Slide);shakeAd(adDiv,75);
setTimeout("stopshake()",shakeTime);
}
else Slide = setTimeout("slideAd()",slideInternal);
}
function showAd(){
slideAd();if (ie||w3) adDiv.visibility="visible"
else adDiv.visibility ="show";
window.onscroll = moveAd;
}
function moveAd(){
if (ie){
documentWidth = AdLeft+truebody().scrollLeft-20;
documentHeight =AdTop+truebody().scrollTop-20;
}
else if (ns){
documentWidth=AdLeft+window.pageXOffset-20;
documentHeight=AdTop+window.pageYOffset-20;
}
else if (w3){
documentWidth=AdLeft+window.pageXOffset-20
documentHeight=AdTop+window.pageYOffset-20;
}
adDiv.left=documentWidth+calunit;
adDiv.top =documentHeight+calunit;
}
function closeAd(){
if (ie||w3)adDiv.display="none"
else adDiv.visibility ="hide"
window.onscroll = null;
}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ilang2(){
initAd();
setTimeout("closeAd()",19000);
}
if (window.addEventListener) window.addEventListener("load",ilang2, false);
else if (window.attachEvent) window.attachEvent("onload",ilang2);
else if (document.getElementById) window.onload=ilang2