// =======================================
// Ad Selector
// =======================================

// Specify the image files
var FrontAdPic = new Array() // don't touch this
var FrontAdAlt = new Array() // don't touch this
var FrontAdUrl = new Array() // addition for url functionality
var FrontAdOnClk = new Array() // addition for OnClick functionality

// Retrieve the current page url for ads which return to the same page they were click on.
var path2 = location.pathname.lastIndexOf('/')
var thispage2 = "http://store.yahoo.com/cgi-bin/clink?yhst-4043893163530+mvHk4H+" + location.pathname.substr(path2+1) + "+storewide10"
if (thispage2 == '')  {
    thispage2 = 'http://www.otcwholesale.com/index.html' 
	}
	
// For a SAME PAGE refresh follow this example
//FrontAdPic[0] = 'http://site.diabeticdiscountdirect.com/ads/frontpageads/tranzitions10-580x200.jpg'
//FrontAdAlt[0] = 'Click here to save 10% on all Tranzitions products!'
//FrontAdUrl[0] = thispage2
//FrontAdOnClk[0] = 'Save 10% on Tranzitions Coupon Activated!\r\n\r Please click OK and wait for page to refresh.'
	
// To add more images continue the pattern, adding to the array below: 

FrontAdPic[0] = 'http://site.diabeticdiscountdirect.com/ads/frontpageads/noxzema10-580x175.jpg'
FrontAdAlt[0] = 'Click here to save 10% on Noxzema Products!'
FrontAdUrl[0] = 'http://store.yahoo.com/cgi-bin/clink?yhst-4043893163530+EFnpCE+noxzema.html+noxzema10'
FrontAdOnClk[0] = 'Save 10% on Noxzema Coupon Activated!\r\n\r Please click OK and wait for page to refresh.'

FrontAdPic[1] = 'http://site.diabeticdiscountdirect.com/ads/frontpageads/reliamed10-580x200.jpg'
FrontAdAlt[1] = 'Click here to save 10% on ReliaMed Electrotherapy Products!'
FrontAdUrl[1] = 'http://store.yahoo.com/cgi-bin/clink?yhst-4043893163530+KyPugw+reliamed.html+reliamed10'
FrontAdOnClk[1] = 'Save 10% off ReliaMed Coupon Activated!\r\n\r Please click OK and wait for page to refresh.'

FrontAdPic[2] = 'http://site.diabeticdiscountdirect.com/ads/frontpageads/joico10-580x170.jpg'
FrontAdAlt[2] = 'Click here to save 10% on all Joico products!'
FrontAdUrl[2] = 'http://store.yahoo.com/cgi-bin/clink?yhst-4043893163530+vbjkVQ+joico.html+joico10'
FrontAdOnClk[2] = 'Save 10% on Joico Coupon Activated!\r\n\r Please click OK and wait for page to refresh.'

FrontAdPic[3] = 'http://site.diabeticdiscountdirect.com/ads/frontpageads/orthogel10-580x200.jpg'
FrontAdAlt[3] = 'Click here to save 10% on Orthogel Products!'
FrontAdUrl[3] = 'http://store.yahoo.com/cgi-bin/clink?yhst-4043893163530+WCxvXe+orthogel.html+orthogel10'
FrontAdOnClk[3] = 'Save 10% on Orthogel Coupon Activated!\r\n\r Please click OK and wait for page to refresh.'


// =======================================
// Put Image in Place
// =======================================
var rand2 = Math.random();
var currentimg2 = Math.floor(FrontAdPic.length * rand2);

function FrontAdSelector()
{
document.images.FrontAd.src = FrontAdPic[currentimg2];
document.images.FrontAd.alt = FrontAdAlt[currentimg2];
}

function FrontAdLink(){
window.location = FrontAdUrl[currentimg2];
}

function FrontAdClick(){
if (FrontAdOnClk[currentimg2] != ''){
alert(FrontAdOnClk[currentimg2]);
}
}