﻿﻿;var vietad_config=[6,1,10000,"http://test.vietad.vn/banner/Ad.aspx","http://logb2.vietad.vn/clickbanner.aspx",-1,-1,-1,"sa"];var boutputstr="";var $vaddomain="http://embed.vietad.vn/";var $bud="undefined";var $bif=(self.location!=top.location);var $bof=false;var $bmw=R2();var $bus=O();var $bmd=$bmw.document;var $bcu=null;var $burl="";var A=null;var B=vietad_config;var bss=false;var IE6=(navigator.appVersion.indexOf('MSIE 6.0')==-1)?false:true;var $isBallonAdLoaded=false;var $timeOut=300;var _ballonAds=null;var $traverseTimer=null;var $zoneType=null;var C={w:{n:["vietad_width"],i:[],e:[]},h:{n:["vietad_height"],i:[],e:[]},sz:{n:["vietad_sizeId"],i:[],e:[]},i:{n:["vietad_zoneId"],i:[],e:[]},t:{n:["vietad_typeId"],i:[],e:[]},tc:{n:["vietad_titleColor"],i:[],e:[]},dc:{n:["vietad_desColor"],i:[],e:[]},bgc:{n:["vietad_bgColor"],i:[],e:[]},bdc:{n:["vietad_borderColor"],i:[],e:[]},lc:{n:["vietad_linkColor"],i:[],e:[]},cid:{n:["vietad_containerid"],i:[],e:[]},flt:{n:["vietad_underfilter"],i:[],e:[]},tlul:{n:["vietad_underline"],i:[],e:[]},zt:{n:["vietad_zoneType"],i:[],e:[]}};var D=N("i");function R2(){try{var cx=top.document.location;return top;}catch(err){$bof=true;}var cwd=window;while(cwd!=cwd.parent){var cp=cwd.parent;try{var cx=cp.document.location;}catch(err){return cwd;}cwd=cp;}return cwd;}function O(){if(!$bmw.vietad_adunits){$bmw.vietad_adunits=[];}return $bmw.vietad_adunits;}function G(){var cw=window;var csz={"1":[760,90],"2":[468,60],"3":[728,90],"4":[950,90],"5":[658,60],"6":[120,60],"7":[250,60],"8":[120,600],"9":[120,240],"10":[160,600],"11":[180,250],"12":[250,300],"13":[360,190],"14":[250,250],"15":[200,200],"16":[336,280],"17":[300,250],"18":[290,200],"19":[100,100]};g($bmw,B[8]);d();}function g(cw,cf){var ct=new Date();var cs=ct.getTime();L(cw);(!cw.vietad_data[cf])?cw.vietad_data[cf]=1:cw.vietad_data[cf]++;cw.vietad_data.t=cs;}function L(cw){if(!cw.vietad_data){cw.vietad_data={};}}function d(){var ct=new Date();var cs=ct.getTime();var cu={};cu.w=window;cu.zid=D;cu.t=cs;cu.zt=N('zt');cu.tp=N('t');cu.sz=N("sz");cu.width=N('w');cu.height=N('h');cu.tc=N('tc');cu.dc=N('dc');cu.bgc=N('bgc');cu.bdc=N('bdc');cu.lc=N('lc');cu.zt=N('zt');if(!$bus[D]){$bus[D]=[];}$bus[D].push(cu);$bcu=cu;}function V(){var ct=new Date();var cs=ct.getTime();var cr=true;var cw=window;var cl=$bus[D].length;if(cl>B[1]){cr=false;}cl=$bus.length;if(cl>B[0]){return false;}if($bif){cr=false;}return cr;}function N(ck){var cr=null;var co=C[ck];var cw=window;for(var i=0;i<co.n.length;i++){if(cw[co.n[i]]){cr=cw[co.n[i]];break;}}return cr;}function T(cs){if(typeof encodeURIComponent=="function"){return encodeURIComponent(cs.toString());}else{return S(cs.toString());}}function p(ck,cv){if(!ck||ck=="")return;if(!cv)cv="";$burl=$burl+"&"+ck+"="+cv;}function o(ck){p(ck,N(ck));}function b(){var cr=R();cr=T(cr);p("r",cr);}function f(ck,cv){if(!ck||(!cv&&cv!=0)||ck==""||(cv==""&&typeof cv=="string"))return;$burl=$burl+"&"+ck+"="+cv;}function R(){var cr="";try{cr=$bmd.referrer;}catch(err){}if(cr==null){cr="";}return cr;}function e(ck){f(ck,N(ck));}function Z(){p("u",T(Q()));}function W(){$bcu.i=Math.random();var cn="vietadtmpf"+$bcu.i;var cs="<img name='"+cn+"' id='"+cn+"' style='width:0px;height:0px;padding:0px;margin:0px;border:0px;vertical-align:baseline;' border=0 />";document.write(cs);}function w(){var cf="-1";if($bif){var cw=window;cf=T(cw.location.href);}f("fu",cf);}function Q(){if($bof&&$bmd.referrer)return $bmd.referrer;return $bmd.location.href;}function J(){if(typeof D==$bud){D="";}if(!D){D="";}$burl="?i="+D;}function c(){var ca=Math.floor(Math.random()*10000)+10001;try{if($bmw.vietad_data.sid){ca=$bmw.vietad_data.sid;}else{ca=ca-10001;$bmw.vietad_data.sid=ca;}}catch(err){}f("ac",ca);}function K(){if(A)return;A={};var cu=navigator.userAgent.toLowerCase();A.isOpera=(cu.indexOf('opera')>-1);A.isIE=(!A.isOpera&&cu.indexOf('msie')>-1);A.isFF=(!A.isOpera&&!A.isIE&&cu.indexOf('firefox')>-1);A.addEvent=function(o,c,h){if(this.isIE){o.attachEvent('on'+c,h);}else{o.addEventListener(c,h,false);}}}function VadIframeOnload(obj,id){var fName=obj.name;var ci="vietadf"+$bcu.i;if(window.frames[fName].document.getElementById('objVad')){document.getElementById('div_'+obj.id).innerHTML=window.frames[fName].document.getElementById('objVad').innerHTML;if(obj)obj.parentNode.removeChild(obj);if(document.getElementById('imp_'+ci)){var url=document.getElementById('imp_'+ci).href;url=url+"&type=F5D58A5CFC32925D";SendHttpRequest(url);}}}function H(){var ci="vietadf"+$bcu.i;$burl=B[3]+$burl;$burl=$burl.substring(0,2048);var cs="<iframe name='"+ci+"' id='"+ci+"' border=0 frameborder=0  marginwidth='0' marginheight='0' scrolling='no' ";var cs=cs+"style=\"width:"+vietad_width+"px; height:"+vietad_height+"px;\" ";var cs=cs+"src=\""+$burl+"\"></iframe>";document.write(cs);}function E(){var cf=(function(){var cu=B[4]+$bcu.s;document.getElementById("vietadtmpf"+$bcu.i).setAttribute("src",cu);});A.addEvent(window,"load",cf);}function TrackImpression(cmp){var url='';url='?z='+D;url=url+'&type=F5D58A5CFC32925D';url=url+'&lst='+cmp;url=url+'&Pref='+T(Q());var cu=B[4]+url;SendHttpRequest(cu);}function U(){var cm=C;var cw=window;for(var co in cm){var cn=cm[co].n;if(cn){for(var i=0;i<cn.length;i++){if(typeof cw[cn[i]]!=$bud){cw[cn[i]]=null;}}}}}function F(){K();J();Z();p('w',$bcu.width);p('h',$bcu.height);p('sz',$bcu.sz);p('t',$bcu.t);p('tc',$bcu.tc);p('dc',$bcu.dc);p('bgc',$bcu.bgc);p('bdc',$bcu.bdc);p('lc',$bcu.lc);p('zt',$bcu.tp);b();$bcu.s=$burl;try{f("dx",$bmw.vietad_data[B[8]]);}catch(err){}w();W();c();$bcu.q=$burl;if(parseInt($bcu.tp)==2){var value=readCookie('closeAdVad');if(!value){LoadJquery();InitAd();}}else H();U();}G();if(V()){F();}function Adtt(s){document.write(s);}function InitAd(){if($traverseTimer==null)$traverseTimer=(new Date()).getTime();$burl=B[3]+$burl;$burl=$burl.substring(0,2048);LoadData($burl);}function LoadData(url){document.write("<SCRIPT LANGUAGE='Javascript' SRC='"+url+"'></SCRIPT>");}function LoadJquery(){var html_doc=document.getElementsByTagName('head')[0];if(typeof jQuery=='undefined'){var js_file=$vaddomain+'jquery.js';var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',js_file);html_doc.appendChild(js);var js_file=$vaddomain+'jquery.easing.js';var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',js_file);html_doc.appendChild(js);}var js_file=$vaddomain+'swfobject.js';var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',js_file);html_doc.appendChild(js);var css_file=$vaddomain+'Vad_balloon_ads.css';var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',css_file);html_doc.appendChild(css);if(IE6==true){var css_file=$vaddomain+'VietAd_IE6.css';var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',css_file);html_doc.appendChild(css);}else{var css_file=$vaddomain+'VietAd_IE7.css';var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',css_file);html_doc.appendChild(css);}}function LoadFileExendFromVad(url,type){var doc=document.getElementsByTagName('head')[0];if(type='js'){var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',js_file);doc.appendChild(js);}else{var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',css_file);doc.appendChild(css);}}var statusMini=false;function BallonAds(impression,click,filetype,file,width,height,url,title,layoutId){this.Impression=impression;this.Click=click;this.FileType=filetype;this.SrcFile=file;this.Width=width;this.Height=height;this.Url=url;this.Title=title;this.LayoutId=layoutId;}function ClickBalloonAds(){if($zoneType!=null&&_ballonAds!=null){var url='';url='?z='+D;url=url+'&type=2879BB7B31C03D83';url=url+'&c='+_ballonAds.Click;url=url+'&Pref='+T(Q());url=url+'&url='+_ballonAds.Url;var cu=B[4]+url;SendHttpRequest(cu);window.open(_ballonAds.Url);}}function SendHttpRequest(url){var imgObj=document.createElement('img');imgObj.type='image/gif';imgObj.src=url;imgObj.style.display='none';registerImg(imgObj);}function registerImg(obj){try{document.getElementsByTagName("head")[0].appendChild(obj);}catch(err){}}function WriteBallonAds(){var displayString='';if($zoneType!=null&&_ballonAds!=null){displayString+='<div id="divBalloonAdsVad" class="boxTiprightBtomVad" style="width:'+(parseInt(_ballonAds.Width)+3)+'px; height:'+(parseInt(_ballonAds.Height)+24)+'px">';displayString+='<div  class="ctentTiprightBtomVad">';displayString+='<div class="titleTipRBtomVad" style=" width:'+(parseInt(_ballonAds.Width)+3)+'px;">';displayString+='<a href="http://vietad.vn" target="_blank" id="logoVad" class="logoVad"></a>';displayString+='<div class="boxTextTipVad"  id="titleVad" style="display:none;float: left; width: '+(parseInt(_ballonAds.Width)-80)+'px;">';displayString+='<marquee scrolldelay="200">';displayString+='<a href="#">'+_ballonAds.Title+' </a>';displayString+='</marquee>';displayString+='</div>';displayString+='<div style="float: right; width: 42px;">';displayString+='<a id="ChangeVad" class="DownTipVad" href="javascript:void(0);" onclick="VadShowOrClose();"></a>';displayString+='<a class="closeTipVad" href="javascript:void(0);" onclick="closeBalloonAdsVad();"></a>';displayString+='</div>';displayString+=' <div style="clear: both"></div>';displayString+='</div>';displayString+='<div style="width: 100%;" class="boxItemTipVad">';displayString+='<a style="position:absolute;top:29px; width:100%;height:'+_ballonAds.Height+'px; display:block; padding-top:10px; cursor:pointer; z-index:20000;" href="javascript:void(0);" onclick="ClickBalloonAds();"></a>';switch(_ballonAds.FileType){case 'Flash':if(parseInt(_ballonAds.LayoutId)==8){displayString='<div id="divBalloonAdsVad" class="boxTiprightBtomVad" style="border:0px;background-image:none;width:'+(parseInt(_ballonAds.Width)+3)+'px; height:'+(parseInt(_ballonAds.Height)+24)+'px">';}displayString+='<object id="BalloonObjVad" name="BalloonObjVad" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+_ballonAds.Width+'" height="'+_ballonAds.Height+'">';displayString+='<param name="movie" value="'+_ballonAds.SrcFile+'" />';displayString+='<param name="allowScriptAccess" value="always"/>';displayString+='<param name="quality" value="high" />';displayString+='<param name="wmode" value="transparent">';displayString+='<!--[if !IE]>-->';displayString+='<object name="BalloonObjVad" type="application/x-shockwave-flash" data="'+_ballonAds.SrcFile+'" width="'+_ballonAds.Width+'" height="'+_ballonAds.Height+'">';displayString+='<param name="swliveconnect" value="true" />';displayString+='<param name="allowScriptAccess" value="always"/>';displayString+='<param name="quality" value="high" />';displayString+='<param name="wmode" value="transparent">';displayString+='<!--<![endif]-->';displayString+='<!--[if !IE]>-->';displayString+='</object>';displayString+='<!--<![endif]-->';displayString+='</object>';break;case 'Image':displayString+='<img src="'+_ballonAds.SrcFile+'" width="'+_ballonAds.Width+'" height="'+_ballonAds.Height+'">';break;case 'Video':displayString='';displayString+='<EMBED type="application/x-shockwave-flash"';displayString+='src="http://www.VietAd.vn/FlashPlayer.swf"';displayString+='allowscriptaccess="always"';displayString+='width="'+_ballonAds.Width+'" height="'+_ballonAds.Height+'"';displayString+='flashvars="&amp;file='+_ballonAds.SrcFile+'&amp;height='+_ballonAds.Height+'&amp;width='+_ballonAds.Width+'&amp;autostart=true&amp;link=javascript:ClickBalloonAds()&amp;fullscreen=true&amp;repeat=always&amp;stretching=exactfit&amp;linktarget=_self&amp;displayclick=link"';displayString+='allowfullscreen="true" />';break;default:break;}displayString+='</div> ';document.write(displayString);}}var t;function setMinButton(){var obj=swfobject.getObjectById("BalloonObjVad");if(obj&&typeof obj.JStoASviaExternalInterface!="undefined"){obj.JStoASviaExternalInterface('min');}}function showBalloonAdsVad(){if($zoneType!=null&&_ballonAds!=null){var w='0px';w=parseInt(_ballonAds.Width);w=w+'px';var sPos='bottom_right';if(sPos=='bottom_left'){document.getElementById("divBalloonAdsVad").style.left=0;document.getElementById("divBalloonAdsVad").style.display='block';}else if(sPos=='bottom_right'){document.getElementById("divBalloonAdsVad").style.right='-'+w;document.getElementById("divBalloonAdsVad").style.display='block';jQuery("#divBalloonAdsVad").animate({right:"0px"},{duration:"slow"});}TrackImpression(_ballonAds.Impression);}}function setTimeDelay(){t=setTimeout("minBalloonAdsVad()",7000);}function clearTimeDelay(){clearTimeout(t);}function minBalloonAdsVad(){var h='0px';statusMini=true;if(_ballonAds!=null){h=parseInt(_ballonAds.Height);h=h+'px'}if(0){if(IE6==false){jQuery("#divBalloonAdsVad").animate({bottom:"-250px"},{duration:"slow"});}else{jQuery("#divBalloonAdsVad").animate({height:"195px"},700);}}else{if(IE6==false){jQuery("#divBalloonAdsVad").animate({bottom:"-"+h},{duration:"slow"});if(document.getElementById('logoVad'))document.getElementById('logoVad').className='logoSubVad';if(document.getElementById('titleVad'))document.getElementById('titleVad').style.display='block';if(document.getElementById('ChangeVad'))document.getElementById('ChangeVad').className='UpTipVad';}else{jQuery("#divBalloonAdsVad").animate({height:"20px"},700);}};setMinButton();t=setTimeout("maxBalloonAdsVad()",30000);}function VadShowOrClose(){clearTimeDelay();if(statusMini==true)maxBalloonAdsVad();else minBalloonAdsVad();}function maxBalloonAdsVad(){var h='0px';statusMini=false;if(_ballonAds!=null){h=_ballonAds.Height+'px';}if(0){if(IE6==false){jQuery("#divBalloonAdsVad").animate({bottom:"0"},{duration:"slow"});}else{jQuery("#divBalloonAdsVad").animate({height:"227px"},700);}}else{if(IE6==false){if(document.getElementById('logoVad'))document.getElementById('logoVad').className='logoVad';if(document.getElementById('titleVad'))document.getElementById('titleVad').style.display='none';if(document.getElementById('ChangeVad'))document.getElementById('ChangeVad').className='DownTipVad';jQuery("#divBalloonAdsVad").animate({bottom:"0"},{duration:"slow"});}else{jQuery("#divBalloonAdsVad").animate({height:"227px"},700);}};t=setTimeout("minBalloonAdsVad()",15000);}function closeBalloonAdsVad(){jQuery("#divBalloonAdsVad").fadeOut("slow");var value=readCookie('closeAdVad');createCookie('closeAdVad','closed',0);}function WriteBug(msg){document.getElementById('bug').innerHTML+='<br/>'+msg;}function createCookie(name,value,minutes){if(minutes){var date=new Date();date.setTime(date.getTime()+(minutes*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";}function eraseCookie(name){createCookie(name,"",-1);}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;}

