


// JavaScript Document
 
/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
    --------------------------------------------------------------------
    
    Simple banner rotator. Version: 1.2.0
    Download, support, contact: http://www.spyka.net 
    (c) Copyright 2009 spyka Web Group
*/
 
/* 
    For full documentation:  http://www.spyka.net/docs/simple-banner-rotator
    For support:             http://www.spyka.net/forums
*/
 
//                                EDIT FROM HERE
///////////////////////////////////////////////////////////////////////////////////
//                                 Program options
 
 
// if 1 (one), all images will be resized to img_width and img_height, else images will display their correct size
var force_size    = 0;
// desired height and width of images, only takes affect if above is one
var img_width    = 728;
var img_height    = 90;
 
// time between refreshs of ad locations, to disable refreshs set to 0. In milliseconds, 1000 = 1 second
//var refresh_time = 8000;
var refresh_time = (10 * 1000);
//

// maximum amount of refreshs, good to set if a user may be on a page for a long period of time.
var refresh_max = 1000;
 
// if you do not want the same banners to display on the same page then set this to 0, else set it to 1.
// this option is only used if you have put the show_banners() javascript code more than once into a page
var duplicate_banners = 0;
 
// ignore/skip this line 
var banners = new Array();
 
// banner list syntax: banners[x] = new banner(website_name, website_url, banner_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
// be sure to increase x by 1 for each banner added!
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000
//new banner syntax:  banners[x] = new banner(Title Text, Title URL, Body Text, show_until_date);  DATE FORMAT: dd/mm/yyyy



	
			
			banners[0] = new banner('CGH55030F2 HEMT', 'http://ws.ireview.digikey.com/product-highlights/us/en/cree-cgh55030f2-hemt/1203', 'Cree\'s CGH55030F2 is a GaN high electron mobility transistor designed specifically for high efficiency, high gain, and wide bandwidth capabilities.', 'More...', '_blank','/Web Export/techzone/wireless/cree-cgh55030-cooptile.jpg', 'Cree - CGH55030F2 High Electron Mobility Transistor', 'Cree - CGH55030F2 High Electron Mobility Transistor', '02/03/2012', '02/01/2015','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=90_tzbanner_wireless_1203_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[1] = new banner('CC11x RF Value Line', 'http://www.digikey.com/product-highlights/us/en/texas-instruments-cc11x-rf-value-line/42', 'Texas Instruments\' CC11xLDK-868-915 and CC11xLEMK-433 dev. kits provide complete hardware performance testing and software development platforms.', 'More...', '_blank','/Web Export/techzone/wireless/ti-cc11x-cooptile.jpg', 'TI - CC11x RF Value Line', 'TI - CC11x RF Value Line', '11/29/2011', '12/01/2013','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=296_tzbanner_wireless_2801_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[2] = new banner('TE Connectivity RF Board-to-Board Connectors', 'http://www.digikey.com/us/en/ph/te/rfconnectors.html', 'TE Connectivity\'s innovative compression coaxial board-to-board connectors are designed as single-piece, blind-mating', 'More...', '_blank','/Web Export/techzone/wireless/Tyco-RFCoaxConnectors_CoopFliptile.jpg', 'TE Connectivity - RF Coaxial Board-to-Board Connectors', 'TE Connectivity - RF Coaxial Board-to-Board Connectors', '06/02/2011', '11/30/2013','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=17_tzbanner_wireless_797_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[3] = new banner('SST11CP15 RF Power Amp', 'http://www.digikey.com/product-highlights/us/en/microchip-sst11cp15-rf-power-amplifier/12', 'Microchip\'s SST11CP15 is a versatile power amp based on the highly-reliable InGaP/GaAs HBT technology for high-linearity, high-efficiency applications.', 'More...', '_blank','/Web Export/techzone/wireless/microchip-sst11-cooptile.jpg', 'Microchip - SST11CP15 RF Power Amplifier', 'Microchip - SST11CP15 RF Power Amplifier', '11/29/2011', '12/01/2013','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=150_tzbanner_wireless_2786_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[4] = new banner('Low Cost RF Modules', 'http://www.digikey.com/product-highlights/us/en/linx-low-cost-rf-modules/268', 'Linx Technologies offers a full line of hybrid RF modules to provide solutions which meet the needs of the most demanding applications, while maintaining the ease of implementation, reliable performance and high degree of flexibility for which Linx has become well-known.', 'More...', '_blank','/Web Export/techzone/wireless/linx-rf-module-cooptile.jpg', 'Linx - Low Cost RF Modules', 'Linx - Low Cost RF Modules', '09/30/2011', '02/02/2012','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=343_tzbanner_wireless_2871_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[5] = new banner('Ultra Low Noise Amplifiers', 'http://www.digikey.com/product-highlights/us/en/skyworks-lna/232', 'Skyworks Solutions offers a select group of ultra low noise, high linearity and versatile RF amplifiers which are in stock and ready for immediate design into your demanding receiver applications. For Cellular Infrastructure, the ultra low noise SKY67101, SKY67100 and SKY67102 are', 'More...', '_blank','/Web Export/techzone/wireless/skyworks-lna.jpg', 'Skyworks - Ultra Low Noise Amplifiers', 'Skyworks - Ultra Low Noise Amplifiers', '10/31/2011', '11/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=863_tzbanner_wireless_2890_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[6] = new banner('ANS Series NEMA Boxes', 'http://www.digikey.com/product-highlights/us/en/bud-industries-ans-series/520', 'Bud Industries&rsquo; ANS series NEMA boxes are rugged #ADC-12 die cast aluminum alloy. Their thick wall (0.098&rdquo;, 2.5 mm) construction provides strength and rigidity for heavy duty applications. One-piece molded outer silicone gaskets provide reliable, long lasting sealing', 'More...', '_blank','/Web Export/techzone/wireless/bud-ans-series-cooptile.jpg', 'Bud - ANS Series NEMA Boxes', 'Bud - ANS Series NEMA Boxes', '10/31/2011', '11/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=377_tzbanner_wireless_333_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[7] = new banner('SST12LP RF Power Amps', 'http://www.digikey.com/product-highlights/us/en/microchip-sst12lp17e-rf-power-amplifiers/9', 'Microchip\'s SST12LP17E &amp; SST12LP18E 2.4 GHz high-efficiency RF power amplifiers are based on the highly-reliable InGaP/GaAs HBT technology. Offering high linear output power, and low shut-down current for WLAN, home RF, cordless phones, 2.4 GHz ISM wireless equipment.', 'More...', '_blank','/Web Export/techzone/wireless/microchip-sst12lp-cooptile.jpg', 'Microchip - SST12LP RF Power AmpsSST12LP ', 'Microchip - SST12LP RF Power AmpsSST12LP ', '09/30/2011', '10/30/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=150_tzbanner_wireless_2780_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[8] = new banner('BTM511 and BTM521 Modules', 'http://www.digikey.com/us/en/ph/LairdTechnologies/BTM511-BTM521.html', 'Laird Technologies - Wireless M2M announces the release of its enhanced Bluetooth&reg; BTM511 and BTM521 wireless stereo audio modules with new firmware update. The BTM511 is a low-power Bluetooth&reg; module designed for adding robust audio and voice capabilities.', 'More...', '_blank','/Web Export/techzone/wireless/laird-m2m-btm511-cooptile.jpg', 'Laird BTM511 and BTM521 Modules', 'Laird BTM511 and BTM521 Modules', '09/01/2011', '09/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=776_tzbanner_wireless_2586_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[9] = new banner('DM182015-1 Dev Kit', 'http://www.digikey.com/us/en/ph/Microchip/dm182015-1-wireless-dev-kit.html', 'Microchip\'s 8-bit wireless dev kit with 2.4 GHz MRF24J40 is an easy-to-use eval and dev platform for IEEE 802.15.4 application designers. This kit includes Microchip&rsquo;s MRF24J40 transceiver module and also features Microchip&rsquo;s PIC18 XLP microcontroller family.', 'More...', '_blank','/Web Export/techzone/wireless/microchip-dm182015-cooptile.jpg', 'Microchip DM182015-1 Dev Kit', 'Microchip DM182015-1 Dev Kit', '08/01/2011', '09/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=150_tzbanner_wireless_2552_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[10] = new banner('SNB Series NEMA Boxes', 'http://www.digikey.com/us/en/ph/Bud/snbseries.html', 'BUD Industries\' stainless steel SNB series NEMA boxes provide top level protection &amp; cost savings. Durable 16-gauge steel with continuous seam welded corners, theses boxes are tested &amp; listed to UL-508 type 4x requirements, ideal for outdoor/factory floor requirements.', 'More...', '_blank','/Web Export/techzone/wireless/bud-snb-series-cooptile.jpg', 'Bud Industries SNB Series NEMA Boxes', 'Bud Industries SNB Series NEMA Boxes', '07/01/2011', '09/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=377_tzbanner_wireless_1606_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[11] = new banner('RF Switches', 'http://www.digikey.com/us/en/ph/Skyworks/rf-switches.html', 'Skyworks Solutions offers a select group of radio frequency (RF) switches for design into various markets including handsets, infrastructure, automotive, CATV / Satcom, smart energy, medical, military, RFID, RF / microwave test instruments, and WLAN / WiMAX / WiFi.', 'More...', '_blank','/Web Export/techzone/wireless/skyworks-rf-switches-cooptile.jpg', 'Skyworks RF Switches', 'Skyworks RF Switches', '07/01/2011', '09/29/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=863_tzbanner_wireless_2574_ph&WT.z_TechZone_Name=wireless','');

	
			
			banners[12] = new banner('NanoAnt™ BT 1.0 Antenna', 'http://www.digikey.com/us/en/ph/LairdTechnologies/nanoant-bt1.html', 'Laird Technologies\' NanoAnt&trade; BT 1.0 is optimized for Bluetooth apps, but can also be used in 802.11 and other general applications in the 2.4 - 2.5 GHz frequency range. The NanoAnt BT 1.0 is a small surface mount antenna exhibiting an omni-directional radiation pattern.', 'More...', '_blank','/Web Export/techzone/wireless/laird-nanoant-antenna-cooptile.jpg', 'Laird Technologies - NanoAnt BT 1.0 Antenna', 'Laird Technologies - NanoAnt BT 1.0 Antenna', '07/01/2011', '09/01/2011','?WT.z_link_type=Coop&WT.z_link_source=wireless_hp&WT.mc_id=994_tzbanner_wireless_2123_ph&WT.z_TechZone_Name=wireless','');

 
 
//                         There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////
 
var used = 0;
var first_pass = 0;
var location_counter = 1;
var refresh_counter = 1;
 
function banner(title, url, bodyText, moreLabel, target, image, altText, imageTitleText, startDate, endDate,webTrends,dcsMultiTrack)
{
    this.title    = title;
    this.url    = url;
    this.bodyText    = bodyText;	
	this.moreLabel = moreLabel;
	this.target = target;
	
	this.image = image;
	this.altText = altText;
	this.imageTitleText = imageTitleText;
    this.startDate = startDate;
    this.endDate    = endDate;
	this.webTrends = webTrends;
	this.dcsMultiTrack = dcsMultiTrack.replace(/\"/g,"\'");
    this.active = 1;
	
	//if the featured product is current or not.
	this.current = false;
}
 
function show_banners()
{
    var html = '<div id="adLocation-' + location_counter + '"></div>';
    document.write(html);
    display_banners(location_counter);
    location_counter++;
}

function startBanners() {
    var current = 0;
    var now  = new Date();

    for (var index in banners) {
        //alert(banners[index].title);
               
        var inputEndDate    = banners[index].endDate;
        var inputStartDate = banners[index].startDate;

        inputStartDate = inputStartDate.split('/', 3);
        inputEndDate = inputEndDate.split('/', 3);

        //new Date(year, month, day, hours, minutes, seconds, milliseconds)
        //month starts at 0 in javascript.
        var start_date = new Date(eval(inputStartDate[2]), (eval(inputStartDate[0]) - 1), eval(inputStartDate[1]), 00, 00, 00, 00);
        var end_date    = new Date(eval(inputEndDate[2]), (eval(inputEndDate[0]) - 1), eval(inputEndDate[1]), 23, 59, 59, 00);
        
        if((now > start_date) && (now < end_date)) {
			banners[index].current = true;
            current++;
        }

    }
    //alert("currentDate : " + current);

    if (current == 1) {
        show_banners();
    }

    else if (current == 2) {
        show_banners();
        show_banners();
    }

    else if (current >= 3) {
        show_banners();
        show_banners();
        show_banners();
    }

    else {
        //do nothing
    }
}


function display_banners(location)
{
    if(location == '' || !location || location < 0)
    {
        // no location given
        return;
    }
    
    var am    = banners.length;
    
    if((am == used) && duplicate_banners == 0) {
        // all banners have been used
        return;
    }
 
    var rand    = Math.floor(Math.random()*am);    
    var bn         = banners[rand];
    
    var image_size     = (force_size == 1) ? ' width="' + img_width + '" height="' + img_height + '"' : '';
    //var html         = '<a href="' + bn.url + '" title="' + bn.name + '" target="_blank"><img border="0" src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>';
	
	
	// if the image doesn't exists, do not use the image tag
	if (bn.image == '' || bn.image == ' ') {
		var html = "<div style=\"background:url(/Web%20Export/techzone/ms_featured_prod_bg.jpg) bottom no-repeat; padding: 0px 10px 0px 15px; font-size: 12px;\">\n\
					<br />\n\
					<a onclick=\"" +bn.dcsMultiTrack+ "\" onmouseover=\"freezebanner()\" onmouseout=\"unfreezebanner()\" href=\"" + bn.url + bn.webTrends + "\" target=\"" + bn.target + "\"><b>" + bn.title + "</b></a><br />" + bn.bodyText + "&nbsp;<a onclick=\"" +bn.dcsMultiTrack+ "\" href=\"" + bn.url + bn.webTrends + "\" target=\"" + bn.target + "\">" + bn.moreLabel + "</a><br /><br />\n\
				</div></br>"
	}
	
	else {
		var html = "<div style=\"background:url(/Web%20Export/techzone/ms_featured_prod_bg.jpg) bottom no-repeat; padding: 0px 10px 0px 15px; font-size: 12px;\">\n\
						<br /><a onclick=\"" +bn.dcsMultiTrack+ "\" href=\"" + bn.url + bn.webTrends + "\" target=\"" + bn.target + "\"><img onmouseover=\"freezebanner()\" onmouseout=\"unfreezebanner()\" border=\"0\" hspace=\"10\" align=\"left\" src=\"" + bn.image + "\" title=\"" + bn.imageTitleText + "\"/></a>\n\
						<a onclick=\"" + bn.dcsMultiTrack + "\" href=\"" + bn.url + bn.webTrends + "\" target=\"" + bn.target + "\"><b>" + bn.title + "</b></a><br />" + bn.bodyText + "&nbsp;<a onclick=\"" +bn.dcsMultiTrack+ "\" href=\"" + bn.url + bn.webTrends + "\" target=\"" + bn.target + "\">" + bn.moreLabel + "</a><br /><br />\n\
					</div></br>"
	}
    

    if ((bn.active == 1) && (bn.current))
    {
        var location_element = document.getElementById('adLocation-' + location);
        
        if(location_element == null)
        {
            // ad location doesn't exist
            alert('spyka Webmaster banner rotator\nError: adLocation doesn\'t exist!');
        }
        else
        {
            location_element.innerHTML = html;
            
            if(duplicate_banners == 0)
            {
                bn.active = 0;
                used++;
            }
        }
    }
    else
    {
        display_banners(location);
    }
}
 
function refresh_banners()
{
    if((refresh_counter == refresh_max) || refresh_time < 1)
    {
        clearInterval(banner_refresh);  
    }
    used = 0;
    for(i = 0; i < banners.length; i++)
    {
        banners[i].active = 1;
    }
    for(i = 1; i < location_counter; i++)
    {
        display_banners(i);
    }
    refresh_counter++;
}
var banner_refresh = window.setInterval(refresh_banners, refresh_time);
function freezebanner()
{
clearInterval(banner_refresh); 
}
function unfreezebanner()
{
clearInterval(banner_refresh);
banner_refresh = window.setInterval(refresh_banners, refresh_time);
}
//Triggers dcsMultiTrack() for tagging offsite link and documents
function wtExtTagging(z_link_type,z_link_source,mc_id,z_supplier_id)
{
	_tag.WT.z_link_type = z_link_type;
	_tag.WT.z_link_source = z_link_source;
	_tag.WT.mc_id = mc_id;
	_tag.WT.z_supplier_id = z_supplier_id;
}

