<!-- Begin
/*----------------------------------------------------------------------------------------
|
|        Sitewide Tools and Functions Script by Josh Miller
|
-------------------------------------------------------------------------------------------*/ 
OrgName="The Christmas House"

var url=document.location.toString();
if(url.indexOf("www")<0){
	url=url.replace("christmas-house.com","www.christmas-house.com")
	if(url.indexOf("web")<0){
		document.location=url;
	}
}



//--------------------------------------- TITLEBAR TOOLS & FUNCTIONS ---------------------------------

function TitleBarTools(){
temp=document.location
temp=temp+"?action=print"
document.write("<a href='"+temp+"' class='leftmenu' target='_blank'>Print this Page</a><br/>");
document.write("<a href='javascript:EmailThisPage()' class='leftmenu'>Send to Friend</a><br/>");
document.write("<a href='javascript:BookmarkPage()' class='leftmenu'>Bookmark Page</a>");
}

function PrintPage(){
temp=document.location
temp=temp+"?action=print"
document.write("<a href='"+temp+"' target='_blank'><br/>Print this Page</a> |&nbsp;"); 
}


function EmailThisPage(){
color="#900";
bgcolor="#FFFFFF";

linktosend=document.location
Linkwindow=window.open("", "sendwin", "height=460,width=365,toolbar=no,scrollbars=no,menubar=no");
Linkwindow.document.write("<head><title>Email Link</title>");
Linkwindow.document.write("<LINK rel='stylesheet' type='text/css' href='pub/layout.css'>");
Linkwindow.document.write("<style>td{font-family:arial; font-size:10pt; color:#000000; }");
Linkwindow.document.write("#content{margin-left: 5px; margin-right: 0px ;margin-bottom: 0px;}");
Linkwindow.document.write("a:link,  a:visited    { color:#000; text-decoration: none; }");
Linkwindow.document.write("a:hover, a:active	 { color:#900; text-decoration: none; }");
Linkwindow.document.write("</style></head>");
Linkwindow.document.write("<body bgcolor='"+bgcolor+"'>");
Linkwindow.document.write("<div id='content'><div id='pagetitlebar'><span class='title'>Email this Page to a Friend</span></div>");
Linkwindow.document.write("<a href='"+linktosend+"' target='_blank' style='font-size:8pt'>"+linktosend+"</a>");
Linkwindow.document.write("<form method='get' action='forms/sendpage.asp' name='mail'>");
Linkwindow.document.write("<input type='hidden' value='"+linktosend+"' name='link'>");
Linkwindow.document.write("<input type='hidden' value='"+OrgName+"' name='orgname'>")
Linkwindow.document.write("<table border='0'>");
Linkwindow.document.write("<tr><td style='color:"+color+"'><b>Recipient's Name:</b></td><td><input type='text' name='toname'></td></tr>");
Linkwindow.document.write("<tr><td style='color:"+color+"'><b>Recipient's Email:</b></td><td><input type='text' name='to'></td></tr>");
Linkwindow.document.write("<tr><td style='color:"+color+"'><b>Your Name:</b></td><td><input type='text' name='fromname'></td></tr>");
Linkwindow.document.write("<tr><td style='color:"+color+"'><b>Your Email Address:</b></td><td><input type='text' name='replyto'></td></tr>");
Linkwindow.document.write("<td colspan='2'style='color:"+color+"'><b>Your Message:</b><br><textarea type='text' name='message' wrap='virtual' rows='10' cols='40'></textarea></td></tr>");
Linkwindow.document.write("<tr><td colspan='2' align='center'><input type='submit' value='Send Mail'>&nbsp;&nbsp;<input type='reset' value='Clear'><br>");
Linkwindow.document.write("<br/><a href='javascript:close()'>Close this window</a>");
Linkwindow.document.write("<br><br><span class='text'>Copyright © "+OrgName+"</span>");
Linkwindow.document.write("</td></tr></table>");
Linkwindow.document.write("</form></div></body></html>");
//if user does not close, the previous window, close it and then recreate it
	Linkwindow.document.close();
//bring the new window to the front
	Linkwindow.document.focus();
self.name="main"
}

function BookmarkPage(){
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0"){
	if (document.all){window.external.AddFavorite(document.location,document.title)}
}
else{alert("Press CONTROL-D to bookmark this page.");}
}

function SetHomepage(){
if (!document.all) {
	alert("This feature does not work in your browser.  We recommend you view this site with Internet Explorer 5.0 or above.")
	event.returnValue = false;
}
}

function ReportProblem(){
linktosend=document.location;
linktitle=document.title;
resolution=screen.width+" x "+screen.height+" x "+screen.colorDepth+" bit";
browser=navigator.appName+" "+navigator.appVersion;
color="#063";
bgcolor="#FFFFFF";

ProblemWindow=window.open("", "probwin", "height=460,width=365,toolbar=no,scrollbars=no,menubar=no");
ProblemWindow.document.write("<head><title>Problem with Webpage </title>");
ProblemWindow.document.write("<LINK rel='stylesheet' type='text/css' href='pub/layout.css'>");
ProblemWindow.document.write("<style>td{font-family:arial; font-size:10pt; color:#000000; }");
ProblemWindow.document.write("#content{margin-left: 5px; margin-right: 0px ;margin-bottom: 0px;}");
ProblemWindow.document.write("a:link,  a:visited    { color:#000; text-decoration: none; }");
ProblemWindow.document.write("a:hover, a:active	 { color:#900; text-decoration: none; }");
ProblemWindow.document.write("</style></head>");
ProblemWindow.document.write("<body bgcolor='"+bgcolor+"'>");
ProblemWindow.document.write("<div id='content'><div id='pagetitlebar'><span class='title'>Problem with Webpage</span></div>");
ProblemWindow.document.write("<form method='get' action='forms/reportproblem.asp' name='problem'>");
ProblemWindow.document.write("<input type='hidden' value='"+linktosend+"' name='link'>");
ProblemWindow.document.write("<input type='hidden' value='"+linktitle+"' name='linktitle'>");
ProblemWindow.document.write("<input type='hidden' value='"+resolution+"' name='resolution'>");
ProblemWindow.document.write("<input type='hidden' value='"+browser+"' name='browser'>");
ProblemWindow.document.write("<table border='0'>");
ProblemWindow.document.write("<tr><td style='color:"+color+"'><b>Your Name:</b></td><td><input type='text' name='from'></td></tr>");
ProblemWindow.document.write("<tr><td style='color:"+color+"'><b>Your Email:</b></td><td><input type='text' name='replyto'></td></tr>");
ProblemWindow.document.write("<tr><td style='color:"+color+"'><b>Problem:</b></td><td><select name='subject'>");
ProblemWindow.document.write("<option value='Problem with Page'>General problem</option>");
ProblemWindow.document.write("<option value='Spelling Error on Page'>Spelling error</option>");
ProblemWindow.document.write("<option value='Problem with Information on Page'>Inaccurate/outdated content</option>");
ProblemWindow.document.write("<option value='Problem with Picture on Page'>Missing pictures</option>");
ProblemWindow.document.write("<option value='Bad Link on Page'>Bad link</option>");
ProblemWindow.document.write("<option value='Display Problem with Page'>Display problem</option>");
ProblemWindow.document.write("<option value='Problem with Page'>Other</option></select></td></tr>");
ProblemWindow.document.write("<td colspan='2' style='color:"+color+"'><b>Describe the Problem:</b><br>");
ProblemWindow.document.write("<textarea type='text' name='problem' wrap='virtual' rows='10' cols='40'></textarea>");
ProblemWindow.document.write("<br>Your input is greatly appreciated.  The webmaster will review your problem and reply with an explanation or make corrections as soon as possible.</td></tr>");
ProblemWindow.document.write("<tr><td colspan='2' align='center'><input type='submit' value='Send Mail'>&nbsp;&nbsp;<input type='reset' value='Clear'><br>");
ProblemWindow.document.write("<br/><a href='javascript:close()'>Close this window</a>");
ProblemWindow.document.write("<br><br><span class='text'>Copyright © "+OrgName+"</span>");
ProblemWindow.document.write("</td></tr></table></form></div></body></html>");
//if user does not close, the previous window, close it and then recreate it
	ProblemWindow.document.close();
//bring the new window to the front
	ProblemWindow.document.focus();
self.name="main"
}

//--------------------------------------- WIKI FUNCTIONS ---------------------------------
function confirmSubmit(){
	var agree=confirm("Are you sure you wish to delete this page?"); 
	if (agree) 
		return true; 
	else 
		return false; 
} 

//--------------------------------------- DATE FUNCTIONS ---------------------------------

function PrintTodaysDate(){
	today=new Date();
	m=getMonth(today.getMonth());
	d=addZero(today.getDate());
	y=today.getYear();
	if (navigator.appName == "Netscape"){	//adjust for Netscape's weird handling of dates...
		y=(1900+y)
	}


	w=getWeekDay(today.getDay());
	document.write(w+" "+m+" "+d+", "+y)
}

function getMonth(month){
	switch (month){
		case 0: return "January";
		case 1: return "February";
		case 2: return "March";
		case 3: return "April";
		case 4: return "May";
		case 5: return "June";
		case 6: return "July";
		case 7: return "August";
		case 8: return "September";
		case 9: return "October";
		case 10:return "November";
		case 11:return "December";
		default:return "Error";
	}//end switch statement
}//end getMonth function

function getWeekDay(weekday){
	switch (weekday){
		case 0: return "Sunday";
		case 1: return "Monday";
		case 2: return "Tuesday";
		case 3: return "Wednesday";
		case 4: return "Thursday";
		case 5: return "Friday";
		case 6: return "Saturday";
		default:return "Error";
	}//end switch statement
}//end getWeekday function

function addZero(x){
	if(x<10){return "0"+x}
	else{return x}
}//end addZero function
//-->
