var aAdFeat = new Array(new Object(),new Object());
aAdFeat[0]['hed_text'] = 'Try GoToAssist Express FREE for 30 days.';
aAdFeat[0]['hed_url'] = 'http://ad.doubleclick.net/clk;218503339;13346828;i?http://altfarm.mediaplex.com/ad/ck/9710-85449-1105-0';
aAdFeat[0]['desc'] = 'Instantly solve technical issues and increase customer satisfaction with the easy-to-use GoToAssist Express.';
aAdFeat[0]['img_url'] = 'http://images.pcworld.com/shared/graphics/cms/g2ax_logo_75x75.gif';
aAdFeat[0]['logo_url'] = 'http://images.pcworld.com/shared/graphics/cms/g2ax_logo_89x31.gif';
aAdFeat[0]['cats'] = '1427,1443,1477,1468,1458,1449,1433,1428,1457,1465,1507,1494,1506,1503,1497,1498,1502,1499,1504,1505,863,1444,1727,1446,1445,1447,1448,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1478,1479,1480,1481,1482,1483,1474,1470,1476,1471,1473,1719,1472,1475,1459,1460,1462,1463,1461,1464,1451,1455,1453,1456,1454,1450,1452,1439,1434,1440,1437,1438,1441,1436,1442,1431,1430,1429,1467,1466,1500,1501,1508,1518,1509';
aAdFeat[0]['id'] = '261';
aAdFeat[1]['hed_text'] = 'Get the job done.<br/>From anywhere.';
aAdFeat[1]['hed_url'] = 'http://ad.doubleclick.net/clk;219790886;13346828;y?https://secure.logmein.com/welcome/default.aspx?originid=6206&destination=/welcome/access/it/1/&WT.mc_id=5932';
aAdFeat[1]['desc'] = 'Access hard-to-reach devices. Avoid going onsite. Be alerted of issues. LogMeIn helps you get your job done.';
aAdFeat[1]['img_url'] = 'http://images.pcworld.com/shared/graphics/cms/LogMeIn120x90_Central_shot.gif';
aAdFeat[1]['logo_url'] = 'http://images.pcworld.com/shared/graphics/cms/LogMeIn88x31.gif';
aAdFeat[1]['cats'] = '1465,1467,1466';
aAdFeat[1]['id'] = '301';
aAdFeat[1]['l1text'] = 'Try <b>LogMeIn Central</b> FREE for 14 days';
aAdFeat[1]['l1url'] = 'http://ad.doubleclick.net/clk;219790886;13346828;y?https://secure.logmein.com/welcome/default.aspx?originid=6206&destination=/welcome/access/it/1/&WT.mc_id=5932';

function categoryMatches(aAd,pageCategory)
{
                if(aAd['cats']!=null){
                        var catList=aAd['cats'].split(",");
                        for (var i=0; i<catList.length;i++)
                        {
                                if (catList[i] == pageCategory)
                                        return true;
                        }
                }
                return false;
}

function getFeaturedAds(id,catId)
{
        var  adBox=document.getElementById(id);
        var output="";


        for (var i=0;i<aAdFeat.length;i++){
                if(categoryMatches(aAdFeat[i],catId)){
			output+="<div class='sponsoredProduct' id='daftad_"+aAdFeat[i]['id']+"'><label>SPONSORED DOWNLOADS</label>";
                        output+='<div class="image"><img src="'+(aAdFeat[i]['img_url'])+'" class="product"></div>';
                        output+='<img src="'+(aAdFeat[i]['logo_url'])+'" height="31" width="88" class="logo">';
                        output+="<h1><a href='" + aAdFeat[i]['hed_url'] +"' class='linkInline' rel='nofollow'>";
                        output+= aAdFeat[i]['hed_text']+'</a></h1>';
                        output+='<p>'+(aAdFeat[i]['desc'])+'</p>';
                        if(aAdFeat[i]['purl']!= undefined){
                                output+='<img width="1" height="1" alt="" src="'+aAdFeat[i]['purl']+'" />';
                        }
                        output+="<ul>";
                        if(aAdFeat[i]['l1text']!= undefined){
                                output+="<li><a href='"+aAdFeat[i]['l1url']+"' rel='nofollow'>"+aAdFeat[i]['l1text']+"</a></li>"
                        }
                        if(aAdFeat[i]['l2text']!= undefined){
                                output+="<li><a href='"+aAdFeat[i]['l2url']+"' rel='nofollow'>"+aAdFeat[i]['l2text']+"</a></li>"
                        }
                        if(aAdFeat[i]['l3text']!= undefined){
                                output+="<li><a href='"+aAdFeat[i]['l3url']+"' rel='nofollow'>"+aAdFeat[i]['l3text']+"</a></li>"
                        }
                        output+="</ul></div><div class='spacer'></div>";
				}
        }
        if(output.length > 0){
                adBox.innerHTML=output;
        } else {
                adBox.parentNode.removeChild(adBox);
        }
}


