/***************************************************

   FILE:  /JavaScript/ads_main.js
   AUTH:  Thuy Le

   DATE:  November 17, 2008
   LMD :  March 14, 2010

	Functions & Classes for Main Ads:
	1. Top
	2. Bottom
	3. Bar of 120x60 ads

***************************************************/


/*

main_ads [ad_cnt++] = "<a href='' target=_blank><img src='' border=0 width=728 height=90 alt=''></a>";

*/

ad_cnt	= 0;
main_ads = new Array();

// Discover
main_ads [ad_cnt++] = "<a href='http://www.anrdoezrs.net/click-2476192-10370038' target=_blank><img src='http://www.awltovhc.com/image-2476192-10370038' border=0 width=468 height=60 alt='Discover Open Road Card - 5% Cashback Bonus on gas and automotive purchases.'></a>";

// Free Credit Report
main_ads [ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-10490239' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10490239' border=0 width=728 height=90 alt='FreeCreditReport.com - Know Your Credit Score for FREE!'></a>";

// ING Direct
main_ads [ad_cnt++] = "<a href='http://www.anrdoezrs.net/click-2476192-10547650' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10547650' border=0 width=728 height=90 alt='ING Direct Savings Account.'></a>";
main_ads [ad_cnt++] = "<a href='http://www.anrdoezrs.net/click-2476192-10497672' target=_blank><img src='http://www.awltovhc.com/image-2476192-10497672' border=0 width=468 height=60 alt='ING Direct Checking with High Interest LIKE Savings Account.'></a>";

// LowerMyBills.com
main_ads [ad_cnt++] = "<a href='http://www.tkqlhce.com/click-2476192-10292673' target=_blank><img src='http://www.tqlkg.com/image-2476192-10292673' border=0 width=728 height=90 alt='LowerMyBills.com - Mortgage Rates Hit Record Lows!'></a>";
main_ads [ad_cnt++] = "<a href='http://www.dpbolvw.net/click-2476192-10641485' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10641485' border=0 width=728 height=90 alt='LowerMyBills.com - Auto Insurance'></a>";

// Reunion.com
main_ads [ad_cnt++] = "<a href='http://www.dpbolvw.net/click-2476192-10425224' target=_blank><img src='http://www.awltovhc.com/image-2476192-10425224' border=0 width=468 height=60 alt='Reunion.com - Who is searching for you? Click here to find out.'></a>";


ad_cnt = 0;
main_ads2 = new Array();

// Coupons.com
main_ads2 [ad_cnt++] = "<a href='http://www.tkqlhce.com/click-2476192-10395827' target=_blank><img src='http://www.tqlkg.com/image-2476192-10395827' border=0 width=468 height=60 alt='coupons.com - Save Money, Be Happy. Click here to print FREE coupons now!'></a>";

// Free Scholarship Guide
main_ads2 [ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-10381760' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10381760' border=0 width=468 height=60 alt='FreeScholarshipGuide - Win a $5000 Scholarship. Free Guide to Thousands of Scholarships.'></a>";

// Job.com
main_ads2 [ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-1147012' target=_blank><img src='http://www.awltovhc.com/image-2476192-1147012' border=0 width=468 height=60 alt='Job.com - ATTENTION! Click Here for 1000s of Great Jobs!'></a>";

// TradingSolutions
main_ads2 [ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-1481400' target=_blank><img src='http://www.awltovhc.com/image-2476192-1481400' border=0 width=468 height=60 alt='TradingSolutions'></a>";
main_ads2 [ad_cnt++] = "<a href='http://www.anrdoezrs.net/click-2476192-10399000' target=_blank><img src='http://www.awltovhc.com/image-2476192-10399000' border=0 width=468 height=60 alt='TradingSolutions'></a>";

// VistaPrint.com
main_ads2 [ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-10285320' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10285320' border=0 width=468 height=60 alt='VistaPrint.com - Everything is FREE - Business cards, Holiday cards, Calendars, and more...'></a>";


/*

main_ads2 [ad_cnt++] = "<a href='' target=_blank><img src='' border=0 width=468 height=60 alt=''></a>";

*/


ad_cnt = 1;
bar_ads = new Array();

bar_ads[ad_cnt++] = "<a href='http://www.tkqlhce.com/click-2476192-10473074' target=_blank><img src='http://www.lduhtrp.net/image-2476192-10473074' border=0 width=120 height=60 alt='FreeCreditReport.com'></a>";

bar_ads[ad_cnt++] = "<a href='http://www.dpbolvw.net/click-2476192-10574229' target=_blank><img src='http://www.awltovhc.com/image-2476192-10574229' border=0 width=120 height=60 alt='Discover Credit Card'></a>";

bar_ads[ad_cnt++] = "<a href='http://www.dpbolvw.net/click-2476192-10466307' target=_blank><img src='http://www.tqlkg.com/image-2476192-10466307' border=0 width=120 height=60 alt='CigArrest to stop smoking in 7 Days!'></a>";

bar_ads[ad_cnt++] = "<a href='http://www.kqzyfj.com/click-2476192-10416335' target=_blank><img src='http://www.ftjcfx.com/image-2476192-10416335' border=0 width=120 height=60 alt='Freelance Jobs'></a>";

bar_ads[ad_cnt++] = "<a href='http://www.anrdoezrs.net/click-2476192-10384739' target=_blank><img src='http://www.awltovhc.com/image-2476192-10384739' border=0 width=120 height=60 alt='Paltalk.com Free Trial'></a>";


/*

bar_ads[ad_cnt3++] = "<a href='' target=_blank><img src='' border=0 width=120 height=60 alt=''></a>";

*/



cnt = 1;

txt_ads = new Array();
txt_ads[cnt++] = new TxtAds( "Discover Card", "www.discovercard.com", "fin", "http://www.kqzyfj.com/click-2476192-10574232", "Get $50 Cash Back for applying!" );
txt_ads[cnt++] = new TxtAds( "CigArrest", "www.cigarrest.com", "health", "http://www.kqzyfj.com/click-2476192-10457900", "FREE TRIAL. Stop smoking in 7 days." );

/*
txt_ads[cnt++] = new TxtAds( "name", "url", "cat", "home", "desc" );
txt_ads[cnt++] = new TxtAds( "", "", "", "", "" );
*/


//////////////////////////////////      F U N C T I O N S        /////////////////////////////


function displayAdTitle()
{
	return "<p align=center><font id=adText>- a d v e r t i s e m e n t -</font><br>";
}

/*********************************************************************
 *
 *  Display Ad on top / bottom / bar of 120x60 ads.
 *
 *********************************************************************/
function displayMainAd()
{
	max=main_ads.length;
	rand_num = Math.round( Math.random() * 1000 ) % max;
	layout = "<p>" + displayAdTitle();
	layout += main_ads[rand_num] + "<p>";

	document.write( layout );
}

function displayMainAd2()
{
	max=main_ads2.length;
	rand_num = Math.round( Math.random() * 1000 ) % max;
	layout = "<p>" + displayAdTitle();
	layout += main_ads2[rand_num] + "<p>";

	document.write( layout );
}

function displayBarAds()
{
	max = bar_ads.length;
	layout = "<p><table border=0 align=center cellpadding=3 cellspacing=3><tr>";

	for ( i=1; i<max; i++ )
	{
		layout += "<td><table border><tr><td>";
		layout += bar_ads[i];
		layout += "</td></tr></table></td>";
	}

	layout += "</tr></table><p>";

	document.write( layout );
}

/********************************************************
 *
 *   Returns text ads displayed on left column of page.
 *
 ********************************************************/
function displayTxtAds()
{
	for ( i=1; i<=txt_ads.length; i++ )
	{
		tac  = "<a href='" + txt_ads[i].url + "' target=_top id=mItem2>" + txt_ads[i].name + "</a><br>";
		tac += "<font id=mItem3>" + txt_ads[i].desc + "</font><br>";
		tac += "<a href='" + txt_ads[i].url + "' target=_top id=mItem2>" + txt_ads[i].url_home + "</a><p>";
	}
	
	return tac;
}


/********************************************************
 * btl
 *  Class contains main ads' members:
 *	_ name:	Ad name
 *	_ url:		URL
 *	_ url_home:	URL home page
 *	_ desc:		Description
 *	_ cat:		Category
 *
 ********************************************************/
function TxtAds( ad_name, ad_url_home, ad_cat, ad_url, ad_desc )
{
	this.name	= ad_name;
	this.url	= ad_url;
	this.url_home	= ad_url_home;
	this.desc	= ad_desc;
	this.cat	= ad_cat;

	return this;
}

