	var gCGIPath = 'http://one.interpelago.com/cgi-bin/'
	var gCGIPathSecure = 'https://one.interpelago.com/cgi-bin/'
	function randomN(N) { 
		// returns a random number from 0...(N-1) inclusive
		return Math.floor(N*(Math.random()%1)) ;
	}
	function validEmailname(str) {
		var aN = str.split(',');
		for (var i = 0; i < aN.length; i++) {
			var strEmail = aN[i];
			if (!strEmail.match(/^[ +A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z +]{2,8}$/i)) { return false; }
		}
		return true;
	}

	var isDHTML = 0;
	var isID = 0;
	var isAll = 0;
	var isLayers = 0;
	
	if (document.getElementById) {isID = 1; isDHTML = 1;}
	if (document.all) {isAll = 1; isDHTML = 1;}
	browserVersion = parseInt(navigator.appVersion);
	if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers=1; isDHTML = 1;}
	
	// Get object's browser specific DOM reference
	function getDOM(objID,fStyle) {
		if (fStyle == 1) {
			if (isID) {return (document.getElementById(objID).style);}
			else {
				if (isAll) {return (document.all[objID].style);}
				else {
					if (isLayers) {return (document.layers[objID]);}
				}
			}
		}
		else {
			if (isID) {return (document.getElementById(objID));}
			else {
				if (isAll) {return (document.all[objID]);}
				else {
					if (isLayers) {return (document.layers[objID]);}
				}
			}	
		}
	}
	function login() {
		top.document.location = gWWWPathSecure+"signin.html";
	}

 	var strLeadFeature = "My life on one page in 30 seconds or less.";
	var aFeatures = new Array(
		"Markets your successes.",
		"Saves money on paper, printing, postage, and IT staff.",
		"Consistent user interface.",
		"Disseminates information to every constituency.",
		"Easy viewing and changing page content.",
		"Easy to setup and maintain.",
		"Inexpensive to operate.",
		"Flexible for groups of all shapes and sizes",
		"Group pages for committees and classrooms.",
		"Resource sharing across classrooms and projects.",
		"Collaboration with other communities&#151;local and global.",
		"Hosting similar to a small-business ISP service.",
		"Face pages for everyone.",
		"Maintain one contact record for each person.",
		"Associate family and group members.",
		"Find people in an emergency.",
		"Share pictures, links, documents, discussions, notices, and events.",
		"Group leaders control who sees their group information.",
		"Location pages for reserving shared facilities.",
		"Community resource libraries and mini-websites.",
		"Calendars for any group or combination of groups.",
		"Calendars by day, week or month.",
		"Banners with click-thru to external websites.",
		"Enterprise-level security.",
		"Password self-reset.",
		"Your organization's colors, fonts, logos and pictures.",
		"Export to Microsoft Outlook and other programs.",
		"100+ self-explanatory forms for D.I.Y. post and change.",
		"Shares admin tasks among different people.",
		"Integrated help and page tours.",
		"No HTML or programming.",
		"No additional local server or hardware.",
		"No dedicated technical staff.",
		"Designed for and tested by real communities.",
		"A personal home page for each person.",
		"Group pages for outreach and collaboration.",
		"Location pages for coordinating times and places.",
		"Pages for forms and other shared resources.",
		"Fast, full-text search.",
		"Extensive, dynamic calendars.",
		"Class and group directories delivered in real time.",
		"Mailing lists for print and e-mail communications.",
		"Emergency contact information for everybody."
		)
	var aSlides = new Array(
		"kidpic0.jpg",
		"kidpic1.jpg",
		"kidpic2.jpg",
		"kidpic3.jpg",
		"kidpic4.jpg",
		"kidpic5.jpg",
		"kidpic6.jpg",
		"kidpic7.jpg",
		"kidpic8.jpg",
		"kidpic9.jpg",
		"kidpic10.jpg",
		"kidpic11.jpg",
		"kidpic12.jpg",
		"kidpic13.jpg",
		"kidpic14.jpg",
		"kidpic15.jpg",
		"kidpic16.jpg"
		);
	var aQuotes = new Array(
		"I've seen the light!!!::Julie B. (principal)",
		"I am a tech-idiot&#151;truly. But I definitely appreciated the ability to just click on 5th grade families and instantly communicate. I really appreciated the efficiency of it all (and yes, you can quote me on that J).::Karen W. (parent)",
		"I think it is a wonderful tool.::Maria L. (parent)",
		"Thank you so much! The site is awesome!::Karin B. (parent)",
		"Thanks again for providing an effective way for our community to communicate! This is exciting!::Althea C. (teacher)",
		"Please Please keep it on! I beg of you.::Andrew C. (4th grade student)",
		"I endorse the Interpelago school website. It\'s been a pleasure to use and a great help. My daughter went there to get assignments she\'d lost. I appreciated being instantly connected to anything I needed to know about my child\'s classroom. Additionally, it\'s fun and easy to use and is far better than other school websites I\'ve visited.::Annie M. (parent)",
		"Wow, I have signed on and given us pictures and it looks TOTALLY AWESOME!::Carla T. (parent)",
		"I loved the website and it was really cool and helpful.::Katriona G.",
		"This website is the best help room 21A has gotten this year! PLEASE, PLEASE, PLEASE, keep it up!::Jacob M. (student)",
		"I felt pretty fortunate that our son's class was chosen as the guinea pig. I found the site to be useful, nicely laid out and very easy on the eyes. It's a really efficient way to get up-to-date info.::Jeffrey F. (parent)",
		"I really like the website because it helps if I forget my homework, and it is like my own online space.::Casey P. (student)",
		"The calendar was indispensable and the e-note function was much enjoyed by my daughter.::Susan B. (parent)",
		"Kathleen loves it. She went on the site and explored all over. We took the tour together, and that helped. Thanks again for the help and for setting it up.::Ellen S. (parent)",
		"Thanks so much for all your work on the class website. Alexander has a new sports schedule which makes it impossible to do any homework on Mondays so being able to access the worksheets and spelling words on Sunday is a lifesaver.::Peggy P. (parent)",
		"We love the web site.::Peter V. (parent)",
		"Thank you so much for piloting this&#151;I love it! I pushed for it on the PTA board, and I'll keep pushing for it to be in the whole school. We've already used it to download Julien's homework for the week.::Kristine L. (parent)",
		"This is really fabulous! There are so many times Katriona has left her homework at school.::Kendall G. (parent)",
		"We love it. Thanks for setting this up.::Annie M. (parent)",
		"That's way cool. Thanks to you & whoever else is responsible for putting it together.::Jeff F. (parent)",
		"I am a big fan of the Interpelago website. It provided me and my daughter with immediate, important class information, such as homework assignment specifics, project due dates, class parent contact information, weekly spelling list information, project requirements, class and school bulletins, class feedback&#151;the list goes on and on.::Susan B. (parent)",
		"It reduced the need for me to be the \"middle man\" between her and school.::Susan B. (parent)",
		"I am not a divorced parent, but I could see how the network would facilitate better communication among parents who are split&#151;it puts everyone on the same page, literally.::Susan B. (parent)"
		);

	function clearArray(aR) {
		for (var i = 0; i < aR.length; i++) {
			aR[i] = 0;
		}
	}
	var aSlidesShown = new Array(aSlides.length);
	var nSlidesShown = 0;
	function doSlideShow() {
		var obStyle1 = getDOM('slide'+iSlide,1);
		nSlidesShown = (nSlidesShown+1)%(aSlides.length-1);
		if (nSlidesShown == 0) {
			clearArray(aSlidesShown);
		}
		aSlidesShown[iSlide] = 1; 
		while (aSlidesShown[iSlide]) {
			iSlide = randomN(aSlides.length); 
		}
		var obStyle2 = getDOM('slide'+iSlide,1);
		obStyle2.display = 'block';
		obStyle1.display = 'none';
	}
	var slideShow;
	function installSlideShow() {
		slideShow = setInterval('doSlideShow()', '10000000');
	}

	var aFeaturesShown = new Array(aFeatures.length);
	var nFeaturesShown = 0;
	function doFeatureShow() {
		var obStyle1 = getDOM('feature'+iFeature,1);
		nFeaturesShown = (nFeaturesShown+1)%(aFeatures.length-1);
		if (nFeaturesShown == 0) {
			clearArray(aFeaturesShown);
		}
		aFeaturesShown[iFeature] = 1; 
		while (aFeaturesShown[iFeature]) {
			iFeature = randomN(aFeatures.length); 
		}
		var obStyle2 = getDOM('feature'+iFeature,1);
		obStyle2.display = 'block';
		obStyle1.display = 'none';
	}
	var featureShow;
	function installFeatureShow() {
		featureShow = setInterval('doFeatureShow()', '10000000');
	}

	var aQuotesShown = new Array(aQuotes.length);
	var nQuotesShown = 0;
	function doQuoteShow() {
		var obStyle1 = getDOM('quote'+iQuote,1);
		nQuotesShown = (nQuotesShown+1)%(aQuotes.length-1);
		if (nQuotesShown == 0) {
			clearArray(aQuotesShown);
		}
		aQuotesShown[iQuote] = 1; 
		while (aQuotesShown[iQuote]) {
			iQuote = randomN(aQuotes.length); 
		}
		var obStyle2 = getDOM('quote'+iQuote,1);
		obStyle2.display = 'block';
		obStyle1.display = 'none';
	}
	var quoteShow;
	function installQuoteShow() {
		quoteShow = setInterval('doQuoteShow()', '10000000');
	}

	function initSlideShow() {
		installSlideShow();
		installFeatureShow();
		installQuoteShow();
	}

	var	iFeature = 0;
	var	iSlide = 0;
	var	iQuote = 0;
	function loadSlides() {
		var str = '';
		iFeature = randomN(aFeatures.length); 
		iSlide = randomN(aSlides.length); 
		iQuote = randomN(aQuotes.length); 
		for (var i = 0; i < aSlides.length; i++) {
			var strDisplay = 'none';
			if (i == iSlide) { strDisplay = 'block'; }
			var fName = aSlides[i];
			str += '<div id="slide'+i+'" class="slideshow" style="display:'+strDisplay+';">';
				str += '<img width="200" height="200" src="image/kidpix/'+fName+'" border="0" alt="" title="'+fName+'" onclick="doSlideShow();doFeatureShow();">';
			str += '</div>';
		}
		for (var i = 0; i < aFeatures.length; i++) {
			var strDisplay = 'none';
			if (i == iFeature) { strDisplay = 'block'; }
			var strFeature = aFeatures[i];
			str += '<div id="feature'+i+'" class="featureshow" style="display:'+strDisplay+';">';
				str += '<div class="featureshowtext">';
					str += '<img src="image/petal.gif" alt=""> '+strFeature;
				str += '</div>';
			str += '</div>';
		}
		for (var i = 0; i < aQuotes.length; i++) {
			var strDisplay = 'none';
			if (i == iQuote) { strDisplay = 'block'; }
			var aQuote = aQuotes[i].split('::');
			var strQuote 	= aQuote[0];
			var strAttr 	= aQuote[1];
			str += '<div id="quote'+i+'" class="quotesshow" style="display:'+strDisplay+';">';
				str += '<div class="quotesshowtext">';
					str += '<span class="quotemark">&#147;</span>'+strQuote+'<span class="quotemark">&#148;</span>';
					str += '<div class="quoteattr">';
						str +=  ' &#151;'+strAttr;
					str += '</div>';
				str += '</div>';
			str += '</div>';
		}
		document.writeln(str);
	}

	var gtDate = new Date();
	
	function showLicense() {
		var wndNew = wndOpenNewDialog("Terms of Use",600,500);
		if (wndNew != null) {
			var strLoc = "terms_of_use.html";
			wndNew.location.replace(strLoc);
			wndNew.focus();
		} else {
			alert("Sorry, the Terms of Use window could not be opened. If you continue having troubles, please let us know directly. Thank you.");
		}
	}
	// -- Create minimum-crome client side browser window
	function wndOpenNewDialog(strWndName, dxPref, dyPref) {
		var dx = screen.width - 80 ;
		var dy = screen.height - 160;
		if (dxPref > dx) {dxPref = dx;}
		if (dyPref > dy) {dyPref = dy;}
		var xWnd = parseInt((dx + 70 - dxPref)/2);
		if (xWnd < 10) { xWnd = 10; }
		// if (navigator.appName.indexOf('Netscape') != -1) { dxPref += 15 } // different spacing for scroll bars
		var strParams = "directories=0,personalbar=0,scrollbars=1,status=0,resizable=1,location=0,toolbar=0,width="+dxPref+",height="+dyPref+",screenX="+xWnd+",left="+xWnd+",screenY="+82+",top="+82;
		var wndNew = window.open("",strWndName,strParams);
		return wndNew;
	}

	function showExample(strURL) {
		var dx = 800;
		var dy = 600;
		var strParams = "status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1,width="+dx+",height="+dy+",screenX=10,left=10,screenY=10,top=10";
		var wndNew = window.open("","",strParams);
		if (wndNew != null) {
			wndNew.moveTo(10,10);
			wndNew.location = strURL;
			wndNew.focus();
		}
	}
	var gTabs = 5;
	function getPageTitle(i) {
		if (i == 0) { return 'Home'; }
		else if (i == 1) { return 'About'; }
		else if (i == 2) { return 'Service'; }
		else if (i == 3) { return 'FAQ'; }
		else if (i == 4) { return 'Company'; }
		else if (i == 5) { return 'Contact'; }
		//else if (i == 6) { return 'Tell a Friend'; }
		else if (i == 100) { return 'Sign In'; }
		else return gstrSchoolPublicSite;
	}
	function getDocURL(i) {
		if (i == 0) { return 'index.html'; }
		else if (i == 1) { return 'about.html'; }
		else if (i == 2) { return 'service.html'; }
		else if (i == 3) { return 'faq.html'; }
		else if (i == 4) { return 'company.html'; }
		else if (i == 5) { return 'contact_us.html'; }
		//else if (i == 6) { return 'tell_a_friend.html'; }
		else if (i == 100) { return 'sign_in.html'; }
		else return 'index.html';
	}
	function pageIndex() {
		var strURL = document.URL;
		for (var i = 0; i <= gTabs; i++) {
			if (strURL.indexOf(getDocURL(i),0) != -1) { return i; }
		}
		return 0;
	}
	function docTitle() {
		var strURL = document.URL;
		for (var i = 0; i <= gTabs; i++) {
			if (strURL.indexOf(getDocURL(i),0) != -1) { return getPageTitle(i); }
		}
		return "Result";
	}
	function drawSubhead (iTab) {
		iTab = pageIndex();
		var str = '';
		str += '<div class="mip_sectionhead_main">';
			str += '<table cellspacing="0" cellpadding="0"><tr>';
			var iPageIndex = pageIndex();
			if (iTab) {
				iPageIndex = iTab;
			}
			for (var i = 0; i <= gTabs; i++) {
				var strClass = 'mip_sectionhead_tab';
				var strTextClass = 'mip_sectionhead_tab_text';
				if (i == iPageIndex) {
					strClass = 'mip_sectionhead_tab_hilited';
					strTextClass = 'mip_sectionhead_tab_text_hilited';
				}
				str += '<td nowrap>';
				str += '<div class="'+strClass+'">';
					str += '<a class="'+strTextClass+'" href="'+getDocURL(i)+'">'+getPageTitle(i)+'</a>';
				str += '</div>';
				str += '</td>';
			}
			i = 100;
			var strClass = 'mip_sectionhead_tab';
			var strTextClass = 'mip_sectionhead_tab_text';
			str += '<td nowrap>';
			str += '<div class="'+strClass+'" style="padding-left:475px">';
				str += '<a class="'+strTextClass+'" href="'+getDocURL(i)+'">'+getPageTitle(i)+'</a>';
			str += '</div>';
			str += '</td>';
			str += '</tr></table>';
		str += '</div>';
		document.writeln(str);
	}
	function drawPBArea() {
	return '';
		var str = '';
		str += '<div class="rip_sectionhead_narrow">';
			str += '<table cellspacing="0" cellpadding="0" class="sectionhead_table_narrow"><tr><td class="sectionhead_text">';
			str += '&nbsp;';
			str += '</td></tr></table>';
		str += '</div>';
		document.writeln(str);
	}
	function drawTagLine(tagtext) {
		var str = '';
		str += '<div id="mip_tagline">';
			str += 'Web communications<br>for sustainable communities.';
			// str += 'The secure communications<br>dataport for your school.';
		str += '</div>';
		document.writeln(str);
	}
	
