// 	Copyright:	ARTwareSOFTWARE 
//	Project:	Visit America
//	File: 		VAI_js.js
//	Version: 	3.0
//	Description:	Javascript programs page


var showIcons = new Array("0|1img|2title|3notused",
"2|accor|ACCOR|",
"3|amtr|AMTRAK|",
"4|bestwestern|Best Western|",
"5|choicet|Choice Hotels|",
"6|coach|Coach USA|",
"7|conrad|CONRAD|",
"8|crownplaza|Crown Plaza|",
"9|doubletree|Double Tree|",
"10|embassy|Embassy Suites|",
"12|grayline|Gray Line|",
"14|homewood|Homewood Suites|",
"17|kimpton|KIMPTON|",
"18|loews|LOEWS|",
"20|millenium|MILLENNIUM|",
"22|radisson|Radisson|",
"23|sofitel|SOFITEL|"
)

var luxHotels = new Array("0|1img|2title|3notused",
"1|4seasons|Four Seasons|",
"2|starwood|STARWOOD|",
"3|marriott|MARRIOTT|",
"4|hilton|Hilton|",
"5|intercontinental|INTERCONTINENTAL|",
"6|hyatt|HYATT|",
"7|fairmont|Fairmont|"
)

// "21|morgans|MORGANS HOTEL GROUP|",

img_num = showIcons.length -1

var repImages = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26)


function DisplayIcons() {
	DisplayLuxHotel();
	DisplayRandom();
}

function DisplayLuxHotel() {
    var num = luxHotels.length
    var lst = '<td><td width=72 bgcolor=white align=center><img src=images/pixel.gif width=50 height=10 border=0>'
    for(k=1;k<num;k++){
	txt  = luxHotels[k]
      	val  = txt.split('|')
	if(k ==1){	lst += "<img src=images/logos/logo_"}
	else {lst += "<br><br><img src=images/logos/logo_"}
	lst += val[1]
	lst += ".png  border=0 width=50>"
    }
    document.write(lst);
}

function DisplayRandom() {
    var num = 4
    oldsel  = 0
    var lst = ''
    for(k=1;k<=num;k++){
    	sel = 1 + Math.floor( (Math.random()*img_num) )
	sel = checkRepeat(k,sel)
	if(oldsel == sel) {sel = checkRepeat(k,sel)}
	else{ oldsel = sel}
	repImages[k] = sel
	txt  = showIcons[sel]
      	val  = txt.split('|')
	lst += "<br><br><img src=images/logos/logo_"
	lst += val[1]
	lst += ".png  border=0 width=50>"
    }
    lst += "</td>"
    document.write(lst);
}

function checkRepeat(fill,tryout) {
    for(l=1;l<fill;l++) {
	if(tryout == repImages[l]) {
	    ret = 1 + Math.floor( (Math.random()*img_num) )
	    return(ret)
	}
    }
    return(tryout)
}

function selBackg(section,num) {
	ret = "<td width=540 valign=bottom bgcolor=#A0A0A0 background=images/backg/"
	ret += section + "_"
	ret += (1 + Math.floor( (Math.random()*num) ))
	ret += ".png >"
	document.write(ret)
}

function showImages(section,num) {
	wid = 120
	img0 = "<img src=images/backg/" + section + "_"
	lnk0  = "<a HREF=images/backg/" + section + "_"
	document.write("<nobr>")
	for(k=1;k<=num;k++){
		lnk = lnk0 + k + ".png >"
		img = img0 + k + ".png width=" + wid + " ></a> &nbsp;" + k + "&nbsp;"
		document.write(lnk + img)
	}
	document.write("</nobr><br><br>")
}

function botLine(typ) {
	cp = '&nbsp;&nbsp; &copy; 2012 &nbsp; Visit America Inc &nbsp;&nbsp;'
	hr = '<hr size=1 color=EEDDDD>'
	bt = '<img src=images/pixel.gif width=720 height=8 border=0>'
	bt +=  '<tr><td valign="top" width="625" colspan=2 align=center>'
	bt +=  '<font face="Arial,Helvetica,Sanserif" size="-2" color=#404040>'
	bt +=  ' &nbsp;&nbsp;&nbsp;&nbsp; &copy; 2012 &nbsp; Visit America Inc &nbsp;&nbsp;&nbsp;&nbsp;'
	bt +=  ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; +1 (212) 683-8082 '
	bt +=  ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	bt +=  ' <a class=lnk href="mailto:visit\@visitamerica.com">visit\@visitamerica.com</a>'
	bt +=  '</font></td></tr><tr><td colspan="2"><img src=images/pixel.gif width=720 height=6 border=0>' + hr + '</td></tr>'
	document.write(bt)
}

function smallBotLine(typ) {
	cp = '&nbsp;&nbsp; &copy; 2012 &nbsp; Visit America Inc &nbsp;&nbsp;'

	bt =  '<font face="Arial,Helvetica,Sanserif" size="-2" color=#404040>'
	bt +=  ' &nbsp; &copy; 2012 &nbsp; Visit America Inc &nbsp;&nbsp;&nbsp;&nbsp;'
	bt +=  ' <a class=lnk href="mailto:visit\@visitamerica.com">visit\@visitamerica.com</a>'
	document.write(bt)
}

    function popUpWide(pg) {
	var sz = ''
	sz =  'width=550,height=600'
	sz += ',resizable,scrollbars=yes' 
	picWindow = window.open(pg,'widevia',sz)
	picWindow.focus()
    }

    function popUpNews(pg) {
	var sz = ''
	sz =  'width=550,height=600,resizable,scrollbars=yes' 
	picWindow = window.open(pg,'news',sz)
	picWindow.focus()
    }
