var titleArr = new Array();
var redirectArr = new Array();
var imgArr = new Array();
var urlArr = new Array();
var favArr = new Array();
var descArr = new Array();
var scriptId = 0;
var cssId = 0;
var aid = "";
var affl = "";
var subid = "MA***";
var listingsCount = 10;
var ipaddress = "38.107.179.238";
var ua = "CCBot/1.0 (+http://www.commoncrawl.org/bot.html)";
var mobile_browser = "0";
var mobile_device = "Desktop / full capability browser";
var dev = "";
var sword = "Cheap Airfare";
var dittoimage = 0;
var click_tracking = "";
var firstClick = 0;
var adHide = 0;
var currentWidth = 0;
var currentHeight = 0;
var expand = 0;
var orient = "";
var wscaleFactor = 0;
var hscaleFactor = 0;
var currentOrient = "profile";
var currentURL = document.location.href;
var items = null;
var pageUrl = "";
var refUrl = encodeURIComponent(document.referrer);
var crawlData = null;
//alert(pageUrl);
var numAds = 0;
var adBlock = 0;
var adLimit = 10;
var numRows = 0;
var numCols = 0;
var newSearch = 0;
var delayHide = 1;
var hideFunctionID = "";
var titleCol = "fff";
var descCol = "cfcfcf";
var urlCol = "cfcfcf";
var bgCol = "111111";
var opacity = "0.85";
var numOfAds = 0;
function trackclick(url)
{
if(document.images){
(new Image()).src=url;
}
}
if(dev=="ipad"){uPort=2;uLand=2;ePortR=5;ePortC=2;eLandR=5;eLandC=2;uHeight=40;uWidPort=760;uWidLand=1012;eWidPort=760;eHtPort=200;eWidLand=1016;eHtLand=660}else{uPort=1;uLand=1;ePortR=7;ePortC=1;eLandR=3;eLandC=1;uHeight=40;uWidPort=320;uWidLand=480;eWidPort=320;eHtPort=408;eWidLand=480;eHtLand=210}if(mobile_browser==1){function xss_css(a){var c=null;var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a);b.setAttribute("id","css_id"+cssId);c=document.getElementById("css_id"+cssId);if(c){document.getElementsByTagName("head")[0].removeChild(c)}document.getElementsByTagName("head")[0].appendChild(b);cssId++}function loadScript(b,d){var c=document.getElementsByTagName("head")[0];addLater=false;if(!c){c=document.createElement("head");addLater=true}var a=document.createElement("script");a.src=b;a.type="text/javascript";if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null}}}else{a.onload=function(){}}c.appendChild(a);if(addLater){document.documentElement.appendChild(c)}}if(mobile_device=="Apple"||mobile_device=="Android"){if(dev=="ipad"){url="http://m.admedia.com/images/ipad_new.php?titleCol="+titleCol+"&descCol="+descCol+"&urlCol="+urlCol+"&bgCol="+bgCol+"&opacity="+opacity;xss_css(url)}else{url="http://m.admedia.com/images/iphone_new.php?titleCol="+titleCol+"&descCol="+descCol+"&urlCol="+urlCol+"&bgCol="+bgCol+"&opacity="+opacity;xss_css(url)}if(dev=="ipad"){document.write('
')}else{document.write('')}function init(){updateLayout(expand,0)}window.onresize=function(){updateLayout(expand,0)};window.addEventListener("orientationchange",function(){updateLayout(expand,1)},false);var curPos=window.pageYOffset+window.innerHeight-40-25;window.onscroll=function(){if(dev=="ipad"){if(expand==0){topPos=window.innerHeight-40-15}else{topPos=window.innerHeight-((numRows*60)+10)-8}}else{if(expand==0){topPos=window.innerHeight-40-20}else{topPos=0}}document.getElementById("admobile").style.top=curPos+"px";var a=(window.pageYOffset+topPos)+"px";document.getElementById("admobile").style.top=a;document.getElementById("admobile").style.left=(window.pageXOffset)+"px";if(dev=="ipad"){if(expand==0){curPos=window.pageYOffset+window.innerHeight-40}else{curPos=window.pageYOffset+window.innerHeight-((numRows*60)+10)-8}}else{if(expand==0){curPos=window.pageYOffset+window.innerHeight-40-20}else{curPos=window.pageYOffset}}};function hideAd(){document.getElementById("admobile").style.visibility="hidden"}function closeAd(){adHide=1;document.getElementById("admobile").style.visibility="hidden"}function showAd(a){if(adHide==0){document.getElementById("admobile").style.visibility="visible"}adjustHeight(a,1,0)}function updateLayout(b,c){currentWidth=window.innerWidth;currentHeight=window.innerHeight;if(currentOrient!=window.orientation){currentOrient=window.orientation;c=1}if(currentWidth-1;if(!a){closeAd()}adjustHeight(0,c,0);document.getElementById("admobile").style.webkitTransformOrigin="bottom left";if(orient=="profile"){document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}else{document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}}setTimeout(function(){if(b==1){showAd(0)}else{if(dev=="ipad"){moveTop=window.pageYOffset+window.innerHeight-40-15}else{moveTop=window.pageYOffset+window.innerHeight-40-25}document.getElementById("admobile").style.left=(window.pageXOffset)+"px";document.getElementById("admobile").style.top=moveTop+"px";if(adHide==0){document.getElementById("admobile").style.visibility="visible"}}},100)}function adjustHeight(c,e,d){if(d==1){clearInterval(hideFunctionID);hideFunctionID=setInterval("closeAd();",30000)}hideAd();currentHeight=window.innerHeight;currentWidth=window.innerWidth;if(c==1){adBlock=1;expand=1-expand;firstClick=1}if(expand==1){totalAds=numOfAds;if(orient=="profile"){if(totalAds%2!=0){totalAds-=1}ads_in_row=ePortC;total_rows=parseInt((totalAds/ads_in_row));if(dev=="ipad"){if(total_rows<2){total_rows=2}var a=((total_rows*60)+18)+"px"}else{a=eHtPort+"px"}var b=eWidPort+"px"}else{ads_in_row=eLandC;total_rows=parseInt((totalAds/ads_in_row));if(dev=="ipad"){if(total_rows<2){total_rows=2}a=((total_rows*60)+18)+"px"}else{a=eHtLand+"px"}b=eWidLand+"px"}}else{document.getElementById("admobile").style.webkitTransform="scale(1)";if(orient=="profile"){a=uHeight+"px";b=uWidPort+"px";scaleFactor=(currentWidth/(uWidPort))}else{a=uHeight+"px";b=uWidLand+"px";scaleFactor=(currentWidth/(uWidLand))}}document.getElementById("admobile").style.height=a;document.getElementById("admobile").style.width=b;if(expand!=1){if(dev=="ipad"){moveTop=window.pageYOffset+window.innerHeight-40-10}else{moveTop=window.pageYOffset+window.innerHeight-40-10}document.getElementById("admobile").style.webkitTransformOrigin="bottom left";if(orient=="profile"){document.getElementById("admobile").style.webkitTransform="scale("+scaleFactor+")"}else{document.getElementById("admobile").style.webkitTransform="scale("+scaleFactor+")"}document.getElementById("admobile").style.top=moveTop+"px"}if(adHide==0){document.getElementById("admobile").style.visibility="visible"}if(e==1){loadAds()}}function loadAds(){if(sword!=""){var a=[];a.contextual=sword;handleMobLoading(a)}else{handleMobLoading(crawlData)}}function handleMobLoading(b){if(!crawlData){crawlData=b}if(firstClick==1&&!items){var a="http://m.admedia.com/content.php?aid="+aid+"&affl="+affl+"&subid="+encodeURI(subid)+"&n="+listingsCount+"&Terms="+encodeURI(b.contextual)+"&ip="+ipaddress+"&ua="+encodeURI(ua)+"&ref="+encodeURI(currentURL)+"&nt="+Math.random()+"&callback=getMobContentCallback";loadScript(a,function(){})}else{getMobContentCallback(items,0,0)}}function scrollAds(a){getMobContentCallback(items,a,0)}getMobContentCallback=function(e,d,k){items=e;if(k==1){numOfAds=e.items.length;for(var f=0;f1){adBlock--}else{adBlock=Math.ceil(adLimit/numAds)}}else{adBlock=1}}var c=(adBlock-1)*numAds;if((c+numAds)<=adLimit){var j=(c+numAds)}else{var j=adLimit}var a="";if(dev=="ipad"){a+=''}j=numAds;for(var f=c;f";if(firstClick==1){title=titleArr[f];url=redirectArr[f];image=imgArr[f];desc=descArr[f];domain=urlArr[f];favicon=favArr[f]}if(dev=="ipad"){a+=''}if(dev!="ipad"||(dev=="ipad"&&f==(j-1))){a+='
'}if(firstClick==1){a+="
"+desc+"
";if(favicon!=""){a+="
"}a+=""+domain+"
"}else{nword=sword.substr(0,14);nword+="..";a+="
"}if(dev=="ipad"){a+="
"}a+=""}}a+="
";document.getElementById("admobile").innerHTML=a}else{addRemSearch(1);if(dev=="ipad"){totalAds=numOfAds;if(orient=="profile"){if(totalAds%2!=0){totalAds-=1}ads_in_row=ePortC;numRows=parseInt((totalAds/ads_in_row));if(numRows<2){numRows=2}numCols=ePortC;wscaleFactor=(window.innerWidth/(eWidPort+4));hscaleFactor=(window.innerHeight/((numRows*60)+10))}else{ads_in_row=eLandC;numRows=parseInt((totalAds/ads_in_row));if(numRows<2){numRows=2}numCols=eLandC;wscaleFactor=(window.innerWidth/(eWidLand+4));hscaleFactor=(window.innerHeight/((numRows*60)+10))}moveTop=window.pageYOffset+(window.innerHeight-((numRows*60)+10))-8;document.getElementById("admobile").style.webkitTransform="scale(1)";document.getElementById("admobile").style.top=moveTop+"px";if(adHide==0){document.getElementById("admobile").style.visibility="visible"}document.getElementById("admobile").style.webkitTransformOrigin="bottom left";if(orient=="profile"){document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}else{document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}}else{if(orient=="profile"){numRows=ePortR;numCols=ePortC;wscaleFactor=(window.innerWidth/eWidPort);hscaleFactor=(window.innerHeight/eHtPort)}else{numRows=eLandR;numCols=eLandC;wscaleFactor=(window.innerWidth/eWidLand);hscaleFactor=(window.innerHeight/eHtLand)}moveTop=window.pageYOffset;document.getElementById("admobile").style.webkitTransform="scale(1)";document.getElementById("admobile").style.top=moveTop+"px";if(adHide==0){document.getElementById("admobile").style.visibility="visible"}document.getElementById("admobile").style.webkitTransformOrigin="top left";if(orient=="profile"){document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}else{document.getElementById("admobile").style.webkitTransform="scale("+wscaleFactor+")"}}numAds=numRows*numCols;adLimit=numOfAds;if(d==1){var h=Math.ceil(adLimit/numAds);if((adBlock+1)<=h){adBlock++}else{adBlock=1}}else{if(d==-1){if(adBlock>1){adBlock--}else{adBlock=Math.ceil(adLimit/numAds)}}else{adBlock=1}}var c=(adBlock-1)*numAds;if((c+numAds)<=adLimit){var j=(c+numAds)}else{var j=adLimit}var a="";var b=0;if(dev=="ipad"){a+=''}else{a+=''}var g=1;for(var f=c;f";titl=titleArr[f];url=redirectArr[f];image=imgArr[f];desc=descArr[f];domain=urlArr[f];favicon=favArr[f];if(dev=="ipad"){a+=''}if(f==6&&dev!="ipad"){titl="";url="";image="";desc="";favicon="";domain=""}if(g==1){a+="

";g=0}a+="
"+desc+"
";if(favicon!=""){a+="
"}a+=""+domain+"
";a+="
";if(dev=="ipad"){a+="
"}a+="";if(dev=="ipad"){a+="
"}b++}}document.getElementById("admobile").innerHTML=a;if(newSearch==1){adjustHeight(0,0,0);newSearch=0}}};function confirmClick(a){trackclick(click_tracking);clearInterval(hideFunctionID);hideFunctionID=setInterval("closeAd();",30000);window.open(a)}function addRemSearch(a){if(a==1){}else{}}function searchNewAds(d){clearInterval(hideFunctionID);hideFunctionID=setInterval("closeAd();",30000);adBlock=0;newSearch=1;document.getElementById("admobile_searchsubmit").focus();if(expand==0){topPos=window.innerHeight-40}else{topPos=window.innerHeight-((100*numRows)+10)}document.getElementById("admobile").style.top=curPos+"px";var b=(window.pageYOffset+topPos-8)+"px";document.getElementById("admobile").style.top=b;var a=d;if(a==""||!a){adjustHeight(1,1,1);return}sword=a;var c="http://m.admedia.com/content2.php?&aid="+aid+"&affl="+affl+"&subid="+encodeURI(subid)+"&n="+listingsCount+"&Terms="+encodeURI(a)+"&ip="+ipaddress+"&ua="+ua+"&ref="+encodeURI(currentURL)+"&nt="+Math.random()+"&callback=getMobContentCallback";loadScript(c,function(){})}function adjustForm(){clearInterval(hideFunctionID);hideFunctionID=setInterval("closeAd();",30000);var a=curPos-window.innerHeight+100;var b=prompt("Search");if(b!=""&&b!=null){searchNewAds(b)}}window.addEventListener("load",function(){hideFunctionID=setInterval("closeAd()",30000)},false);init()}else{}};