/*

        Filename:          script.js
        Description:       Javascript functions
        Client:            JV & Company
        Author:            Steven Dahlman, DCM Software
        Start date:        10-28-05
        Last modification: 12-08-08

*/

var bgcolor="#2f4f4f";                         // Background color (hex)
var sBaseURL = "http://www.jvandcompany.com/"; // Baseline URL

//
// Function:    banner()
//
// Description: Display banner (upper-left square, cityscape and logo) 650 pixel version
//
// Input:
//  bgcolor = Background color
//
// Return code:
//  0 = Successful
//
function banner () {

	document.write('<TR bgcolor="' + bgcolor + '">');

	document.write('<TD align="center" <IMG src="image/store-ext-nak-180px.jpg" height=150></IMG></TD>');

	document.write('<TD><IMG src="image/jvcban1.jpg" width=650 height=150></IMG></TD>');

	document.write('</TR>');

	document.write('<TR bgcolor="' + bgcolor + '"><TD width=200 height=8></TD><TD width=200 height=8></TD></TR>');

	return(0);

}
//
// Function:    banne2r()
//
// Description: Display banner (upper-left square, cityscape and logo) 900 pixel version
//
// Input:
//  bgcolor = Background color
//
// Return code:
//  0 = Successful
//
function banner2 () {

	document.write('<TR bgcolor="' + bgcolor + '">');

	document.write('<TD align="center" <IMG src="image/store-ext-nak-180px.jpg" height=150></IMG></TD>');

	document.write('<TD><IMG src="image/jvcban900.jpg" width=900 height=150></IMG></TD>');

	document.write('</TR>');

	document.write('<TR bgcolor="' + bgcolor + '"><TD width=200 height=8></TD><TD width=200 height=8></TD></TR>');

	return(0);

}

//
// Function:    caption()
//
// Description: Display caption
//
// Input:
//  itm = 1 for "Click to view larger image"
//
// Return code:
//  0 = Successful
// -1 = Invalid argument
//
function caption (itm) {

	if ( itm == 1 ) {

		document.write('<TABLE cellpadding=0 cellspacing=2 class="fine2"><TR><TD width=380 align="center">Click to view larger image</TD></TR></TABLE>');

	} else {

		return(-1);

	}

	return(0);

}

//
// Function:    mainmenu()
//
// Description: Display main menu
//
// Return code:
//  0 = Successful
//
function mainmenu () {

        document.write('<TABLE cellpadding=2 cellspacing=2>');

        document.write('<TR><TD><A class="main" href="index.html">HOME</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="collect.htm">COLLECTIONS</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="travfav.htm">TRAVEL FAVORITES</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="travtip.htm">TRAVEL TIPS</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="event.htm">EVENTS</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="news.htm">NEWS</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="job.htm">CAREER OPPORTUNITY</A></TD></TR>');

        document.write('<TR><TD><A class="main" href="contact.htm">CONTACT</A></TD></TR>');

        document.write('</TABLE>');

	return(0);

}

//
// Function:    showimg()
//
// Description: Display image in new window
//
// Input:
//  file     = path/filename of image
//  width    = Image width (pixels)
//  height   = Image height (pixels)
//
//  sBaseURL = Baseline URL
//
// Return code:
//  0 = Successful
//
function showimg (file, width, height) {

	var wwidth = width + 40;   // Window width (pixels)
	var wheight = height + 80; // Window height (pixels)

	var maxwidth = screen.availWidth - 10;   // Maximum width (pixels)
	var maxheight = screen.availHeight - 10; // Maximum height (pixels)

	// Shrink to fit available space
	if ( wwidth > maxwidth )   { wwidth = maxwidth; }
	if ( wheight > maxheight ) { wheight = maxheight; }

	// Center window on screen
	var wleft = (screen.availWidth - wwidth) / 2;
	var wtop = (screen.availHeight - wheight) / 2;

	// Window features
	var wfeatures = 'width=' + wwidth + ',height=' + wheight + ',left=' + wleft + ',top=' + wtop;
	wfeatures += ',resizable=yes,scrollbars=yes,titlebar=no,menubar=no,directories=no,personalbar=no,status=no';

	// Open window
	var imgWin = window.open('','',wfeatures);

	//
	// Display image
	//
	var wcontent = '<HTML>';

	wcontent += '<HEAD>';
	wcontent += '<TITLE>JV &amp; Company - Women&#146;s clothing for travel &amp; life</TITLE>';
	wcontent += '<BASE href="' + sBaseURL + '"></BASE>';
	wcontent += '</HEAD>';

	wcontent += '<BODY leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>';
	wcontent += '<TABLE width="100%" height="100%" cellpadding=0 cellspacing=0><TR><TD align="center">';

	wcontent += '<IMG src="' + sBaseURL + file + '" width=' + width + ' height=' + height + '></IMG>';

	wcontent += '<P><A href="" onClick="window.close();"><INPUT type="button" value="Close"></INPUT></A>';
	wcontent += '<A href="" onClick="window.print(); window.close();"><INPUT type="button" value="Print"></INPUT></A></P>';

	wcontent += '</TD></TR></TABLE></BODY></HTML>';

	imgWin.document.write(wcontent);
	imgWin.document.close();

	return(0);

}