﻿/*

        Filename:          script.js
        Description:       Javascript functions
        Client:            Joe Kelly Worldwide, Inc.
        Sites:             avdeli.com
        Author:            Steven Dahlman, DCM Software
        Start date:        12-09-07
        Last modification: 08-10-10

*/

// Base URLs (HTTP and HTTPS)
var baseurl = "http://www.avdeli.com/";
var baseurls = "https://www.avdeli.com/";

//
// Shockwave Flash values
//
// "classid"
// "codebase"
// "pluginspage"
// "type"
//
// Alternate codebase: http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0
//
var sFlashClassId ="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
var sFlashCodeBase = "http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0";
var sFlashPlugInsPage = "http://www.macromedia.com/go/getflashplayer";
var sFlashType = "application/x-shockwave-flash";

//
// User's operating system
//
// strOS = "W" if Windows
//       = "M" if Macintosh
//       = "U" if Unix
//       = "L" if Linux
//       = "?" if unknown (default)
//
var strOS = "?";

if ( navigator.appVersion.indexOf("Win") >= 0 ) {
	strOS = "W";
} else if ( navigator.appVersion.indexOf("Mac") >= 0 ) {
	strOS = "M";
} else if ( navigator.appVersion.indexOf("X11") >= 0 ) {
	strOS = "U";
} else if ( navigator.appVersion.indexOf("Linux") >= 0 ) {
	strOS = "L";
}

//
// Product names
//
// -Product page filenames
//
var prodname_AVD = new Array( 'American Country', 'Duck Soup', 'Headcase', 'Rhythm Nation', 'Rock &amp; Roll', 'Sports Zone', 'The City' );
var prodfile_AVD = new Array( 'amcountry.htm', 'ducksoup.htm', 'headcase.htm', 'rhythm.htm', 'rockroll.htm', 'sportszone.htm', 'thecity.htm' );

//
// Function:    addfavorite
//
// Description: Add site to browser favorites
//
// Input:
// site    = Site code (AVD)
// baseurl = Base URL
//
// Return code:
//  0 = Success
// -1 = Invalid argument
// -2 = Browser not supported
//
function addfavorite (site) {

	var url;   // Page URL
	var title; // Page title

	if ( site == 'AVD' ) {

		url = baseurl;
		title = "AVDeli.com";

	} else {

		// Invalid argument
		return(-1);

	}

	if ( window.sidebar ) {

		// Firefox
		window.sidebar.addPanel(title, url, "");

	} else if ( window.opera && window.print ) {

		// Opera
		var elem = document.createElement('a');
		elem.setAttribute('href', url);
		elem.setAttribute('title', title);
		elem.setAttribute('rel', 'sidebar');
		elem.click();

	} else if ( document.all ) {

		// Internet Explorer
		window.external.AddFavorite(url, title);

	} else {

		alert("Error: Your browser does not support this function.");
		return(-2);

	}

	return(0);

}

//
// Function:    bannerad
//
// Description: Display banner ad
//
// Input:
// site    = Site code (AVD)
// sponsor = Sponsor code (N)
// baseurl = Base URL
//
// Shockwave Flash values:
// sFlashClassId
// sFlashCodeBase
// sFlashPlugInsPage
// sFlashType
//
// -Display in "bannerspan" SPAN on home page -> <SPAN id="bannerspan"></SPAN>
// -To call, place in BODY tag: onload="bannerad('[site code]',1);"
// -Ads are stored on AVD site only
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function bannerad (site, sponsor) {

	var duration;  // Duration (seconds) to display ad
	var html;      // HTML tags
	var imgbase;   // Image file basename (GIF or SWF in image/banner/)
	var imgheight; // Image height (pixels)
	var imgtype;   // Animation type (gif|swf)
	var imgwidth;  // Image width (pixels)
	var link;      // Link (URL)

	//
	// Unused ads:
	//
	// Joe Kelly Creative Services
	// link = "http://www.jkcsonline.com/";
	// imgbase = "ad_jkcs";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 14.0;
	//
	// Kate West
	// link = "http://www.katewest.net/";
	// imgbase = "ad_katewest";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 10.0;
	//
	// Kidd Kradick
	// link = "http://kiddkraddickinfo.com/main/";
	// imgbase = "ad_kraddick";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 14.0;
	//
	// Mike Crank
	// link = "http://www.mikecrank.com/";
	// imgbase = "ad_crank";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 20.0;
	//
	// MusExpo
	// link = "http://www.musexpo.net/";
	// imgbase = "ad_musexpo";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 8.0;
	//
	// Ned Spindle
	// link = "http://www.planetned.com/";
	// imgbase = "ad_spindle";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 17.0;
	//
	// Perez Hilton
	// link = "http://perezhilton.com/";
	// imgbase = "ad_perez2";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 15.0;
	//
	// Producers Warehouse
	// link = "mailto:producerswarehouse@cox.net";
	// imgbase = "ad_prodware1";
	// imgwidth = 403;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 8.0;
	//
	// Radio And Production
	// link = "http://www.rapmag.com/";
	// imgbase = "ad_radioprod";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 8.0;
	//
	// Ryan On The Radio
	// link = "http://www.ryanontheradio.com/";
	// imgbase = "ad_rotr";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 15.0;
	//
	// Stone Voiceovers
	// link = "http://www.stonevoiceovers.com/Home.html";
	// imgbase = "ad_stone";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "gif";
	// duration = 6.0;
	//
	// WSBX
	// link = "http://www.wsbxradio.com/";
	// imgbase = "ad_wsbx";
	// imgwidth = 400;
	// imgheight = 62;
	// imgtype = "swf";
	// duration = 7.0;
	//

	if ( site == 'AVD' ) {

		//
		// AVD
		//
		if ( sponsor == 1 ) {

			// Kate West
			link = "http://www.katewest.net/";
			imgbase = "ad_katewest";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "swf";
			duration = 10.0;

			sponsor = 2;

		} else if ( sponsor == 2 ) {

			// Black
			link = "http://www.avdeli.com/";
			imgbase = "ad_black";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "gif";
			duration = 1.0;

			sponsor = 3;

		} else if ( sponsor == 3 ) {

			// Stone Voiceovers
			link = "http://www.stonevoiceovers.com/Home.html";
			imgbase = "ad_stone";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "gif";
			duration = 6.0;

			sponsor = 4;

		} else if ( sponsor == 4 ) {

			// Black
			link = "http://www.avdeli.com/";
			imgbase = "ad_black";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "gif";
			duration = 1.0;

			sponsor = 5;

		} else if ( sponsor == 5 ) {

			// Radio And Production
			link = "http://www.rapmag.com/";
			imgbase = "ad_radioprod";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "swf";
			duration = 8.0;

			sponsor = 6;

		} else if ( sponsor == 6 ) {

			// Black
			link = "http://www.avdeli.com/";
			imgbase = "ad_black";
			imgwidth = 400;
			imgheight = 62;
			imgtype = "gif";
			duration = 1.0;

			sponsor = 1;

		} else {

			return(-1);

		}

	} else {

		return(-1);

	}

	if ( imgtype == 'gif' ) {

		//
		// Display animated GIF
		//
		html = '<A href="' + link + '" target="new"><IMG src="' + baseurl + 'image/banner/' + imgbase + '.gif" width=' + imgwidth + ' height=' + imgheight + ' border=0></IMG></A>';

	} else if ( imgtype == 'swf' ) {

		//
		// Display Flash animation
		//
		// -Quality: High
		//
		var sFlashFile = baseurl + 'image/banner/' + imgbase + '.swf';

		html  = '<OBJECT classid="' + sFlashClassId + '" codebase="' + sFlashCodeBase + '" ';
		html += 'width="' + imgwidth + '" height="' + imgheight + '">';

		html += '<PARAM name="movie" value="' + sFlashFile + '"></PARAM>';
		html += '<PARAM name="quality" value="high"></PARAM>';
		html += '<PARAM name="loop" value="true"></PARAM>';
		html += '<PARAM name="Wmode" value="transparent"></PARAM>';

		html += '<EMBED src="' + sFlashFile + '" ';
		html += 'pluginspage="' + sFlashPlugInsPage + '" play="true" loop="false" ';
		html += 'menu="false" quality="high" scale="noborder" wmode="transparent" ';
		html += 'width="' + imgwidth + '" height="' + imgheight + '" type="' + sFlashType + '"></EMBED>';

		html += '</OBJECT>';

		// html += '<BR /><CENTER><A href="' + link + '" target="new" class="demo_link">Web site</A></CENTER>';

	} else {

		return(-1);

	}

	// Display image
	if ( html ) { document.getElementById('bannerspan').innerHTML = html; }

	// After duration, call this function again and display next sponsor
	setTimeout('bannerad(\'' + site + '\',' + sponsor + ')', duration * 1000);

	return(0);

}

//
// Function:    confirm_delete()
//
// Description: Confirm deletion of customer record
//
// Input:
// userid   = Userid to delete
// password = Password of userid to delete
// baseurl  = Base URL
//
// -Called by member.pl from AVD site only
//
// Return code:
//  0 = Success
//
function confirm_delete (userid, password) {

	var msg = 'Warning: This will delete customer userid \'' + userid + '\' with password \'' + password + '\'.';

	if ( confirm(msg) == true ) {

		location.href = baseurl + 'cgi-bin/member.pl?DEL,' + userid + ',' + password;

	}

	return(0);

}

//
// Function:    confirm_reset()
//
// Description: Confirm table reset
//
// Input:
// site    = Site code (AVD)
// tcode   = Table code (N)
// tname   = Table name
// baseurl = Base URL
//
// -Called by member.pl (AVD) when user selects "Reset Table" option
// -If confirmed, restart and pass user's selection
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function confirm_reset (site, tcode, tname) {

	var msg = 'Warning: This will reset the ' + tname + ' table.';

	if ( site == 'AVD' ) {
		// AVDeli.com
	} else {
		// Invalid site code
		return(-1);
	}

	if ( confirm(msg) == true ) {

		if ( site == 'AVD' ) {
			location.href = baseurl + 'cgi-bin/member.pl?RCD';
		}

	}

	return(0);

}

//
// Function:    filelist
//
// Description: Display pop-up window listing files in specific directory
//
// Input:
//
// site    = Site code (AVD)
// volume  = "Volume 02" or "Bonus Pak"
// title   = Product title (text)
//
// baseurl = Base URL
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function filelist (site, volume, title) {

	var body;          // HTML "BODY" section
	var head;          // HTML "HEAD" section

	var win;           // Window handle
	var wfeatures;     // Window features

	var wwidth = 800;  // Window width (pixels)
	var wheight = 600; // Window height (pixels) 

	// Center window on screen
	var wleft = (screen.width - wwidth) / 2;
	var wtop = (screen.height - wheight) / 2;

	// Window features
	wfeatures = 'width=' + wwidth + ',height=' + wheight + ',left=' + wleft + ',top=' + wtop;
	wfeatures += ',resizeable=no,scrollbars=yes,titlebar=no,menubar=no,directories=no,personalbar=no,status=no';

	// Open window
	win = window.open('','',wfeatures);
	win.focus();

	//
	// Build HEAD section
	//
	head = '\n\n<HEAD>\n';

	if ( site == "AVD" ) {
		// avdeli.com
		head += '\t<TITLE>avdeli.com</TITLE>\n';
		head += '\t<BASE href="' + baseurl + '"></BASE>\n';
	} else {
		// Invalid argument
		return(-1);
	}

	head += '\t<LINK href="style.css" type="text/css" rel="stylesheet"></LINK>\n';
	head += '\t<SCRIPT type="text/javascript" src="script.js"></SCRIPT>\n';
	head += '</HEAD>';

	//
	// Build BODY section
	//
	body = '\n\n<BODY leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>\n\n';

	body += '<TABLE width="100%" height="100%" border=0 cellpadding=4 cellspacing=0 bgcolor="#ffffff"><TR><TD align="center" valign="top">\n\n';

	// "Close window" button (top)
	body += '<A href="javascript:window.close();" onMouseOver="swapimg(1,\'closewin2\');" onMouseOut="swapimg(1,\'closewin1\');"><IMG id="closewin_top" src="image/closewin1.jpg" width=92 height=13 border=0 alt="Close Window"></IMG></A><BR />\n\n';

	// Product title
	body += '<CENTER><P class="ptitle3">' + title + '<BR />' + volume + '</P></CENTER>\n\n';

	// "Close window" button (bottom)
	body += '<A href="javascript:window.close();" onMouseOver="swapimg(2,\'closewin2\');" onMouseOut="swapimg(2,\'closewin1\');"><IMG id="closewin_bot" src="image/closewin1.jpg" width=92 height=13 border=0 alt="Close Window"></IMG></A>\n\n';

	body += '</TD></TR></TABLE></BODY>\n\n';

	// Display content
	win.document.write('<HTML>' + head + body + '</HTML>');
	win.document.close();

	return(0);

}

//
// Function:    library_menu
//
// Description: Display "Library Menu" on home page
//
// Input:
// site          = Site code (AVD)
// @prodname_AVD = AVD product names (array)
// @prodfile_AVD = AVD product page filenames (array)
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function library_menu (site) {

	var mwidth = 140; // Menu width and height (pixels)
	var n = 0;        // Array index
	var swidth = 110; // Sub-menu width (pixels)

	// Style to position arrow at right of menu row
	var astyle = "background-image: url(image/arrow.gif)\; background-repeat: no-repeat\; background-position: center right\;";

	if ( site == "AVD" ) {

		//
		// AVDeli
		//
		document.write('<TD colspan=2><TABLE border=0 cellpadding=0 cellspacing=0>');

		for ( n = 0; n < prodname_AVD.length; n ++ ) {

			document.write('<TR><TD><A href="prodpage/' + prodfile_AVD[n] + '" class="library_menu">' + prodname_AVD[n].toUpperCase() + '</A></TD></TR>');

		}

		document.write('</TABLE></TD>');

	} else {

		// Invalid argument
		return(-1);

	}

	return(0);

}

//
// Function:    menu
//
// Description: Handle menu events
//
// Input:
//
// site    = Site code (AVD)
//
// item    = Pointer to tabel cell of menu item
//
// menu    = "M" if main menu
//         = "S" if sub menu
//
// active  = 0 for normal colors (default)
//         = 1 for highlight colors
//
// submenu = Submenu to toggle
//            0 = None
//            1 = "libsub1"
//            2 = "libsub2"
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function menu (site, item, menu, active, submenu) {

	var bgcolor;
	var subid;

	if ( menu == 'M' ) {

		//
		// Main menu
		//
		if ( active == 1 ) {
			bgcolor = "#223b7d";
		} else {
			bgcolor = "#00013a";
		}

		//
		// Toggle sub-menu
		//
		if ( submenu != 0 ) {

			if ( submenu == 1 ) {
				subid = "libsub1";
			} else if ( submenu == 2 ) {
				subid = "libsub2";
			} else {
				return(-1);
			}

			if ( active == 1 ) {
				document.getElementById(subid).style.visibility = 'visible';
			} else {
				document.getElementById(subid).style.visibility = 'hidden';
			}

		}

	} else if ( menu == 'S' ) {

		// Sub menu
		if ( active == 1 ) {
			bgcolor = "#223b7d";
		} else {
			bgcolor = "#4e8ed2";
		}

	} else {

		// Invalid argument
		return(-1);

	}

	// Change background color
	item.style.backgroundColor = bgcolor;

	return(0);

}

//
// Function:    playflash
//
// Description: Play Flash animation
//
// Input:
// basename = Flash file basename (in \image sub-directory)
// width    = Width (pixels) of animation
// height   = Height (pixels) of animation
//
// Shockwave Flash values:
// sFlashClassId
// sFlashCodeBase
// sFlashPlugInsPage
// sFlashType
//
// -Quality: High
//
// Return code:
//  0 = Success
//
function playflash (basename, width, height) {

	var sFlashFile = 'image/' + basename + '.swf'; // Flash path/filename

	document.write('<OBJECT classid="' + sFlashClassId + '" codebase="' + sFlashCodeBase + '" ');
	document.write('width="' + width + '" height="' + height + '">');

	document.write('<PARAM name="movie" value="' + sFlashFile + '"></PARAM>');
	document.write('<PARAM name="quality" value="high"></PARAM>');

	document.write('<EMBED src="' + sFlashFile + '" ');
	document.write('pluginspage="' + sFlashPlugInsPage + '" play="true" loop="true" ');
	document.write('menu="false" quality="high" scale="noborder" ');
	document.write('width="' + width + '" height="' + height + '" type="' + sFlashType + '"></EMBED>');

	document.write('</OBJECT>');

	return(0);

}

//
// Function:    playsound()
//
// Description: Play (or stop) sound file
//
// Input:
//
// sfile = Audio file path/filename or
//       = Audio file basename (MP3 file in audio/ sub-directory)
//
// id    = Unique number to identify sound object
//
// mode  = 1 to play sound (default)
//       = 0 to stop sound
//
// -Uses SoundManager API
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function playsound (sfile, id, mode) {

	if ( ! sfile ) {
		// Missing argument
		return(-1);
	} else if ( ! id ) {
		// Missing argument
		return(-1);
	}

	//
	// Audio path/filename
	//
	var position;
	var soundfile;

	position = sfile.length - 3;

	if ( sfile.substring(position) == 'mp3' ) {
		// Path/filename passed
		soundfile = sfile;
	} else {
		// Basename only passed
		soundfile = "audio/" + sfile + ".mp3";
	}

	// Sound ID
	var soundID = 'sound' + id;

	// Stop any currently-playing sound
	soundManager.stopAll();

	if ( mode != 0 ) {

		// Create sound
		soundManager.createSound( { id: soundID, url: soundfile, autoPlay: false } );

		// Play sound
		soundManager.play(soundID);

	}

	return(0);

}

//
// Function:    popcountry()
//
// Description: Populate SELECT control with country names
//
// Return code:
//  0 = Success
//
function popcountry () {

	document.write('<SELECT name="country">');

	document.write('<OPTION value="US">United States</OPTION>');
	document.write('<OPTION value="CA">Canada</OPTION>');

	document.write('<OPTION value="AF">Afghanistan</OPTION>');
	document.write('<OPTION value="AL">Albania</OPTION>');
	document.write('<OPTION value="DZ">Algeria</OPTION>');
	document.write('<OPTION value="AS">American Samoa</OPTION>');
	document.write('<OPTION value="AD">Andorra</OPTION>');
	document.write('<OPTION value="AO">Angola</OPTION>');
	document.write('<OPTION value="AI">Anguilla</OPTION>');
	document.write('<OPTION value="AQ">Antarctica</OPTION>');
	document.write('<OPTION value="AG">Antigua and Barbuda</OPTION>');
	document.write('<OPTION value="AR">Argentina</OPTION>');
	document.write('<OPTION value="AM">Armenia</OPTION>');
	document.write('<OPTION value="AW">Aruba</OPTION>');
	document.write('<OPTION value="AU">Australia</OPTION>');
	document.write('<OPTION value="AT">Austria</OPTION>');
	document.write('<OPTION value="AZ">Azerbaijan</OPTION>');
	document.write('<OPTION value="BS">Bahamas, The</OPTION>');
	document.write('<OPTION value="BH">Bahrain</OPTION>');
	document.write('<OPTION value="BD">Bangladesh</OPTION>');
	document.write('<OPTION value="BB">Barbados</OPTION>');
	document.write('<OPTION value="BY">Belarus</OPTION>');
	document.write('<OPTION value="BE">Belgium</OPTION>');
	document.write('<OPTION value="BZ">Belize</OPTION>');
	document.write('<OPTION value="BJ">Benin</OPTION>');
	document.write('<OPTION value="BM">Bermuda</OPTION>');
	document.write('<OPTION value="BT">Bhutan</OPTION>');
	document.write('<OPTION value="BO">Bolivia</OPTION>');
	document.write('<OPTION value="BA">Bosnia and Herzegovina</OPTION>');
	document.write('<OPTION value="BW">Botswana</OPTION>');
	document.write('<OPTION value="BV">Bouvet Island</OPTION>');
	document.write('<OPTION value="BR">Brazil</OPTION>');
	document.write('<OPTION value="IO">British Indian Ocean Territory</OPTION>');
	document.write('<OPTION value="VG">British Virgin Islands</OPTION>');
	document.write('<OPTION value="BN">Brunei</OPTION>');
	document.write('<OPTION value="BG">Bulgaria</OPTION>');
	document.write('<OPTION value="BF">Burkina Faso</OPTION>');
	document.write('<OPTION value="BI">Burundi</OPTION>');
	document.write('<OPTION value="KH">Cambodia</OPTION>');
	document.write('<OPTION value="CM">Cameroon</OPTION>');
	document.write('<OPTION value="CV">Cape Verde</OPTION>');
	document.write('<OPTION value="KY">Cayman Islands</OPTION>');
	document.write('<OPTION value="CF">Central African Republic</OPTION>');
	document.write('<OPTION value="TD">Chad</OPTION>');
	document.write('<OPTION value="CL">Chile</OPTION>');
	document.write('<OPTION value="CN">China</OPTION>');
	document.write('<OPTION value="CX">Christmas Island</OPTION>');
	document.write('<OPTION value="CC">Cocos (Keeling) Islands</OPTION>');
	document.write('<OPTION value="CO">Colombia</OPTION>');
	document.write('<OPTION value="KM">Comoros</OPTION>');
	document.write('<OPTION value="CG">Congo</OPTION>');
	document.write('<OPTION value="CK">Cook Islands</OPTION>');
	document.write('<OPTION value="CR">Costa Rica</OPTION>');
	document.write('<OPTION value="CI">C&#244;te d&#146;Ivoire</OPTION>');
	document.write('<OPTION value="HR">Croatia</OPTION>');
	document.write('<OPTION value="CU">Cuba</OPTION>');
	document.write('<OPTION value="CY">Cyprus</OPTION>');
	document.write('<OPTION value="CZ">Czech Republic</OPTION>');
	document.write('<OPTION value="CD">Democratic Republic of the Congo</OPTION>');
	document.write('<OPTION value="DK">Denmark</OPTION>');
	document.write('<OPTION value="DJ">Djibouti</OPTION>');
	document.write('<OPTION value="DM">Dominica</OPTION>');
	document.write('<OPTION value="DO">Dominican Republic</OPTION>');
	document.write('<OPTION value="TL">East Timor</OPTION>');
	document.write('<OPTION value="EC">Ecuador</OPTION>');
	document.write('<OPTION value="EG">Egypt</OPTION>');
	document.write('<OPTION value="SV">El Salvador</OPTION>');
	document.write('<OPTION value="GQ">Equatorial Guinea</OPTION>');
	document.write('<OPTION value="ER">Eritrea</OPTION>');
	document.write('<OPTION value="EE">Estonia</OPTION>');
	document.write('<OPTION value="ET">Ethiopia</OPTION>');
	document.write('<OPTION value="FO">Faeroe Islands</OPTION>');
	document.write('<OPTION value="FK">Falkland Islands</OPTION>');
	document.write('<OPTION value="FJ">Fiji</OPTION>');
	document.write('<OPTION value="FI">Finland</OPTION>');
	document.write('<OPTION value="MK">Former Yugoslav Republic of Macedonia</OPTION>');
	document.write('<OPTION value="FR">France</OPTION>');
	document.write('<OPTION value="GF">French Guiana</OPTION>');
	document.write('<OPTION value="PF">French Polynesia</OPTION>');
	document.write('<OPTION value="TF">French Southern Territories</OPTION>');
	document.write('<OPTION value="GA">Gabon</OPTION>');
	document.write('<OPTION value="GM">Gambia, The</OPTION>');
	document.write('<OPTION value="GE">Georgia</OPTION>');
	document.write('<OPTION value="DE">Germany</OPTION>');
	document.write('<OPTION value="GH">Ghana</OPTION>');
	document.write('<OPTION value="GI">Gibraltar</OPTION>');
	document.write('<OPTION value="GR">Greece</OPTION>');
	document.write('<OPTION value="GL">Greenland</OPTION>');
	document.write('<OPTION value="GD">Grenada</OPTION>');
	document.write('<OPTION value="GP">Guadeloupe</OPTION>');
	document.write('<OPTION value="GU">Guam</OPTION>');
	document.write('<OPTION value="GT">Guatemala</OPTION>');
	document.write('<OPTION value="GN">Guinea</OPTION>');
	document.write('<OPTION value="GW">Guinea-Bissau</OPTION>');
	document.write('<OPTION value="GY">Guyana</OPTION>');
	document.write('<OPTION value="HT">Haiti</OPTION>');
	document.write('<OPTION value="HM">Heard Island and McDonald Islands</OPTION>');
	document.write('<OPTION value="HN">Honduras</OPTION>');
	document.write('<OPTION value="HK">Hong Kong</OPTION>');
	document.write('<OPTION value="HU">Hungary</OPTION>');
	document.write('<OPTION value="IS">Iceland</OPTION>');
	document.write('<OPTION value="IN">India</OPTION>');
	document.write('<OPTION value="ID">Indonesia</OPTION>');
	document.write('<OPTION value="IR">Iran</OPTION>');
	document.write('<OPTION value="IQ">Iraq</OPTION>');
	document.write('<OPTION value="IE">Ireland</OPTION>');
	document.write('<OPTION value="IL">Israel</OPTION>');
	document.write('<OPTION value="IT">Italy</OPTION>');
	document.write('<OPTION value="JM">Jamaica</OPTION>');
	document.write('<OPTION value="JP">Japan</OPTION>');
	document.write('<OPTION value="JO">Jordan</OPTION>');
	document.write('<OPTION value="KZ">Kazakhstan</OPTION>');
	document.write('<OPTION value="KE">Kenya</OPTION>');
	document.write('<OPTION value="KI">Kiribati</OPTION>');
	document.write('<OPTION value="KW">Kuwait</OPTION>');
	document.write('<OPTION value="KG">Kyrgyzstan</OPTION>');
	document.write('<OPTION value="LA">Laos</OPTION>');
	document.write('<OPTION value="LV">Latvia</OPTION>');
	document.write('<OPTION value="LB">Lebanon</OPTION>');
	document.write('<OPTION value="LS">Lesotho</OPTION>');
	document.write('<OPTION value="LR">Liberia</OPTION>');
	document.write('<OPTION value="LY">Libya</OPTION>');
	document.write('<OPTION value="LI">Liechtenstein</OPTION>');
	document.write('<OPTION value="LT">Lithuania</OPTION>');
	document.write('<OPTION value="LU">Luxembourg </OPTION>');
	document.write('<OPTION value="MO">Macau</OPTION>');
	document.write('<OPTION value="MG">Madagascar</OPTION>');
	document.write('<OPTION value="MW">Malawi</OPTION>');
	document.write('<OPTION value="MY">Malaysia</OPTION>');
	document.write('<OPTION value="MV">Maldives</OPTION>');
	document.write('<OPTION value="ML">Mali</OPTION>');
	document.write('<OPTION value="MT">Malta</OPTION>');
	document.write('<OPTION value="MH">Marshall Islands</OPTION>');
	document.write('<OPTION value="MQ">Martinique</OPTION>');
	document.write('<OPTION value="MR">Mauritania</OPTION>');
	document.write('<OPTION value="MU">Mauritius</OPTION>');
	document.write('<OPTION value="YT">Mayotte</OPTION>');
	document.write('<OPTION value="MX">Mexico</OPTION>');
	document.write('<OPTION value="FM">Micronesia</OPTION>');
	document.write('<OPTION value="MD">Moldova</OPTION>');
	document.write('<OPTION value="MC">Monaco</OPTION>');
	document.write('<OPTION value="MN">Mongolia</OPTION>');
	document.write('<OPTION value="MS">Montserrat</OPTION>');
	document.write('<OPTION value="MA">Morocco</OPTION>');
	document.write('<OPTION value="MZ">Mozambique</OPTION>');
	document.write('<OPTION value="MM">Myanmar</OPTION>');
	document.write('<OPTION value="NA">Namibia</OPTION>');
	document.write('<OPTION value="NR">Nauru</OPTION>');
	document.write('<OPTION value="NP">Nepal</OPTION>');
	document.write('<OPTION value="NL">Netherlands</OPTION>');
	document.write('<OPTION value="AN">Netherlands Antilles</OPTION>');
	document.write('<OPTION value="NC">New Caledonia</OPTION>');
	document.write('<OPTION value="NZ">New Zealand</OPTION>');
	document.write('<OPTION value="NI">Nicaragua</OPTION>');
	document.write('<OPTION value="NE">Niger</OPTION>');
	document.write('<OPTION value="NG">Nigeria</OPTION>');
	document.write('<OPTION value="NU">Niue</OPTION>');
	document.write('<OPTION value="NF">Norfolk Island</OPTION>');
	document.write('<OPTION value="KP">North Korea</OPTION>');
	document.write('<OPTION value="MP">Northern Marianas</OPTION>');
	document.write('<OPTION value="NO">Norway</OPTION>');
	document.write('<OPTION value="OM">Oman</OPTION>');
	document.write('<OPTION value="PK">Pakistan</OPTION>');
	document.write('<OPTION value="PW">Palau</OPTION>');
	document.write('<OPTION value="PA">Panama</OPTION>');
	document.write('<OPTION value="PG">Papua New Guinea</OPTION>');
	document.write('<OPTION value="PY">Paraguay</OPTION>');
	document.write('<OPTION value="PE">Peru</OPTION>');
	document.write('<OPTION value="PH">Philippines</OPTION>');
	document.write('<OPTION value="PN">Pitcairn Islands</OPTION>');
	document.write('<OPTION value="PL">Poland</OPTION>');
	document.write('<OPTION value="PT">Portugal</OPTION>');
	document.write('<OPTION value="PR">Puerto Rico</OPTION>');
	document.write('<OPTION value="QA">Qatar</OPTION>');
	document.write('<OPTION value="RE">R&#233union</OPTION>');
	document.write('<OPTION value="RO">Romania</OPTION>');
	document.write('<OPTION value="RU">Russia</OPTION>');
	document.write('<OPTION value="RW">Rwanda</OPTION>');
	document.write('<OPTION value="SH">Saint Helena</OPTION>');
	document.write('<OPTION value="KN">Saint Kitts and Nevis</OPTION>');
	document.write('<OPTION value="LC">Saint Lucia</OPTION>');
	document.write('<OPTION value="PM">Saint Pierre and Miquelon</OPTION>');
	document.write('<OPTION value="VC">Saint Vincent and the Grenadines</OPTION>');
	document.write('<OPTION value="WS">Samoa</OPTION>');
	document.write('<OPTION value="SM">San Marino</OPTION>');
	document.write('<OPTION value="ST">S&#227;o Tom&#233; and Príncipe</OPTION>');
	document.write('<OPTION value="SA">Saudi Arabia</OPTION>');
	document.write('<OPTION value="SN">Senegal</OPTION>');
	document.write('<OPTION value="SC">Seychelles</OPTION>');
	document.write('<OPTION value="SL">Sierra Leone</OPTION>');
	document.write('<OPTION value="SG">Singapore</OPTION>');
	document.write('<OPTION value="SK">Slovakia</OPTION>');
	document.write('<OPTION value="SI">Slovenia</OPTION>');
	document.write('<OPTION value="SB">Solomon Islands</OPTION>');
	document.write('<OPTION value="SO">Somalia</OPTION>');
	document.write('<OPTION value="ZA">South Africa</OPTION>');
	document.write('<OPTION value="GS">South Georgia and the South Sandwich Islands</OPTION>');
	document.write('<OPTION value="KR">South Korea</OPTION>');
	document.write('<OPTION value="ES">Spain</OPTION>');
	document.write('<OPTION value="LK">Sri Lanka</OPTION>');
	document.write('<OPTION value="SD">Sudan</OPTION>');
	document.write('<OPTION value="SR">Suriname</OPTION>');
	document.write('<OPTION value="SJ">Svalbard and Jan Mayen</OPTION>');
	document.write('<OPTION value="SZ">Swaziland</OPTION>');
	document.write('<OPTION value="SE">Sweden</OPTION>');
	document.write('<OPTION value="CH">Switzerland</OPTION>');
	document.write('<OPTION value="SY">Syria</OPTION>');
	document.write('<OPTION value="TW">Taiwan</OPTION>');
	document.write('<OPTION value="TJ">Tajikistan</OPTION>');
	document.write('<OPTION value="TZ">Tanzania</OPTION>');
	document.write('<OPTION value="TH">Thailand</OPTION>');
	document.write('<OPTION value="TG">Togo</OPTION>');
	document.write('<OPTION value="TK">Tokelau</OPTION>');
	document.write('<OPTION value="TO">Tonga</OPTION>');
	document.write('<OPTION value="TT">Trinidad and Tobago</OPTION>');
	document.write('<OPTION value="TN">Tunisia</OPTION>');
	document.write('<OPTION value="TR">Turkey</OPTION>');
	document.write('<OPTION value="TM">Turkmenistan</OPTION>');
	document.write('<OPTION value="TC">Turks and Caicos Islands</OPTION>');
	document.write('<OPTION value="TV">Tuvalu</OPTION>');
	document.write('<OPTION value="UG">Uganda</OPTION>');
	document.write('<OPTION value="UA">Ukraine</OPTION>');
	document.write('<OPTION value="AE">United Arab Emirates</OPTION>');
	document.write('<OPTION value="GB">United Kingdom</OPTION>');
	document.write('<OPTION value="UM">United States Minor Outlying Islands</OPTION>');
	document.write('<OPTION value="UY">Uruguay</OPTION>');
	document.write('<OPTION value="VI">US Virgin Islands</OPTION>');
	document.write('<OPTION value="UZ">Uzbekistan</OPTION>');
	document.write('<OPTION value="VU">Vanuatu</OPTION>');
	document.write('<OPTION value="VA">Vatican City</OPTION>');
	document.write('<OPTION value="VE">Venezuela</OPTION>');
	document.write('<OPTION value="VN">Vietnam</OPTION>');
	document.write('<OPTION value="WF">Wallis and Futuna</OPTION>');
	document.write('<OPTION value="EH">Western Sahara</OPTION>');
	document.write('<OPTION value="YE">Yemen</OPTION>');
	document.write('<OPTION value="YU">Yugoslavia</OPTION>');
	document.write('<OPTION value="ZM">Zambia</OPTION>');
	document.write('<OPTION value="ZW">Zimbabwe</OPTION>');

	document.write('</SELECT>');

	return(0);

}

//
// Function:    popstate()
//
// Description: Populate SELECT control with U.S. states and Canadian provinces
//
// Return code:
//  0 = Success
//
function popstate () {

	document.write('<SELECT name="state">');

	document.write('<OPTION value=""></OPTION>');

	document.write('<OPTION value="AB">AB</OPTION>');
	document.write('<OPTION value="AK">AK</OPTION>');
	document.write('<OPTION value="AL">AL</OPTION>');
	document.write('<OPTION value="AR">AR</OPTION>');
	document.write('<OPTION value="AS">AS</OPTION>');
	document.write('<OPTION value="AZ">AZ</OPTION>');
	document.write('<OPTION value="BC">BC</OPTION>');
	document.write('<OPTION value="CA">CA</OPTION>');
	document.write('<OPTION value="CO">CO</OPTION>');
	document.write('<OPTION value="CT">CT</OPTION>');
	document.write('<OPTION value="DC">DC</OPTION>');
	document.write('<OPTION value="DE">DE</OPTION>');
	document.write('<OPTION value="FL">FL</OPTION>');
	document.write('<OPTION value="FM">FM</OPTION>');
	document.write('<OPTION value="GA">GA</OPTION>');
	document.write('<OPTION value="GU">GU</OPTION>');
	document.write('<OPTION value="HI">HI</OPTION>');
	document.write('<OPTION value="IA">IA</OPTION>');
	document.write('<OPTION value="ID">ID</OPTION>');
	document.write('<OPTION value="IL">IL</OPTION>');
	document.write('<OPTION value="IN">IN</OPTION>');
	document.write('<OPTION value="KS">KS</OPTION>');
	document.write('<OPTION value="KY">KY</OPTION>');
	document.write('<OPTION value="LA">LA</OPTION>');
	document.write('<OPTION value="MA">MA</OPTION>');
	document.write('<OPTION value="MB">MB</OPTION>');
	document.write('<OPTION value="MD">MD</OPTION>');
	document.write('<OPTION value="ME">ME</OPTION>');
	document.write('<OPTION value="MH">MH</OPTION>');
	document.write('<OPTION value="MI">MI</OPTION>');
	document.write('<OPTION value="MN">MN</OPTION>');
	document.write('<OPTION value="MO">MO</OPTION>');
	document.write('<OPTION value="MP">MP</OPTION>');
	document.write('<OPTION value="MS">MS</OPTION>');
	document.write('<OPTION value="MT">MT</OPTION>');
	document.write('<OPTION value="NB">NB</OPTION>');
	document.write('<OPTION value="NC">NC</OPTION>');
	document.write('<OPTION value="ND">ND</OPTION>');
	document.write('<OPTION value="NE">NE</OPTION>');
	document.write('<OPTION value="NH">NH</OPTION>');
	document.write('<OPTION value="NJ">NJ</OPTION>');
	document.write('<OPTION value="NL">NL</OPTION>');
	document.write('<OPTION value="NM">NM</OPTION>');
	document.write('<OPTION value="NS">NS</OPTION>');
	document.write('<OPTION value="NT">NT</OPTION>');
	document.write('<OPTION value="NU">NU</OPTION>');
	document.write('<OPTION value="NV">NV</OPTION>');
	document.write('<OPTION value="NY">NY</OPTION>');
	document.write('<OPTION value="OH">OH</OPTION>');
	document.write('<OPTION value="OK">OK</OPTION>');
	document.write('<OPTION value="ON">ON</OPTION>');
	document.write('<OPTION value="OR">OR</OPTION>');
	document.write('<OPTION value="PA">PA</OPTION>');
	document.write('<OPTION value="PE">PE</OPTION>');
	document.write('<OPTION value="PR">PR</OPTION>');
	document.write('<OPTION value="PW">PW</OPTION>');
	document.write('<OPTION value="QC">QC</OPTION>');
	document.write('<OPTION value="RI">RI</OPTION>');
	document.write('<OPTION value="SC">SC</OPTION>');
	document.write('<OPTION value="SD">SD</OPTION>');
	document.write('<OPTION value="SK">SK</OPTION>');
	document.write('<OPTION value="TN">TN</OPTION>');
	document.write('<OPTION value="TX">TX</OPTION>');
	document.write('<OPTION value="UT">UT</OPTION>');
	document.write('<OPTION value="VA">VA</OPTION>');
	document.write('<OPTION value="VI">VI</OPTION>');
	document.write('<OPTION value="VT">VT</OPTION>');
	document.write('<OPTION value="WA">WA</OPTION>');
	document.write('<OPTION value="WI">WI</OPTION>');
	document.write('<OPTION value="WV">WV</OPTION>');
	document.write('<OPTION value="WY">WY</OPTION>');
	document.write('<OPTION value="YT">YT</OPTION>');

	document.write('</SELECT>');

	return(0);

}

//
// Function:    prodmenu
//
// Description: Handle Prouct Menu events
//
// Input:
//
// site    = Site code (AVD)
//
// item    = Pointer to tabel cell of menu item (this)
//
// index   = Menu index (1, 2, 3, etc.)
//
// active  = 0 for normal colors (default)
//         = 1 for highlight colors
//
// submenu = Submenu to toggle
//            0 = None
//            1 = "prodsub1"
//            2 = "prodsub2"
//            (etc.)
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function prodmenu (site, item, index, active, submenu) {

	var bgcolor; // Background color
	var fgcolor; // Menu item font color
	var subid;   // Sub-menu ID

	if ( active == 1 ) {
		// Active: White text on blue background
		fgcolor = "#ffffff";
		bgcolor = "#00013a";
	} else {
		// Inactive: Blue text on white background
		fgcolor = "#00013a";
		bgcolor = "#ffffff";
	}

	// Change background color
	item.style.backgroundColor = bgcolor;

	// Change menu font color
	if ( index == 1 ) { menu1.style.color = fgcolor; }
	if ( index == 2 ) { menu2.style.color = fgcolor; }
	if ( index == 3 ) { menu3.style.color = fgcolor; }
	if ( index == 4 ) { menu4.style.color = fgcolor; }

	//
	// Toggle sub-menu
	//
	if ( submenu != 0 ) {

		if ( submenu == 1 ) {
			subid = "prodsub1";
		} else if ( submenu == 2 ) {
			subid = "prodsub2";
		} else if ( submenu == 3 ) {
			subid = "prodsub3";
		} else if ( submenu == 4 ) {
			subid = "prodsub4";
		} else if ( submenu == 5 ) {
			subid = "prodsub5";
		} else {
			return(-1);
		}

		if ( active == 1 ) {
			document.getElementById(subid).style.visibility = 'visible';
		} else {
			document.getElementById(subid).style.visibility = 'hidden';
		}

	}

	return(0);

}

//
// Function:    shopcart()
//
// Description: Add or remove filename in shopping cart
//
// Input:
//
// site    = Site code (AVD)
//
// prodkey = MP3 path/filename
//         = null to reset cart
//
// title   = MP3 filename only
//         = "R" to remove product key
//
// -Insert "|PRODUCT=oldkey1,oldkey2,newkey|" into cookie
//
// Return code:
//  0 = Success
//
function shopcart (site, prodkey, title) {

	var a = 0; // Counters
	var b = 0;

	var remain = 25; // Maximum number of files that may be added to zip archive

	var msg;   // User message string

	//
	// Current date
	//
	// Format: "Sat Sep 13 03:24:13 CDT 2008"
	//
	var cdate = new Date();

	if ( prodkey ) {
		// Current date plus one week (normal)
		cdate.setTime(cdate.getTime()+(1000*60*60*24*7));
	} else {
		// Current date minus one week (to expire cookie)
		cdate.setTime(cdate.getTime()-(1000*60*60*24*7));
	}

	//
	// Get all existing cookie fields
	//
	// -Copy to "cookie_fields[N]" array
	//
	var cookie_fields = document.cookie.split(';');

	//
	// Find "PRODUCT" cookie field
	//
	// c = "|PRODUCT=prodkey1,prodkey2,etc.|"
	//
	var c;
	var d;

	for ( a=0; a < cookie_fields.length; a++ ) {

		c = cookie_fields[a];

		if ( c.substring(2,9) == "PRODUCT" ) { d = c; }

	}

	if ( d ) { c = d; }

	//
	// Remove "|PRODUCT=" label and "|" terminator
	//
	// oldkeys = "oldkey1,oldkey2,etc."
	//
	var oldkeys = c.substring(c.indexOf('=') + 1, c.length - 1);

	//
	// Examine each existing product key
	//
	// -Copy to "keys[N]" array
	//
	var keys = oldkeys.split(',');
	oldkeys = "";

	var add = 0; // Add key to cookie? (1=Yes 0=No)

	for ( a=0; a < keys.length; a++ ) {

		add = 1; // Add key (default)

		if ( title == "R" && keys[a] == prodkey ) {
			//
			// Do not include in cookie if removing key
			//
			add = 0;
		} else {
			//
			// Include in cookie if not a duplicate
			//
			for ( b=0; b <= a; b++ ) {
				if ( a != b && keys[a] == keys[b] ) { add = 0; b = a; }
			}
		}

		if ( add == 1 ) {
			//
			// Re-add old key
			//
			if ( oldkeys.length < 1 ) {
				// Start record
				oldkeys = keys[a];
			} else {
				// Append to existing record
				oldkeys = oldkeys + ',' + keys[a];
			}
		}

	}

	//
	// Update product keys
	//
	if ( title == "R" ) {
		// Remove specified product key
		prodkey = "";
	}

	if ( oldkeys ) {
		if ( prodkey ) {
			// Append new product key to old product keys
			prodkey = oldkeys + ',' + prodkey;
		} else {
			// There are no new product keys
			prodkey = oldkeys;
		}
	}

	// Update cookie
	var newcookie = '|PRODUCT=' + prodkey + '|; expires=' + cdate.toGMTString() + '; path=/';

	//
	// Alert user
	//
	if ( site == "AVD" && title && title != "R" ) {

		// AVD user is adding MP3 file to Zip file

		remain = remain - a;

		if ( remain < 0 ) {

			// No more space in zip archive
			msg = "Please click on \"Download Zip file\" in the\nupper right corner of any page.\n\nAfter saving this zip file you may start another.";

		} else if ( remain == 0 ) {

			// This was the last file that may be added
			msg = title + "\nhas been added to your Zip file.\n\nPlease click on \"Download Zip file\" in the\nupper right corner of any page.\n\nAfter saving this zip file you may start another.";

		} else {

			// More files may be added after this
			msg = title + "\nhas been added to your Zip file.\n\nYou may add " + remain + " more tracks\nto this zip file.\n\nWhen you are finished selecting files,\nclick on \"Download Zip file\" in the\nupper right corner of any page.";

		}

		alert(msg);

	}

	// Set cookie
	document.cookie = newcookie;

	// Return
	return(0);

}

//
// Function:    skiprow
//
// Description: Skip row(s) of content area
//
// Input:
// max   = Number of rows to skip
// ifwin = 'W' to skip rows only if Windows system
//
// Return code:
//  0 = Success
//
function skiprow (max, ifwin) {

	var counter;

	if ( ifwin == 'W' && strOS != "W" ) { return(0); }

	for ( counter = 1; counter <= max; counter ++ ) {

		document.write('<TABLE height=2 border=0 cellpadding=0 cellspacing=0><TR><TD></TD></TR></TABLE>');

	}

	return(0);

}

//
// Function:    startpage
//
// Description: Start (or end) page
//
// Input:
//
//  site        = "AVD" for AVDeli.com
//
//  mode        = 0 to start page
//              = 1 to end page
//
//  cheight     = Height (pixels) of main content
//              = 0 if height should be same as width
//
//  dispflsh    = 1 to display (home page) Flash animation
//              = 0 to not display (default)
//
//  minimenu    = 1 to display abbreviated main menu at top of page
//              = 0 to not display (default)
//
//  wide        = 1 for wide display (AVD only)
//              = 0 for normal width (default)
//
// baseurl      = Base URL
// baseurls     = Base URL (secure)
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function startpage (site, mode, cheight, dispflsh, minimenu, wide) {

	var cwidth2; // Width (pixels) of column 2
	var cwidth3; // Width (pixels) of column 3
	var cwidth4; // Width (pixels) of column 4
	var cwidth5; // Width (pixels) of column 5
	var cwidth6; // Width (pixels) of column 6

	var swidth;  // Standard width (pixels)

	if ( site == 'AVD' ) {

		swidth = 568;

		cwidth2 = 11;
		cwidth3 = 140;
		cwidth4 = 1;
		cwidth5 = 40;
		cwidth6 = 374;

		if ( wide == 1 ) {
			// Wide display
			swidth = 800;
		}

	} else {

		return(-1);

	}

	// Column 1 and 7 width = 1

	if ( cheight == 0 ) { cheight = swidth; }

	if ( mode == 0 ) {

		//
		// Start page
		//

		// Start inner table
		document.write('<TABLE width=' + swidth + ' border=0 cellpadding=0 cellspacing=0>');

		//
		// Set column widths (7 columns, total width = standard width)
		//
		document.write('<TR>');

		document.write('<TD width=1 height=1></TD>');
		document.write('<TD width=' + cwidth2 + ' height=1></TD>');
		document.write('<TD width=' + cwidth3 + ' height=1></TD>');
		document.write('<TD width=' + cwidth4 + ' height=1></TD>');
		document.write('<TD width=' + cwidth5 + ' height=1></TD>');
		document.write('<TD width=' + cwidth6 + ' height=1></TD>');
		document.write('<TD width=1 height=1></TD>');

		document.write('</TR>');

		//
		// Tab (home link)
		//
		// -Indent to start of third column
		//
		document.write('<TR>');
		document.write('<TD colspan=2></TD>');
		document.write('<TD colspan=3><A href="' + baseurl + 'index.html">');

		if ( site == 'AVD' ) {
			playflash('AVDeli_logo',181,40);
		}

		document.write('</A></TD>');

		if ( minimenu == 1 ) {

			//
			// Abbreviated main menu
			//
			document.write('<TD colspan=1 align="right" valign="bottom">');

			document.write('<TABLE border=0 cellpadding=4 cellspacing=0><TR>');

			if ( site == 'AVD' ) {

				document.write('<TD>&nbsp;<A href="' + baseurl + 'index.html" class="main_menu">Home</A>&nbsp;&nbsp;</TD>');

				document.write('<TD>&nbsp;<A href="' + baseurl + 'cgi-bin/member.pl" class="main_menu">Members</A>&nbsp;&nbsp;</TD>');

				document.write('<TD>&nbsp;<A href="' + baseurl + 'contact.htm" class="main_menu">Contact Us</A>&nbsp;&nbsp;</TD>');

			}

			document.write('</TR></TABLE>');

			document.write('</TD>');

		} else {

			// Blank
			document.write('<TD colspan=1></TD>');

		}

		// End of top row
		document.write('<TD colspan=1></TD>');
		document.write('</TR>');

		// Horizontal line
		document.write('<TR><TD colspan=7 height=1 bgcolor="#ffffff"></TD></TR>');

		if ( dispflsh == 1 ) {

			// Flash animation between vertical lines
			document.write('<TR>');
			document.write('<TD colspan=1 height=230 bgcolor="#ffffff"></TD>');
			document.write('<TD colspan=5 height=230 bgcolor="#000000"><SCRIPT type="text/javascript">playflash(\'home\',566,230);</SCRIPT></TD>');
			document.write('<TD colspan=1 height=230 bgcolor="#ffffff"></TD>');
			document.write('</TR>');

			// Horizontal line
			document.write('<TR><TD colspan=7 height=1 bgcolor="#ffffff"></TD></TR>');

		}

		// Start content row
		document.write('<TR>');

		// Vertical line
		document.write('<TD colspan=1 height=' + cheight + ' bgcolor="#ffffff"></TD>');

	} else if ( mode == 1 ) {

		//
		// End page
		//

		// Vertical line
		document.write('<TD colspan=1 height=' + cheight + ' bgcolor="#ffffff"></TD>');

		// End content row
		document.write('</TR>');

		// Horizontal line
		document.write('<TR><TD colspan=7 height=1 bgcolor="#ffffff"></TD></TR>');

		//
		// Main menu
		//
		document.write('<TR><TD colspan=7><TABLE border=0 cellpadding=0 cellspacing=0><TR>');

		if ( site == 'AVD' ) {

			document.write('<TD>&nbsp;<A href="' + baseurl + 'index.html" class="main_menu">Home</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'cgi-bin/member.pl" class="main_menu">Members</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'about.htm" class="main_menu">About Us</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'works.htm" class="main_menu">How It Works</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'best.htm" class="main_menu">Best in the Biz</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'superstar.htm" class="main_menu">VO Superstars</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'contact.htm" class="main_menu">Contact Us</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'image/statement_of_use.pdf" class="main_menu" target="new">Statement of Use</A>&nbsp;&nbsp;</TD>');

			document.write('<TD>&nbsp;<A href="' + baseurl + 'blog.htm" class="main_menu">Blog</A>&nbsp;&nbsp;</TD>');

		}

		document.write('</TR></TABLE></TD></TR>');

		// End inner table
		document.write('</TABLE>');

	} else {

		// Invalid argument
		return(-1);

	}

	return(0);

}

//
// Function:    swapimg
//
// Description: Replace image
//
// Input:
// imgno   = 1 for top "Close Window" button
//         = 2 for bottom "Close Window" button
//
// imgbase = Image file basename (JPEG in \image directory)
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function swapimg (imgno, imgbase) {

	if ( imgno == 1 ) {

		// "Close Window" (top)
		document.getElementById('closewin_top').src = 'image/' + imgbase + '.jpg';

	} else if ( imgno == 2 ) {

		// "Close Window" (bottom)
		document.getElementById('closewin_bot').src = 'image/' + imgbase + '.jpg';

	} else {

		// Invalid argument
		return(-1);

	}

	return(0);

}

//
// Function:    vorow
//
// Description: Display table row containing voiceover links
//
// Input:
// name = Talent name
// web  = Talent's web site UR or email addressL
// dir  = "B" if "Best in the Biz" or "S" if "VO Superstar"
//
// Return code:
//  0 = Success
// -1 = Invalid argument
//
function vorow (name, web, dir) {

	var bname; // Demo file basename

	// \audio sub-directory
	if ( dir == "B" ) {
		dir = "bestbiz";
	} else if ( dir == "S" ) {
		dir = "superstar"
	} else {
		return(-1);
	}

	bname = name.replace(/ /g, "_");
	bname = bname.replace(/\./g, "");

	document.write('<TR><TD align="center">');
	document.write(name + '<BR />');

	document.write('<A href="audio/' + dir + '/' + bname + '.mp3" class="demo_link">DEMO</A>');

	if (web) {

		if ( web.indexOf('@') > 0 ) {
			// Email address
			document.write('&nbsp;&#149;&nbsp;<A href="mailto:' + web + '" class="demo_link">EMAIL</A>');
		} else {
			// Web site
			document.write('&nbsp;&#149;&nbsp;<A href="http://' + web + '" target="new" class="demo_link">WEB SITE</A>');
		}

	}

	document.write('</TD></TR>');

	return(0);

}