var greenPPCAd={width:'400',height:'50',top:'0',left:'0',bg:'1',incInterval:15,rotateInterval:5000,imgs:[],curImg:0,curAd:0,title_font_size:'12',text_font_size:'12',min_width:'400',min_height:'300',setStyle:function(){var el=document.createElement("link");el.setAttribute("type","text/css");el.setAttribute("rel","stylesheet");el.setAttribute("href","http://ad.greenlabelppc.com/greenPPCAd.css");el.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(el);},setContainer:function(){var main=document.createElement("div");main.setAttribute("id","greenPPCAd_main");main.style.width=0;main.style.background="url('http://ad.greenlabelppc.com/images/ad_background_"+greenPPCAd.bg+".gif') right center no-repeat";var container=document.createElement("div");container.setAttribute("id","greenPPCAd_container");var promo=document.createElement("a");promo.setAttribute("id","greenPPCAd_promo");promo.setAttribute("href","http://greenlabelppc.com");promo.setAttribute("target","_blank");promo.innerHTML="&nbsp;";var title=document.createElement("div");title.setAttribute("id","greenPPCAd_title");var text=document.createElement("div");text.setAttribute("id","greenPPCAd_text");container.appendChild(promo);container.appendChild(title);container.appendChild(text);main.appendChild(container);document.body.appendChild(main);},showAd:function(index){if(typeof index=='undefined'){var index=greenPPCAd.curImg;}
greenPPCAd.adPosition(index);window.clearInterval(window.closeTimer);window.openTimer=window.setInterval(greenPPCAd.incAdWidth,greenPPCAd.incInterval);greenPPCAd.curImg=index;},hideAd:function(){window.clearInterval(window.openTimer);window.closeTimer=window.setInterval(greenPPCAd.decAdWidth,greenPPCAd.incInterval);},incAdWidth:function(){var ad=document.getElementById("greenPPCAd_main");if(ad.clientWidth<greenPPCAd.width){var curWidth=parseInt(ad.style.width);var newWidth=curWidth+10;ad.style.width=newWidth+"px";}else{window.clearInterval(window.openTimer);document.getElementById("greenPPCAd_container").style.display="block";}},decAdWidth:function(){document.getElementById("greenPPCAd_container").style.display="none";var ad=document.getElementById("greenPPCAd_main");window.clearInterval(window.ShowTimer);if(ad.clientWidth>0){var curWidth=parseInt(ad.style.width);var newWidth=curWidth-10;ad.style.width=newWidth+"px";}else{window.clearInterval(window.closeTimer);}},adPosition:function(index){var ad=document.getElementById("greenPPCAd_main");if(!ad)return;var img=greenPPCAd.imgs[index];var imgPos=greenPPCAd.getAbsolutePos(img);default_left=greenPPCAd.left;default_top=greenPPCAd.top;cur_left='';cur_top='';if((parseInt(greenPPCAd.width)+parseInt(default_left))>img.width){cur_left=(img.width-parseInt(greenPPCAd.width)).toString();}else{cur_left=default_left;}
if(default_top.substr(0,1)=="-"){var top_pos=default_top.substr(1,default_top.length-1);if((parseInt(greenPPCAd.height)+parseInt(top_pos))>img.height){cur_top='0';}else{cur_top=(img.height-parseInt(greenPPCAd.height)-parseInt(top_pos)).toString();}}else{if((parseInt(greenPPCAd.height)+parseInt(default_top))>img.height){cur_top=(img.height-parseInt(greenPPCAd.height)).toString();}else{cur_top=default_top;}}
ad.style.left=imgPos.x+parseInt(cur_left)+"px";ad.style.top=imgPos.y+parseInt(cur_top)+"px";},getAbsolutePos:function(el){var scroll={x:0,y:0};var pos={x:0,y:0};pos.x=el.offsetLeft;pos.y=el.offsetTop;if(el.offsetParent){var tmp=greenPPCAd.getAbsolutePos(el.offsetParent);pos.x+=tmp.x;pos.y+=tmp.y;}
return pos;},rotateAds:function(){if(greenPPCAds[greenPPCAd.curAd]){greenPPCAd.setNextAd(greenPPCAd.curAd);greenPPCAd.curAd++;}else{greenPPCAd.curAd=0;greenPPCAd.setNextAd(greenPPCAd.curAd);greenPPCAd.curAd++;}},setNextAd:function(pos){var adTitle=document.createElement("a");adTitle.setAttribute("href",greenPPCAds[pos][2]);adTitle.setAttribute("target","_blank");adTitle.setAttribute("style","font-size: "+greenPPCAd.title_font_size+"px");adTitle.innerHTML=greenPPCAds[pos][0];var adText=document.createElement("a");adText.setAttribute("href",greenPPCAds[pos][2]);adText.setAttribute("target","_blank");adText.setAttribute("style","font-size: "+greenPPCAd.text_font_size+"px");adText.innerHTML=greenPPCAds[pos][1];document.getElementById("greenPPCAd_title").innerHTML='';document.getElementById("greenPPCAd_title").appendChild(adTitle);document.getElementById("greenPPCAd_text").innerHTML='';document.getElementById("greenPPCAd_text").appendChild(adText);}}
function greenPPCAdRun(){greenPPCAd.left=(typeof ad_custom_left=="undefined")?greenPPCAd.left:ad_custom_left;greenPPCAd.top=(typeof ad_custom_top=="undefined")?greenPPCAd.top:ad_custom_top;greenPPCAd.width=(typeof ad_custom_width=="undefined")?greenPPCAd.width:ad_custom_width;greenPPCAd.bg=(typeof ad_custom_background=="undefined")?greenPPCAd.bg:ad_custom_background;greenPPCAd.title_font_size=(typeof ad_custom_title_fontsize=="undefined")?greenPPCAd.title_font_size:ad_custom_title_fontsize;greenPPCAd.text_font_size=(typeof ad_custom_text_fontsize=="undefined")?greenPPCAd.text_font_size:ad_custom_text_fontsize;if(typeof ad_min_width=="undefined"){var image_width=greenPPCAd.min_width;}else{var image_width=ad_min_width;if(greenPPCAd.width>image_width){greenPPCAd.width=image_width;}}
var image_height=(typeof ad_min_height=="undefined")?greenPPCAd.min_height:ad_min_height;greenPPCAd.setStyle();greenPPCAd.setContainer();if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){var promo=document.getElementById('greenPPCAd_promo');promo.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/logo.png', sizingMethod='scale')";promo.runtimeStyle.background="none";}
var Imgs=document.getElementsByTagName('img');var cnt=Imgs.length;var j=0;for(var i=0;i<cnt;i++){var tmpImg=Imgs[i];if((tmpImg.width>=image_width)&&(tmpImg.height>=image_height)){Imgs[i].onmouseover=new Function('greenPPCAd.showAd('+j+')');Imgs[i].onmouseout=new Function('greenPPCAd.hideAd()');greenPPCAd.imgs.push(Imgs[i]);j++;}}
var ad=document.getElementById("greenPPCAd_main");ad.onmouseover=new Function('greenPPCAd.showAd();');ad.onmouseout=new Function('greenPPCAd.hideAd();');window.rotateTimer=window.setInterval(greenPPCAd.rotateAds,greenPPCAd.rotateInterval);greenPPCAd.rotateAds();}
keys=(typeof ad_custom_keywords=="undefined")?'':'&keywords='+encodeURIComponent(ad_custom_keywords);enc=(typeof ad_custom_encoding=="undefined")?'':'&enc='+encodeURIComponent(ad_custom_encoding);document.write('<scr'+'ipt type="text/javascript" src="http://ad.greenlabelppc.com/jsfeed/?aid='+aid+keys+enc+'"></scr'+'ipt>');