/* nz *//** NZ **/
var epi= document.domain;

// Major Hotel Sources in order of prefrence
var MajorHotelSits = new Array();
MajorHotelSits.name = 'MajorHotelSits';

// Booking.com
MajorHotelSits[0] = new Array(2);
if(loc.length == 0)
					MajorHotelSits[0][0] = 'http://www.booking.com/country/nz.html?aid=330958&label='+epi;
else
		MajorHotelSits[0][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss='+loc+'&si=ci,ai,re&label='+epi;

MajorHotelSits[0][1] = '<img src="http://www.vp2000.org/sf/images/booking.gif" border="0" width="120px" height="60px" />';
var main = MajorHotelSits[0][0];

// Laterooms
MajorHotelSits[1] = new Array(2);
MajorHotelSits[1][0] = 'http://laterooms.at/t9media?CTY=1&amp;CID=1999&DURL=http://www.laterooms.com/en/p5150/Hotels.aspx?k='+loc+'&LID='+epi;
MajorHotelSits[1][1] = '<img src="http://www.vp2000.org/sf/images/laterooms.gif" border="0" width="120px" height="60px" />';

// Hotels Combined
MajorHotelSits[2] = new Array(2);
MajorHotelSits[2][0] = 'http://www.hotelscombined.com/?a_aid=10112&label='+epi;
MajorHotelSits[2][1] = '<img src="http://www.vp2000.org/sf/images/hotelscombined.gif" border="0" width="120px" height="60px" />';


// Hotel Chains in order of prefrence
var UK_chains = new Array();
UK_chains.name = 'UK_chains';


//Best Western Hotels
UK_chains[0] = new Array(2);
UK_chains[0][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=best%20western&si=ho&country=nz&label='+epi;
UK_chains[0][1] = '<img src="http://www.vp2000.org/sf/images/bestwestern.jpg" border="0" width="120px" height="60px" />';

//novotel
UK_chains[1] = new Array(2);
UK_chains[1][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=novotel&si=ho&country=nz&label='+epi;
UK_chains[1][1] = '<img src="http://www.vp2000.org/sf/images/novotel.gif" border="0" width="120px" height="60px" />';

//holiday inn
UK_chains[2] = new Array(2);
UK_chains[2][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=holiday%20inn&si=ho&country=nz&label='+epi;
UK_chains[2][1] = '<img src="http://www.vp2000.org/sf/images/holidayinn.gif" border="0" width="120px" height="60px" />';


//crowne
UK_chains[3] = new Array(2);
UK_chains[3][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=Crown%20plaza&si=ho&country=nz&label='+epi;
UK_chains[3][1] = '<img src="http://www.vp2000.org/sf/images/crowne.png" border="0" width="120px" height="60px" />';

//travelodge
UK_chains[4] = new Array(2);
UK_chains[4][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=travelodge&si=ho&country=nz&label='+epi;
UK_chains[4][1] = '<img src="http://www.vp2000.org/sf/images/travelodge.png" border="0" width="120px" height="60px" />';


//crowne
UK_chains[5] = new Array(2);
UK_chains[5][0] = 'http://www.booking.com/searchresults.html?aid=330958&ss=ibis&si=ho&country=nz&label='+epi;
UK_chains[5][1] = '<img src="http://www.vp2000.org/sf/images/ibis.jpg" border="0" width="120px" height="60px" />';



function ShowMainURL(link, theList, max)
{
    link.href=theList[0][0];
    FireMain(theList,max);
        self.focus();
}
function FireMain(theList,max)
{
    for(i = 0; i < max; i++)
    {
        window.open(theList[i][0]);
    }
}

function Fire(start,theList)
{
    //open first
    //window.open(theList[start][0]);

    for(i = 0; i < theList.length; i++)
    {
        //attempt to open all but start
        if(i!=start)
            window.open(theList[i][0]);
    }
    self.focus();
}

/**
* Outputs maxNum merchants from the passed array with logos and links
*/
function ShowList(theList, maxNum)
{
    if(maxNum==0)
        maxNum=theList.length;
     for(i=0;i<maxNum;i++)
     {
        the_image = theList[i][1];
        the_link = theList[i][0];
        document.write('<a target="_blank" href="'+the_link+'" onclick="Fire('+i+','+theList.name+');">'+the_image+'</a>')
     }
}