//
// Copyright © 2011 by NW Synergistic Software, Inc. dba Livingsoft Northwest Inc.
//

var s = "s";

if (document.all)
{
	if (document.body.clientHeight > 750)
		s = "";
}

var Calendar = new Date();
var names =  Array("","BLOUSEPANTS1","BLOUSEPANTS2","BLOUSESHORTS","BLOUSESKIRT1","BLOUSESKIRT2","COAT1","COAT2","GOWN1","HALTERSKORT","JACKET1",
		"JACKETPANTS","JACKETSKIRT1","JACKETSKIRT2","JUMPER","SUIT1","SUIT2","SUMMER1","SUMMER2","SWEATERSKIRT1","SWEATERSKIRT2",
		"SWEATSUIT","SWIMSUIT","VESTPANTS");
var names_count = names.length - 1;
var namesPants =  Array("","BLOUSEPANTS1","BLOUSEPANTS2","BLOUSESHORTS","HALTERSKORT", "JACKETPANTS","SWEATSUIT","VESTPANTS");
var namesPants_count = namesPants.length - 1;
var aw=screen.availWidth-100;
var ah=screen.availHeight-100;
var wideScreen = false;
var d1 = "<a href='mailto:";
var d2 = "";
var d3 = "@LivingsoftNW.com";
var d4 = "";
if (document.body.clientWidth > 900)
{
	wideScreen = true;
}
var winProps1 = 'toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=550,top=50,left=50';
var winProps2 = 'toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+aw+',height='+ah+',top=50,left=50';
function newWin(URL)
{
	if (URL==1)
		window.open("http://www.livingsoft.com", "temp1", winProps1); 
	else 
	{    
		if (URL == 2)
			window.open("http://lyris.livingsoft.com/scripts/lyris.pl?enter=dressshopdiscussion&text_mode=0", "temp2", winProps2);
		else
			window.open(URL, "temp3", winProps2); 
	}      
}

function showPic(i)
{
	showPicPath(i,"");
}
function showPicPath(i,path)
{
	var index = i;
	if (i == -4) // pants type art only
	{
		index  = (Calendar.getSeconds() % namesPants_count) + 1;
	}
	else if (i < 0)
	{
		index  = (Calendar.getSeconds() % names_count) + 1;
	}
		
	document.write('<DIV LEFT=5; TOP="0"><TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">');
	document.write('<TR HEIGHT="75"><TD COLSPAN="2" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0">');
	document.write('<TR><TD ALIGN="LEFT" VALIGN="TOP"><A HREF="'+path+'index.htm"><IMG BORDER="0" ALT="LivingSoft Homepage" SRC="'+path+'images/livingsoftBig.gif" ALT="Livingsoft Home Page"></A>');
	document.write('<FONT SIZE="2" FACE="Franklin Gothic Heavy"><BR>');
	document.write('<b> &nbsp;&nbsp;Made-To-Measure patterns for all your sewing needs.</b></FONT></TD>');

	document.write('<TD ALIGN="RIGHT" VALIGN="TOP"><NOBR>');
	document.write('<A HREF="'+path+'ShoppingCart.aspx">');
	document.write('<IMG ALT="Shopping Cart" BORDER="0" SRC="'+path+'images/Cart.jpg"></A> ');
	document.write('&nbsp;&nbsp;<A HREF="'+path+'Secure/YourAccount.aspx">');
	document.write('<IMG ALT="Check your account" BORDER="0" SRC="'+path+'images/Login.gif"></A>');
	document.write(' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR>');
	document.write('</TABLE></TD></TR><tr>');


	if (i == -4 && wideScreen) // if pants related pages
	{
		document.write('<td width="20%" align="center" valign="top">');
		document.write('<img border="0" src="'+path+'images/Fashion/'+namesPants[index]+s+'.GIF"></td>');
		document.write('<td width="80%">');
	}
	else
	if ((i != 0) && (i == -2 || wideScreen)) // other then homepage ditch the left artwork
	{
		document.write('<td width="20%" align="center" valign="top">');
		document.write('<img border="0" src="'+path+'images/Fashion/'+names[index]+s+'.GIF"></td>');
		document.write('<td width="80%">');
	}
	else
	{
		document.write('<td width="1"></td>');
		document.write('<td width="100%">');
	}

	document.write('<center><p align="center">');
	document.write('<table width="760" border="1" cellspacing="0" cellpadding="0" align="center" bgcolor="#BFC4FF" bordercolor="#BFC4FF">');
	document.write('<tr><td width="100%" valign="top" bgcolor="#BFC4FF">');
	document.write('<table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="#BFC4FF"><tr>');
	document.write('<td align="center" height="16" width="20%"><a href="'+path+'New.htm"><b>What Is New?</b></a></td>');
	document.write('<td align="center" height="16" width="20%"><a href="'+path+'Store.htm"><b>Store</b></a></td>');
	document.write('<td align="center" height="16" width="20%"><a href="'+path+'DownloadsNew.htm"><b>Downloads</b></a></td>');
	document.write('<td align="center" height="16" width="20%"><a href="'+path+'Support.htm"><b>Support</b></a></td>');
	document.write('<td align="center" height="16" width="20%"><a href="'+path+'Community.htm"><b>Community</b></a></td>');
	document.write('</tr></table></td></tr></table>');
}

