//	<SCRIPT SRC="java.js" LANGUAGE = "JavaScript" TYPE = "TEXT/JAVASCRIPT"></SCRIPT>
//
//	Various Scripts for SoleAttire.ORG
//========||============================================||======\\
function findCookie()  						 //  find out if  there is a cookie on the computer
		{
		var yourNameRaw = "";				// Default Setting 
		var yourNameRaw = document.cookie;
		var yourNameParsed1 = yourNameRaw.split(";");
		var yourNameParsed2 = yourNameParsed1[0].split("=");
		var yourNameA = yourNameParsed2[0].split("/");
		var yourName = unescape(yourNameA[0]);		// Remove Spaces
		var yourNameRaw = "";				// Default Setting 

	//	var yourNameRaw = document.cookie;
	//	var yourNameParsed1 = yourNameRaw.split(";");
	//	var yourNameParsed2 = yourNameParsed1[0].split("=");
	//	var yourNameB = yourNameParsed2[1].split("/");
	//	var yourNameB = yourNameB[0].split("/");		// Remove Spaces
	//	var yourNameB = yourName[0];
	// alert(yourNameB);
	//	if (yourName == "")
	//		{ 
	//		setCookie();      			// create cookie
	//		readCookie();   			// read cookie back to first time visitor
	//		return false;
	//		}			// & Signed In.
	//	
		if (yourName == "null")
			{ 
			setCookie();      			// create cookie
			readCookie();   			// read cookie back to first time visitor
			return false;
			}
	//	
	//	if (yourName == "undefined")
	//		{ 
	//		setCookie();      			// create cookie
	//		readCookie();   			// read cookie back to first time visitor
	//		return false;
	//		}
	//	
	//	if (yourName == "%20signed%20in.")
	//		{ 
	//		setCookie();      			// create cookie
	//		readCookie();   			// read cookie back to first time visitor
	//		return false;
	//		}


		if(document.cookie !="")			//if no cookie %20signed%20in.
			{
			readCookie2();   			// read cookie back to first time visitor
			return false;
			}

		else
			{ 
			setCookie();      			// create cookie
			readCookie();   			// read cookie back to first time visitor
			return false;
			}
		}
//========||============================================||======\\
function setCookie()  						// The cookie cookbook
		{
		var visitTime = 1;	
		var cart = "empty";		
		theDate = new Date
		theDate.setMonth(theDate.getMonth() + 1);
		var yourCookieName = prompt(" Welcome to Sole Attire.  May I ask, What is your name?","");
		var yourName ="userName=" + escape(yourCookieName) + "/" +  (visitTime) + "/addToCart/" + cart + ";expires=" + theDate.toGMTString()
		document.cookie = yourName;

		//if (yourCookieName != "")
			{return  false}

		//if (yourCookieName == "")
			{alert("It's ok to not be signed in.\n\n But you will need to if \nyou want to send us\nan order to us." );
			yourCookieName = "null";
			}	

		if (yourCookieName == undefined)
			{alert("It's ok to not be signed in.\n\n But you will need to if \nyou want to send us\nan order to us." );
			yourCookieName = "null";
			}	
		Alert("Hello There is some Error.");
		}
//========||============================================||======\\
function readCookie()    		//read the cookie information back to user viewed on most pages
		{
		var yourName2 = "";
		var yourName2 = document.cookie;
		var yourParsedName = yourName2.split(";");
		var yourName22 = yourParsedName[0].split("=");
		var yourName2 = yourName22[1].split("/");
		var yourName2 = unescape(yourName2[0]);
		if (yourName2 == ""){yourName2 = " signed in."};
		if (yourName2 == "null"){yourName2 = " signed in."};
		if (yourName2 == undefined){yourName2 = " signed in."};

		document.write("<center><font Face=Georgia size=4><b> Hello !!  ");
		if (yourName2 !=" signed in."){document.write(" <font color=blue> " + yourName2 + "</font>")};
		document.write("<br> <font Face=Georgia size=3> Welcome to the Sole Attire Designer Shoes site.<br> We hope to find you the newest selections and saving too..</B>   ");  
		document.write("<br><FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()>I am not " + yourName2 + "</a></FONT><br>" );
		}
//========||============================================||======\\
function readCookie2()
		{
		theDate = new Date
		theDate.setMonth(theDate.getMonth() + 1);
		var yourName2 = "";
		var yourName2 = document.cookie;
		var yourParsedName = yourName2.split(";");
		var yourName22 = yourParsedName[0].split("=");
		var yourName2 = yourName22[1].split("/");
		var yourName = unescape(yourName2[0]);
		var visitTime =Math.round(yourName2[1]);
		addToCart =(yourName2[3]);
		if (yourName == ""){yourName = " signed in."};
		if (yourName == "null"){yourName = " signed in."};
		if (yourName == undefined){yourName = " signed in."};

		document.write("<center><font Face=Georgia size=4><b> Hello !!     ");
		if (yourName !=" signed in."){document.write( yourName)};

		document.write("<BR> <FONT Size=2><FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()><b>I am not " + yourName + "</b></a></FONT><br> Welcome back  to Sole Attire.  You were here " + visitTime  + " times before. ");
		document.write("<center><FONT Face=Georgia Size=4><b>");
		if(visitTime==1){document.write("We have great specials on soon to close out, Be sure to see the <a href=\"Specials.cgi\">Specials</a>");}
		if(visitTime==2){document.write("You Can read and post <a href=\"comments.cgi\">comments</a> about the web site");}
		if(visitTime==9){document.write("Good to see you came back. Care to read<a href=\"html/about.htm\">");}
		if(visitTime==3){document.write("You Can see the whole <a href=\"Cat.cgi\">Catalogue</a> right Now !");}
		if(visitTime==4){document.write("You will find the Newest Shoe and if you<a href=\"html/personalassistant.htm\"> register</a>.");}
		if(visitTime==5){document.write("You Can see the Newest <a href=\"New.cgi\">Catalogue</a> right Now !");}
		if(visitTime==6){document.write("You will find the Newest Shoe and if you<a href=\"html/personalassistant.htm\"> register</a>.");}
		if(visitTime==7){document.write("Good to see you came back. Care to read<a href=\"html/about.htm\"> ABOUT </a> us??");}
		if(visitTime==8){document.write("Are you ready to buy something soon????");}
		if(visitTime == 9)		
			{
			visitTime = 0;
			}
		visitTime = visitTime + 1
		document.cookie = "userName=" + escape(yourName) + "/" +  (visitTime) + "/addToCart/" + addToCart + ";expires=" + theDate; 
		}	
//========||============================================||======\\
function killCookie()

		{
	      	theCookie = document.cookie.split("; ");
	      	endDate = new Date;
	      	endDate.setDate(endDate.getDate()-2);
      		if(document.cookie != "")
      			{
     	    		for(i = 0; i < theCookie.length; i++)
         				{
            				cName = theCookie[i].split("=")[0];
            				cVal = theCookie[i].split("=")[1];
            				document.cookie = cName + "=" + cVal + ";expires=" + endDate.toGMTString(); 
            				//document.write("<BR>COOKIE: " + cName + "=" + cVal + ";expires=" + endDate.toGMTString() + " :<BR>");
         				}
      			}
   		return false;
		}

//========||============================================||======\\
// Name on each Page
// add function shoeTypeSearch , function shoeDesignerSearch
function printName ()
	

	{
	if(document.cookie != "")
		{
		var yourName2 = "";
		var yourName2 = document.cookie;
		var yourParsedName = yourName2.split(";");
		var yourName22 = yourParsedName[0].split("=");
		var yourName2 = yourName22[1].split("/");
		var yourName2 = unescape(yourName2[0]);
		if (yourName2 == ""){yourName2 = " signed in."};
		if (yourName2 == "null"){yourName2 = " signed in."};
		if (yourName2 == undefined){yourName2 = " signed in."};document.write("<font Face=Georgia size=2> Hello<b><font color=\"#0000cc\" face=tahoma size=3> ");
		if (yourName2 !=" signed in."){document.write( yourName2);};	
		 
	              var itemS = yourName22[4];
		var letter = "s"
		if(itemS == ""){ itemS = "No";}
		if(itemS == undefined){ itemS = "No";}
		if(itemS == 1){letter = "";}

		document.write("</font></b> !!<br> Welcome to the Sole Attire Web Site<br>");  
		document.write("<FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()><b>I am not " + yourName2 + "</a></b></FONT><br>" );
		//document.write("<center><Font size=1 color=blue><b> You have<i> " + itemS + " item" + letter +" </i> in your cart.</b></font><br> ");
		}
	}
//========||============================================||======\\
// Read Cookie Just for AddToCart Pages
// I am Not User Option.  Open Sign in optin opens in a new page 
function printJustName ()
		{
			var yourName = "";
			var yourName = document.cookie;
			var yourParsedName = yourName.split(";");
			var yourName22 = yourParsedName[0].split("=");
			var yourName22 = yourName22[1].split("/");
			var yourName2 = unescape(yourName22[0]);
			if (yourName2 == ""){yourName2 = " signed in."};
			if (yourName2 == "null"){yourName2 = " signed in."};
			if (yourName2 == undefined){yourName2 = " signed in."};
					document.write("<font Face=Georgia size=2> Hello<b><font color=\"#0000cc\" face=tahoma size=3> ");
			if (yourName2 !=" signed in."){document.write( yourName2);};			 
			document.write("</font></b> !!<br> Welcome to the Sole Attire Web Site<br>");
	              var itemS = yourName22[4];
		var letter = "s"
		if(itemS == ""){ itemS = "No";}
		if(itemS == undefined){ itemS = "No";}
		if(itemS == 1){letter = "";}
		document.write("<center><Font size=2 color=blue><b> You have<i> " + itemS + " item" + letter +" </i> in your cart.</b></font> ");
		 document.write("<br><FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()>I am not " + yourName2 + "</a></FONT><br>" );
			}
//========||============================================||======\\
// Used After front door -- after log in click -- Test For Cookie and JavaScripts turned on
// This conditional statment can be adjusted to see if the CART exsists or other things if needed.
function reDirect ()
		{
		if(document.cookie =="")
			{window.location="index2.htm"}  //if no cookie
		else
			{window.location="index2.htm"}  // if cookie goto Home Page html/home.htm
		}
//========||============================================||======\\
// Used AT front door Test For Cookie and JavaScripts turned on
// GoRight to Index2.htm if ther is a cookie
function reTurn ()
		{		
		var yourNameRaw = "";				// Default Setting 
		var yourNameRaw = document.cookie;
		var yourNameParsed1 = yourNameRaw.split(";");
		var yourNameParsed2 = yourNameParsed1[0].split("=");
		var yourNameA = yourNameParsed2[0].split("/");
		var yourName = yourNameParsed2[1].split("/");		// Remove Spaces
		var yourName = yourName[0];

//alert ("Cookie = "  + document.cookie);
//alert ("yourNameA = "  + yourNameA);
//alert ("yourName = "  + yourName);
		if(document.cookie !="")			//if no cookie %20signed%20in.
			{
			if (yourName != "")			// & Signed In.
				{
				if (yourName != "null")
					{
					if (yourName != "undefined")
						{
						if (yourName != "%20signed%20in.")
							{window.location="index2.htm"}
		}	}	}	}	}
//========||============================================||======\\
// Read Cookie Just for AddToCart Pages
// I am Not User Option.  Open Sign in optin opens in a new page 
//     This Routine turns the DYNAMIC PARTS RED IN AddToCart2.cgi
function printJustName2 ()
		{
			var yourName = "";
			var yourName = document.cookie;
			var yourParsedName = yourName.split(";");
			var yourName22 = yourParsedName[0].split("=");
			var yourName22 = yourName22[1].split("/");
			var yourName2 = unescape(yourName22[0]);
			if (yourName2 == ""){yourName2 = " signed in."};
			if (yourName2 == "null"){yourName2 = " signed in."};
			if (yourName2 == undefined){yourName2 = " signed in."};
					document.write("<font Face=Georgia size=2> Hello<b><font color=\"#0000cc\" face=tahoma size=3><font color=\"#990000\"><b> ");
			if (yourName2 !=" signed in."){document.write( yourName2);};			 
			document.write("</font></b></font></b> !!<br> Welcome to the Sole Attire Web Site<br>");
	              var itemS = yourName22[4];
		var letter = "s"
		if(itemS == ""){ itemS = "No";}
		if(itemS == undefined){ itemS = "No";}
		if(itemS == 1){letter = "";}
		document.write("<center><Font size=2 color=blue><b> You have<i><font color=\"#990000\"><b> " + itemS + " item" + letter +"</b></font> </i> in your cart.</b></font><br> ");
			document.write("<br><FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()>I am not <font color=\"#990000\"><b> " + yourName2 + "</b></font></a></FONT><br>" );
			}
//========||============================================||======\\
// Acts on index2.htm  to rotate message / links / text
function scrollIntro ()
		{	
		theDate = new Date
		theDate.setMonth(theDate.getMonth() + 1);
			var yourName2 = "";
			var yourName2 = document.cookie;
			var yourParsedName = yourName2.split(";");
			var yourName22 = yourParsedName[0].split("=");
			var yourName2 = yourName22[1].split("/");
			var yourName = unescape(yourName2[0]);
			var visitTime =Math.round(yourName2[1]);
			if (yourName == ""){yourName = " signed in."};
			if (yourName == "null"){yourName = " signed in."};
			if (yourName == undefined){yourName = " signed in."};
if (visitTime == undefined){visitTime=1};
		document.write("<br><FONT Face=tahoma Size=1><a href='index1.htm' onClick=killCookie()>I am not " + yourName2 + "</a></FONT><br>" );
		//  ---------  Messages  ------
		if(visitTime==1){document.write("<a href=\"specials.htm#3\"><img src=DB/navagation_images/splash2.GIF border=\"0\"></a>")}
		if(visitTime==2){document.write("<a href=\"about.htm#3\"><img src=DB/navagation_images/splash21.GIF border=\"0\"></a>")}
		if(visitTime==3){document.write("<a href=\"personalassistant.htm#3\"><img src=DB/navagation_images/splash22.GIF border=\"0\"></a>")}
		if(visitTime==4){document.write("<a href=\"specials.htm#2\"><img src=DB/navagation_images/splash23.GIF border=\"0\"></a>")}
		if(visitTime==5){document.write("<a href=\"addtocart4.htm\"><img src=DB/navagation_images/splash24.GIF  border=\"0\" ></a>")}
		if(visitTime==6){document.write("<a href=\"newarrivals.htm#2\"><img src=DB/navagation_images/splash25.GIF border=\"0\"></a>")}
		}
//========||============================================||======\\
// Acts on index2.htm  to rotate message / links / text / pictures
function scrollPic ()
		{
		var yourNameq = document.cookie;
//  THIS FUNCTION IS BROKEN AND MUST BE FIXED
		var yourParsedName = yourNameq.split(";");
		var yourName2 = yourParsedName[1].split("=");
		var yourName = yourName2[1]; 
		var yourName = unescape(yourName);
		var visitTime = eval(yourName[2]); 
if (visitTime == undefined){visitTime=1};
		//  ---------  Messages  ------	
		if(visitTime==1){document.write("<a href=\"specials.cgi#3\" ><img src=DB/navagation_images/splash2.GIF border=\"0\"></a>")}
		if(visitTime==2){document.write("<a href=\"html/about.htm#3\" ><img src=DB/navagation_images/splash21.GIF border=\"0\"></a>")}
		if(visitTime==3){document.write("<a href=\"personalassistant.htm#3\"><img src=DB/navagation_images/splash22.GIF border=\"0\"></a>")}
		if(visitTime==4){document.write("<a href=\"specials.cgi#2\"><img src=DB/navagation_images/splash23.GIF border=\"0\"></a>")}
		if(visitTime==5){document.write("<a href=\"specials.cgi\" ><img src=DB/navagation_images/splash24.GIF  border=\"0\" ></a>")}
		if(visitTime==6){document.write("<a href=\"newarrivals.cgi#2\"><img src=DB/navagation_images/splash25.GIF border=\"0\"></a>")}
		}
//========||===========================================||======\\
// Allows Printing of Page with Java Button in printButton
//  THIS FUNCTION IS BROKEN AND MUST BE FIXED
//  THIS FUNCTION IS BROKEN AND MUST BE FIXED
//  THIS FUNCTION IS BROKEN AND MUST BE FIXED
function printit()
		{  
		//if (NS) 
			//{
	  		// window.print() ;  
			//} 
		//else 
			//{
	    		//var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 	CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
			//document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
   			//WebBrowser1.ExecWB(6, 2);                 //Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
			//}	
		}
//========||============================================||======\\
//Java Button to call printit , This function creates the button.
function printButton ()
		{
		var NS = (navigator.appName == "Netscape");
		var VERSION = parseInt(navigator.appVersion);
		if (VERSION > 3) 
			{
			document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');        
			}
		}
//========||============================================||======\\
function tomoney(value)
		{
		nmbr = Math.round(100 * value);		// remove decimal
		digit = nmbr % 10;         			// find right most digit
		numstr = digit.toString();      			// convert digit to string
		nmbr = nmbr - digit;			// set right digit to zero
		nmbr = nmbr / 10;				// remove right most digit
		digit = nmbr % 10;				// find next right most digit
						// revise string with new right most digit ON LEFT
						// put decimal point in string
		numstr = "." + digit.toString() + numstr;
		cnt = 0					// set counter to zero
		nmbr = nmbr - digit;			// set right digit to zero
		nmbr = nmbr / 10;				// remove right most digit
		while(nmbr)				// while nmbr NOT zero
			{
			if(cnt == 3) 			// after ever 3 digits and
				{			// before the fourth digit
				numstr = "," + numstr;	// insert a comma
				cnt = 0;			// reset counter
				}
			cnt++;				// increment counter
			digit = nmbr % 10;			// find next right most digit
							// revise string with new right most digit ON LEFT
			numstr = digit.toString() + numstr;
			nmbr = nmbr - digit;		// set right digit to zero
			nmbr = nmbr / 10;			// remove right most digit
			}  
		numstr = "$ " + numstr;			// add dollar sign
		document.write("<font color=333399>" + numstr + "</font>");
		}
//========||============================================||======\\//========||============================================||======\\
function toMoney(value)
		{
		nmbr = Math.round(100 * value);		// remove decimal
		digit = nmbr % 10;         			// find right most digit
		numstr = digit.toString();      			// convert digit to string
		nmbr = nmbr - digit;			// set right digit to zero
		nmbr = nmbr / 10;				// remove right most digit
		digit = nmbr % 10;				// find next right most digit
						// revise string with new right most digit ON LEFT
						// put decimal point in string
		numstr = "." + digit.toString() + numstr;
		cnt = 0					// set counter to zero
		nmbr = nmbr - digit;			// set right digit to zero
		nmbr = nmbr / 10;				// remove right most digit
		while(nmbr)				// while nmbr NOT zero
			{
			if(cnt == 3) 			// after ever 3 digits and
				{			// before the fourth digit
				numstr = "," + numstr;	// insert a comma
				cnt = 0;			// reset counter
				}
			cnt++;				// increment counter
			digit = nmbr % 10;			// find next right most digit
							// revise string with new right most digit ON LEFT
			numstr = digit.toString() + numstr;
			nmbr = nmbr - digit;		// set right digit to zero
			nmbr = nmbr / 10;			// remove right most digit
			}  
		numstr = "$ " + numstr;			// add dollar sign
		document.write(numstr);
		}
//========||============================================||======\\
function table ()
{
		theDate = new Date
		theDate.setMonth(theDate.getMonth() + 1);
			var yourName2 = "";
			var yourName2 = document.cookie;
			var yourParsedName = yourName2.split(";");
			var yourName22 = yourParsedName[0].split("=");
			var yourName2 = yourName22[1].split("/");
			var yourName = unescape(yourName2[0]);
			var visitTime =Math.round(yourName2[1]);
			if (yourName == ""){yourName = " signed in."};
			if (yourName == "null"){yourName = " signed in."};
			if (yourName == undefined){yourName = " signed in."};
if (visitTime == undefined){visitTime=2};

		if(visitTime==1){var thisShoe = "Delman";var thisCat = "Specials";}
		if(visitTime==2){var thisShoe = "Tiger";var thisCat = "Specials";}
		if(visitTime==3){var thisShoe = "Shoe-Box";var thisCat = "Specials";}
		if(visitTime==4){var thisShoe = "Cleo";var thisCat = "New";}
		if(visitTime==5){var thisShoe = "Hi-Pump";var thisCat = "New";}
		if(visitTime==6){var thisShoe = "Lotus-Pump";var thisCat = "New";}
		if(visitTime==7){var thisShoe = "Peter-Pan";var thisCat = "Cat";}
		if(visitTime==8){var thisShoe = "Stiletto-Sneaker-Mule";var thisCat = "Cat";}
		if(visitTime==9){var thisShoe = "Sock-Boot";var thisCat = "Cat";}
		
	document.write("<a href=\"" + thisCat + ".cgi#" + thisShoe + "\"><img Alt=" + thisShoe + " src=\"DB/gifsnew/" + thisShoe);
	document.write(".gif\" border=\"0\" ></a>")
}
//=============================================