//
/*  System Variables                      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
	var day   = new Array("Sun","Mon","Tues","Wednes","Thurs","Fri","Satur");
	var month = new Array("January","February","March","April","May","June",
                "July","August","September","October","November","December");
	var today = new Date();
	var oneDay = 0;
	oneDay = 1000*60*60*24;


/*  Display Date Modified
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
function printLastMod() 
{
	var x = new Date (document.lastModified);
	var modDate = new Date(x.toGMTString());
	var modYear = takeYear(modDate);
	var modMonth = modDate.getMonth();
	modMonth += 1;
	document.write( modMonth + "/" + modDate.getDate() + "/" + modYear );
}

function takeYear(theDate) 
{
	var x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}

function copyRight() 
{
	today = new Date();
	document.write( "&copy;" + today.getFullYear() + "." );
}

function printToday(bold) 
{
	var printIt = new String(day[today.getDay()] + "day" + " &nbsp; &#149; &nbsp; " + 
					month[today.getMonth()] + " " + 
                    today.getDate() + "&nbsp;");
	if ( bold == "bold" )
	{
		document.write( "<strong>" + printIt + "</strong>" );
	} 
	else 
	{
		document.write( printIt );
	}
	
}


function popup(url, name, height, width)
{
	var popwin;
	var opts = "toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
	opts += ",height=" + height + ",width=" + width;
	
	popwin = window.open("", name, opts);
	popwin.focus();
	popwin.location = url;
}




//
//  Display Date Modified
//
function lastMod() {
	var x = new Date (document.lastModified);
	Modif = new Date(x.toGMTString());
	Year = takeYear(Modif);
	Month = Modif.getMonth();
	Month += 1;
	Day = Modif.getDate();
/*	var towrite = 'updated ' + Month + '.' + Day + '.' + Year; */
	var towrite = Month + '-' + Day + '-' + Year;
	return towrite;
}
function takeYear(theDate) {
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}



function underReview(yes) {
	if	( yes != "no" )
	{
		document.write('<div class="alert"><div class="tiptext"><p class="centered"><strong>HEALTH SECTION UNDER REVIEW</strong><br />Content is continuously under review by the SCWTCA Health Committee and our researchers. <br />Updates will be posted as they become available.</p></div></div>')	
	}
}

function specialMsg(yes) {
	if	( yes = "yes" )
	{
		document.write('<table width=95% border=1 cellpadding=2 align=center bgcolor="#990000"><tr><td class=dbfcm-v1 style="text-align:center; color:#FFF;font-size:0.9em;">HAPPY HOLIDAYS !!<br>Dog\'s Best Friend<br>will be closed<br>12/24 &mdash; 1/5<br></td></tr></table>'')	
	}
}


function locateBreeder() {
	document.write('<p>&nbsp;</p><div id="vend01" class="vend"><div class="vendtrig"><h4><a href="../breeders.htm">To locate a reputable breeder in your area, visit the Breeders List</a>.</h4></div></div>')

}


// =======================================================
//   Email Spider Stumper v3.1
//    last modified 13 Oct 2005
//    Developed by Scott Clark & Kevin Duhe
//    The Source is available at http://www.clarksco.com/blog/
//    Copyright 2005 Clark Consulting
// =======================================================
//   MODIFIED for flexible domains
//      Robyn Alexander  2007-06-10
// ======================================================= 

// There are three arguments being passed into this array.
//   "theName"    =  username (or the portion of the email address prior to the @.
//   "theDomain"  =  domain   (not including .com,.net, etc)
//   "theCom"     =  com,net, edu    (defauts to com if left blank)
//   "theSubject" =  subjec for email.   Can be blank if you don't want to use this feature.
//   "theLink"    = text for the link such as "Jane Doe"  (defaultsto email address if blank)

function stumpIt(theName,theDomain,theCom,theSubject,theLink) {
	if	( theCom == "" )
	{	
		theCom = "com";
	}
	if ( theSubject == "" ) 
	{
		theSubject = document.title;
	}
	var theEmail = theName+"@"+theDomain+"."+theCom;
	var theEmailSubj = theName+"@"+theDomain+"."+theCom+"?subject="+theSubject;
	if	( theName == "" || theDomain == "" )
	{
		theName = "ERROR";
		theLink = "ERROR";
		myEmail = theName;
		myLink = theLink;
	}
	else
	{
		if (theLink == "" && theSubject == "")
		{
			myLink = theEmail;
			myEmail = theEmail;
		}
		else if  ( theLink == "" && theSubject != "")
		{
			myLink = theEmail;
			myEmail = theEmailSubj;
		}
		else if  ( theLink != ""  &&  theSubject != "" )
		{
			myLink = theLink;
			myEmail = theEmailSubj;
		}
		else if  ( theLink != ""  &&  theSubject == "" )
		{
			myLink = theLink;
			myEmail = theEmail;
		}
	}
	document.write('<a href="mailto:' + myEmail + '">' + myLink + '</a>');
}
function stumpWeb(theName,theDomain,theCom,theSubject,theLink) {
	if	( theCom == "" )
	{	
		theCom = "com";
	}
	if ( theSubject == "" ) 
	{
		theSubject = document.title;
	}
	var theEmail = theName+"@"+theDomain+"."+theCom;
	var theEmailSubj = theName+"@"+theDomain+"."+theCom+"?subject="+theSubject;
	if	( theName == "" || theDomain == "" )
	{
		theName = "ERROR";
		theLink = "ERROR";
		myEmail = theName;
		myLink = theLink;
	}
	else
	{
		if (theLink == "" && theSubject == "")
		{
			myLink = theEmail;
			myEmail = theEmail;
		}
		else if  ( theLink == "" && theSubject != "")
		{
			myLink = theEmail;
			myEmail = theEmailSubj;
		}
		else if  ( theLink != ""  &&  theSubject != "" )
		{
			myLink = theLink;
			myEmail = theEmailSubj;
		}
		else if  ( theLink != ""  &&  theSubject == "" )
		{
			myLink = theLink;
			myEmail = theEmail;
		}
	}
	document.write('<a href="mailto:' + myEmail + '" style="border-right:0px; padding-left:0px; padding-right:0px;">' + myLink + '</a>');
}




// -------------------------------------------------------------------
// randomImage
//   Used on scwtca.org to display randomimage
// -------------------------------------------------------------------
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

function randomImage ()
{
	// Set up the image files to be used.
	var theImages = new Array() // do not change this
	var theName   = new Array() // do not change this
	var theShow   = new Array() // do not change this
	var theWin    = new Array() // do not change this
	// To add more image files, continue with the
	// pattern below, adding to the array.

	theImages[0] = '20081004 SCWTCA Best Puppy Sweeps.jpg'
	theShow[0]   = '10/ 4/2008 &nbsp;&ndash;&nbsp; SCWTCA National'
	theName[0]   = 'Orion Trebol Hot On The Leader Board'
	theWin[0]    = 'Best in Puppy Sweepstakes'

	theImages[1] = '20081004 SCWTCA Best Vet Sweeps.jpg'
	theShow[1]   = '10/ 4/2008 &nbsp;&ndash;&nbsp; SCWTCA National'
	theName[1]   = 'Ch Gleanngay Keep The Faith VCD2 RN'
	theWin[1]    = 'Best in Veteran Sweepstakes'
	
	theImages[2] = '20081005 MCKC BOB.JPG'
	theShow[2]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[2]   = 'Ch Doubloon\'s Ultimate Player'
	theWin[2]    = 'Best of Breed'

	theImages[3] = '20081004 SCWTCA BOS Puppy Sweeps.jpg'
	theShow[3]   = '10/ 4/2008 &nbsp;&ndash;&nbsp; SCWTCA National'
	theName[3]   = 'Caraway Strike A Pose'
	theWin[3]    = 'Best Opposite Sex in Puppy Sweepstakes'

	theImages[4] = '20081004 SCWTCA BOS Vet Sweeps.jpg'
	theShow[4]   = '10/ 4/2008 &nbsp;&ndash;&nbsp; SCWTCA National'
	theName[4]   = 'Ch Kaler Kick It Up A Notch'
	theWin[4]    = 'Best Opposite Sex in Veteran Sweepstakes'

	theImages[5] = '20081005 MCKC WD.jpg'
	theShow[5]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[5]   = 'Greentree Real Quiet'
	theWin[5]    = 'Winners Dog'

	theImages[6] = '20081005 MCKC WB BOW.jpg'
	theShow[6]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[6]   = 'Keepsake Lastingimage\'s Encore'
	theWin[6]    = 'Winners Bitch ~ Best of Winners'

	theImages[7] = '20081005 MCKC RWD.jpg'
	theShow[7]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[7]   = 'Cameron Hunnicut'
	theWin[7]    = 'Reserve Winners Dog'

	theImages[8] = '20081005 MCKC RWB.jpg'
	theShow[8]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[8]   = 'Kennally Hobel\'s Work of Art'
	theWin[8]    = 'Reserve Winners Bitch'

	theImages[9] = '20081005 MCKC AOM D-Vet.JPG'
	theShow[9]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[9]   = 'Ch Lakkas Ustilago'
	theWin[9]    = 'Award of Merit ~ Veteran Dog ~ Stud Dog'

	theImages[10] = '20081005 MCKC BOS.JPG'
	theShow[10]   = '10/ 5/2008 SCWTCA National ~ Montgomery County KC'
	theName[10]   = 'Ch Lovesong\'s Dance To The Beat'
	theWin[10]    = 'Best of Opposite Sex'

	// theImages[7] = '20080622 SCWTCSC BISw.jpg'
	// theShow[7]   = '6/22/2008 &nbsp;&ndash;&nbsp; SCWTC Southern California'
	// theName[7]   = '---'
	// theWin[7]    = 'Best in Sweeps'

	
	var p = theImages.length;

	// var j = 0
	// var preBuffer = new Array()
	// for (i = 0; i < p; i++){
	//    preBuffer[i] = new Image()
	//    preBuffer[i].src = theImages[i]
	// }
	var whichImage = Math.floor(Math.random()*p);
	
	document.write('<img src="../images/mckc2008/'+theImages[whichImage]+'" alt="'+theName[whichImage]+'" style="width:300px; border: 1px solid #000000;" >');
	document.write('<br /><strong>'+theShow[whichImage]+'</strong><br />'+theName[whichImage]+'<br /><em>'+theWin[whichImage]+'</em>');

}



// -------------------------------------------------------------------
// nextEvent
//   Used on scwtcnc.org to display days until next major event
// -------------------------------------------------------------------
function nextEvent ()
{
		var listDate = new Array(); 
		listDate[0]  = new Date();        
		listDate[1]  = new Date("Feb 11, 2008");
		listDate[2]  = new Date("Apr 10, 2008");
		listDate[3]  = new Date("Apr 11, 2008");
		listDate[4]  = new Date("May 3, 2008");
		listDate[5]  = new Date("May 30, 2008");
		listDate[6]  = new Date("Jun 22, 2008");
		listDate[7]  = new Date("Jul 25, 2008");
		listDate[8]  = new Date("Aug 15, 2008");
		listDate[9]  = new Date("Oct 5, 2008");
		listDate[10] = new Date("Dec 13, 2008");

		var listName = new Array(); 
		listName[0]  = new String("");      
		listName[1]  = new String("the Westminster KC Dog Show in New York");
		listName[2]  = new String("the SCWTCA National Roving Specialty in Sacramento");
		listName[3]  = new String("the SCWTCNC Specialty in Sacramento");
		listName[4]  = new String("the Del Val SCWTC Specialty in Philadelphia");
		listName[5]  = new String("the SCWTC of Greater St Louis Specialty");
		listName[6]  = new String("Great Western &amp; the SCWTCSC Specialty in Long Beach");
		listName[7]  = new String("the SCWTC of Greater Milwaukee Specialty");
		listName[8]  = new String("the Greater Denver SCWTC Specialty");
		listName[9]  = new String("Montgomery &mdash; the SCWTCA Specialty in Philadelphia");
		listName[10] = new String("AKC/Eukanuba Invitational in Long Beach");
		
		var next = 0;
		var diffDate = new Array();
		
		for ( i=0; i<listDate.length; i++ )
		{
			diff = Math.round(.49 + ( (listDate[i].getTime() - today.getTime()) / oneDay ) );
			diffDate[i] = diff;
		}
		for ( i=0; i<listDate.length; i++ )
		{
			if ( diffDate[i] > 0  )  
			{
				next = i;
				
				/*	
				document.write("i = " + i +
							   "&nbsp;&nbsp; diffDate[i] = " + diffDate[i] +
							   "&nbsp;&nbsp; diffDate[i+1] = " + diffDate[i+1] +
							   "NEXT = " + i + "&nbsp;&nbsp;&nbsp;<br />");                 
				*/
				
				break;

			}		
		}		

		document.write("Just " + diffDate[next] + " days until " + listName[next] + " on " 
                           + month[listDate[next].getMonth()] + " " 
                           + listDate[next].getDate() + ", " 
						   + listDate[next].getFullYear() + "&nbsp;" 
                           ); 
}




