// shw_siteSettings.js (c)2008 SugarHill Works LLC - http://www.sugarhillworks.com

var d = document;
var rootPath = "";
//function getRootPath() {
//	for(var i = 2; i < rootPathNum; i++) {
//		rootPath += "../";
//	}
//	return rootPath;
//}
var thmsPerPg = 9;

var menuItems = new Array();

//// ********************************************************************************************************** //

//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// *********************************                                        ********************************* //
//// *********************************      DO NOT EDIT ABOVE THIS LINE       ********************************* //
//// *********************************                                        ********************************* //
//// *********************************         SET SITE OPTIONS BELOW         ********************************* //
//// *********************************                                        ********************************* //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
////
//
//// THE FOLLOWING LINES AFFECT THE TITLE THAT APPEARS IN THE BROWSER WINDOW'S TITLEBAR
//// [any legal HTML text is allowed]
var defaultTitle = "Shirdance New York | Dance Theatre Company";
var titleSeparator = " : ";
//var contactTitle = "contact";
//var bioTitle = "bio";



//// THE FOLLOWING LINES ARE USED TO BUILD THE SITE-WIDE HEADER MENU
// Each menuItem has several attributes:
// id (required) - the text that will appear as the link, the name of the file to be linked to, the name of the image(gif) if an image is to be used
//			that is, 'about' will appear in the menu or about.png will show,  and link to about.html
// image (required) - set to 1 if images are to be used - set to 0 for a text link
// submenuItems (optional) - set to a comma separated list of quote-enclosed submenu items. images not allowed.
//			or leave blank empty brakets for no submenu items , i.e. []
// 
// NOTE: menuItems link to an index.html file in the 'id' folder - i.e /about/index.hmtl
// NOTE: submenuItems link to 'item_name'.html file in the main menuitem 'id' folder' - i.e. /about/katrin.html, /about/shibori.html or use a '/' at the end to signify a directory, i.e. '2008/'
// NOTE: images are in the /mLnk/ folder of the site root and images should be named 'id'.png and 'id'_on.png - both files required - the _on.png file is for the mouse rollover event
//		See the example below and follow the pattern:
//
//		menuItems[0] = {
//			id: 'about', // should match desired link text or image name
//			image: true, // set to true if images are to be used - set to false for a text link
//			submenuItems: ['katrin', 'something'] // note: submenuItems are text-only
//		};
//
//		
//menuItems[0] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//};
//menuItems[1] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//};
//menuItems[2] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//};
//menuItems[3] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//}
//menuItems[4] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//}
//menuItems[5] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//}
//menuItems[6] = {
//	id: '', 
//	image: true, 
//	submenuItems: []
//}

//Matan Eshkar, Rachel Papo, Joshua Strauss, Danielle Faigenbaum, Julia Chesky, Loveka Studios (Israel)

//// THE FOLLOWING LINES ARE USED TO BUILD THE SITE-WIDE FOOTER
function makeFtr() {
	if(d.getElementById('copy')) { 
		d.getElementById('copy').innerHTML = '';
		var siteFtrHTML = '';
		var siteFtr = d.createElement('p');
		var ftrSep = '&nbsp;|&nbsp;';
		var ftrParts = new Array();
		var fi = 0-1;
		ftrParts[fi+=1] = '&nbsp;&#169; 2008 Shirdance New York';
		ftrParts[fi+=1] = '(917) 309-6062';
		ftrParts[fi+=1] = '<a href=\"mailto:shiri@shirdance.com\">shiri@shirdance.com</a><br />';
		ftrParts[fi+=1] = 'Photos by: Matan Eshkar, Rachel Papo, Joshua Strauss, Danielle Faigenbaum, Julia Chesky, Loveka Studios (Israel), Sarah Shatz, Stephan Phillips<br />';
		ftrParts[fi+=1] = '<a class=\"offsite\" onclick=\"window.open(\'http://sugarhillworks.com\',\'newWin\');\">Site by SugarHill Works</a>';
		for(var i = 0; i < ftrParts.length; i++) {
			if ((i == ftrParts.length - 1) || (ftrParts[i].indexOf('<br />') > -1) ){ 
				siteFtrHTML += ftrParts[i];
			} else {
				siteFtrHTML += ftrParts[i] + ftrSep;
			}
		}
		d.getElementById('copy').appendChild(siteFtr);
		siteFtr.innerHTML = siteFtrHTML;
	}
}



//// ********************************************************************************************************** //

//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// *********************************                                        ********************************* //
//// *********************************      DO NOT EDIT BELOW THIS LINE       ********************************* //
//// *********************************                                        ********************************* //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //

//// ********************************************************************************************************** //


var isitIE = false;
var isitIE7 = false;
if (window.attachEvent && !window.opera) { //object-detect IE5+, exclude opera
	isitIE = true;
	if(navigator.appVersion.match(/MSIE 7/)) isitIE7 = true
}
//
//// turn off 'image toolbar' in older versions of IE
if(isitIE == true){
	document.write("<meta HTTP-EQUIV=\"imagetoolbar\" content=\"no\">");
}
//
// for IE6+ so we can use appendChild, etc...
if (!window.Node) {
	var Node = {
		ELEMENT_NODE: 1,
		ATTRIBUTE_NODE: 2,
		TEXT_NODE: 3,
		COMMENT_NODE: 8,
		DOCUMENT_NODE: 9,
		DOCUMENT_FRAGMENT_NODE: 11
	};
}

function randOrd(){
	return (Math.round(Math.random())-0.5);
}

// preload basic site images
//var pld_01 = new Image();
//pld_01.src = "img/";
//var pld001 = new Image();
//pld001.src = "img/";
//var pld002 = new Image();
//pld002.src = "img/";

function site_init() {
	document.getElementsByTagName('title')[0].text = defaultTitle;
//	getRootPath();
//	makeMenu();
	makeFtr();
}
//
//these vars used in shwFade to define the ss container for image centering
//on this site, set to values from css
var maxvpW = 677;
var maxvpH = 452;
//
//
//
//function makeMenu() {
//	var menuParent = d.getElementById('hdr');
//	var logoHome_p = d.createElement('p');
//	var logoHome_a = d.createElement('a');
//	logoHome_a.href = rootPath;
//	var logoHome = new Image();
//	logoHome.src = rootPath + 'img/blank.gif';
//	logoHome.id = "logo";
//	logoHome_p.appendChild(logoHome_a);
//	logoHome_a.appendChild(logoHome);
//	menuParent.appendChild(logoHome_p);
//	
//	var menu = d.createElement('ul');
//	menu.className = 'menulist';
//	menu.setAttribute('id', 'listMenuRoot');
//	
//	for (var i = 0; i < menuItems.length; i++) {
//		menuItems[i].li = d.createElement('li');
//		menuItems[i].a = d.createElement('a');
//		menuItems[i].a.className = 'special';
//		menuItems[i].a.id = menuItems[i].id + 'Lnk';
//		menuItems[i].a.href = rootPath + menuItems[i].id + '/';
//		if (menuItems[i].image == false) {
//			menuItems[i].a.appendChild(d.createTextNode(menuItems[i].id));
//		}
//		else {
//			menuItems[i].img = d.createElement('img');
//			menuItems[i].img.src = rootPath + 'shw_menu/img/' + menuItems[i].id + '.png';
//			menuItems[i].a.appendChild(menuItems[i].img);
//		}
//		menuItems[i].li.appendChild(menuItems[i].a);
//		
//		if (menuItems[i].submenuItems.length > 0) {
//			menuItems[i].subMenu = d.createElement('ul');
//			menuItems[i].subItems = new Array();
//			for (var n = 0; n < menuItems[i].submenuItems.length; n++) {
//				menuItems[i].subItems[n] = {
//					li: d.createElement('li'),
//					a: d.createElement('a')
//				};
//				menuItems[i].subItems[n].a.className = 'standard';
//				var isDir = menuItems[i].submenuItems[n].search(/\/$/);
//				if(isDir !== -1) {
//					var linkText =  menuItems[i].submenuItems[n].replace(/\/$/, '');
//					menuItems[i].subItems[n].a.href = rootPath + menuItems[i].id + '/' + menuItems[i].submenuItems[n];
//					menuItems[i].subItems[n].a.appendChild(d.createTextNode(linkText));
//				} else {
//					menuItems[i].subItems[n].a.href = rootPath + menuItems[i].id + '/' + menuItems[i].submenuItems[n] + '.html';
//					menuItems[i].subItems[n].a.appendChild(d.createTextNode(menuItems[i].submenuItems[n]));
//				}
//				menuItems[i].subItems[n].li.appendChild(menuItems[i].subItems[n].a);
//				menuItems[i].subMenu.appendChild(menuItems[i].subItems[n].li);
//			}
//			menuItems[i].li.appendChild(menuItems[i].subMenu);
//		}
//		menu.appendChild(menuItems[i].li);
//	}
//	menuParent.appendChild(menu);
//	activateMenu();
//}
//var listMenu = new Object();
//function activateMenu() {
//	listMenu = new FSMenu('listMenu', true, 'display', 'block', 'none');
//	listMenu.animations[listMenu.animations.length] = FSMenu.animSwipeDown;
//	listMenu.activateMenu("listMenuRoot", null);
//	// Activation: Include the ID for your menu in here.
//	setTimeout('activePageHighlight("listMenuRoot");',1);
//}

