// shw_siteSettings.js (c)2008 SugarHill Works LLC - http://www.sugarhillworks.com
var d = document, ceibw;
//var rootPath = "";
//function getRootPath() {
//	for(var i = 2; i < rootPathNum; i++) {
//		rootPath += "../";
//	}
//	return rootPath;
//}
//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 = "AZIE FAISON";
var titleSeparator = " | ";

////// 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
//// subItems (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 /contact/index.html
//// NOTE: images are in the /img/ folder in the 'shw_menu' folder and images should be named 'id'.gif and 'id'_f2.gif - both files required - the _on.png file is for the mouse rollover event
////		See the example below and follow the pattern:
////
////menuItems[menuItems.length] = {
////	id: 'nav_main_menu',  // corresponds to #id rule in fsmenu_h.css
////	mLink: 'main menu',   // the text to be displayed in the menu (use HTML character codes)
////	mHref: 'menu.html',   // the page to link to (relative to site root)
////	subItems: ['sub item 1', 'sub item 2'],   // list submenu link texts here
////	subHrefs: ['menu.html', 'menu.html']      // list corresponding submenu pages to link to here
////};
////
////		
//
//// NOTE THAT WHEN THE MENU IS UPDATED HERE, YOU *MUST* MANUALLY UPDATE THE ZEN CART categories.php TEMPLATE FILE TO MATCH
//
//menuItems[menuItems.length] = {
//	idHref: 'bioLnk',
//	id: 'navBio',
//	mLink: 'Bio',
//	mHref: 'bio/',
//	subItems: '',
//	subHrefs: ''
//};
//
//menuItems[menuItems.length] = {
//	idHref: 'collectionsLnk',
//	id: 'navCollections',
//	mLink: 'Collections',
//	mHref: '#', 
//	subItems: ['Backstage at the Opera','Landmarks','Parks'],
//	subHrefs: ['collections/backstage_gallery','collections/landmarks_gallery','collections/parks_gallery']
//};
//
//menuItems[menuItems.length] = {
//	idHref: 'shopLnk',
//	id: 'navShop',
//	mLink: 'Shop',
//	mHref: 'shop/greeting_cards/',
//	subItems: '',
//	subHrefs: ''
//};
//
//menuItems[menuItems.length] = {
//	idHref: 'customLnk',
//	id: 'navCustom',
//	mLink: 'Custom Orders',
//	mHref: 'custom_orders',
//	subItems: '',
//	subHrefs: ''
//};
//
//menuItems[menuItems.length] = {
//	idHref: 'contactLnk',
//	id: 'navContact',
//	mLink: 'Contact',
//	mHref: 'info@nycgreetingcards.com',
//	subItems: '',
//	subHrefs: ''
//};
//
////menuItems[menuItems.length] = {
////	idHref: 'wholesaleLnk',
////	id: 'navWholesale',
////	mLink: 'Wholesale',
////	mHref: '',
////	subItems: '',
////	subHrefs: ''
////};
//
//menuItems[menuItems.length] = {
//	idHref: 'homeLnk',
//	id: 'navHome',
//	mLink: 'Home',
//	mHref: 'index.html',
//	subItems: '',
//	subHrefs: ''
//};
//
//
//
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //
//// *********************************                                        ********************************* //
//// *********************************      DO NOT EDIT BELOW THIS LINE       ********************************* //
//// *********************************                                        ********************************* //
//// ********************************************************************************************************** //
//// ********************************************************************************************************** //


var isitIE = false;
var isitIE7 = false;
var isitIE6 = false;
if (window.attachEvent && !window.opera) { //object-detect IE5+, exclude opera
	isitIE = true;
	if(navigator.appVersion.match(/MSIE 7/)) { isitIE7 = true; }
	if(navigator.appVersion.match(/MSIE 6/)) { isitIE6 = 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);
//}

// so we can dynamically add event watchers...
var addEvent = function( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener(type, fn, false);
	} else if (obj.attachEvent) {
		obj.attachEvent('on' + type, function() { return fn.apply(obj, new Array(window.event)); });
	}
}; 






var hm = true, hmn = true;
function switchLeftContent(lnk) {
	var panel = d.getElementById('splash_L');
	var ftr = d.getElementById('ftr');
	var plyr_div = d.getElementById('plyr');
	var plyr_obj = d.getElementById('plyr_obj');
	var name_div = d.getElementById('splash_N');
	//panel.innerHTML = '';
	function return_plyr() {
		plyr_div.style.visibility = 'hidden';
		plyr_div.style.left = '';
		plyr_div.style.top = '0px';
		plyr_div.style.right = '0px';
		plyr_div.style.height = '25px';
		plyr_div.style.visibility = 'visible';
		plyr_obj.height = '25';
	}
	function move_name() {
		name_div.style.visibility = "hidden";
		name_div.style.background = '#000';
		name_div.style.right = '0px';
		name_div.style.bottom = '13px';
		name_div.style.visibility = "visible";
	}
	function return_name() {
		name_div.style.visibility = "hidden";
		name_div.style.background = 'none';
		name_div.style.right = '50%';
		name_div.style.bottom = '77px';
		name_div.style.visibility = "visible";
	}
	if (lnk == 0) {
		if (hm === false) {
			return_plyr();
			hm = true;
		}
		if (hmn === false) {
			return_name();
			hmn = true;
		}
		panel.innerHTML = '<img class="splash_img" src="img/splash_left_1.gif" />';
	} else if (lnk == 1) {
		if (hm === false) {
			return_plyr();
			hm = true;
		}
		if (hmn === true) {
			move_name();
			hmn = false;
		}
		panel.innerHTML = '<img class="content_title" src="img/page_title_book.gif" /><br />' +
			'<img class="content" src="img/book_cover.jpg" style="vertical-align:top;" />' +
			'<span class="txt_title">Description from the publisher\'s <a href="http://books.simonandschuster.com/Game-Over/Azie-Faison/9780743282314" target="_new">website</a>:<br /><br /></span>' +
			'<span class="txt">A cautionary tale about the life of former kingpin Azie Faison, who has become the fabric of street legend.' +
			'<br /><br />Faison was a ninth grade dropout who earned more than $100,000 a week selling cocaine in Harlem, New York, during the peak of America\'s "War on Drugs" between 1983 and 1990. Faison, along with two partners, was an urban prince with cars, jewels, and people -- in awe of this million-dollar phenomenon -- at his feet. His legacy has been praised by hip-hop\'s top names in their lyrics, and his life was the basis for the urban cult classic film Paid in Full starring Mekhi Phifer, Wood Harris, and rapper Cam\'ron and produced by Jay-Z\'s Roc-A-Fella Films.' +
			'<br /><br />In Game Over, Azie brings forth a powerful memoir of New York\'s perilous drug underworld and music industry, with an intellect and wisdom to empower and challenge the street culture he knows so very well. ' +
			'<br style="clear:both;>"';
	} else if (lnk == 2) {
		if (hm === false) {
			return_plyr();
			hm = true;
		}
		if (hmn === true) {
			move_name();
			hmn = false;
		}
		panel.innerHTML = '<img class="content_title" src="img/page_title_clips.gif" />' +
		'<br /><br />';
		var tmp_div = d.createElement('div');
		tmp_div.id = "tmp_div";
		tmp_div.innerHTML = 'You need the Flash Player to view the clips.';
		panel.appendChild(tmp_div);
		createPlayer();
	} else if (lnk == 3) {
		panel.innerHTML = '<img class="content_title" src="img/page_title_beats.gif" />';
		plyr_div.style.visibility = 'hidden';
		plyr_div.style.left = '3px';
		plyr_div.style.top = '-465px';
		plyr_div.style.height = '253px';
		plyr_div.style.visibility = 'visible';
		plyr_obj.height = '253';
		hm = false;
		if (hmn === true) {
			move_name();
			hmn = false;
		}
	} else if (lnk == 4) {
		if (hm === false) {
			return_plyr();
			hm = true;
		}
		if (hmn === true) {
			move_name();
			hmn = false;
		}
		panel.innerHTML = '<img class="content_title" src="img/page_title_contact.gif" /><br />' +
		'<ul>' +
		'<li><a href="mailto:azgod@hotmail.com">azgod@hotmail.com</a></li>' +
		'</ul>' +
		'<img class="content_title" style="margin-top: 40px;" src="img/page_title_links.gif" /><br />' +
		'<ul>' +
		'<li><a onclick="var nwin=window.open(\'http://en.wikipedia.org/wiki/Azie_Faison\');">wikipedia article</a></li>' +
		'<li><a onclick="var nwin=window.open(\'http://www.myspace.com/azgod\');">azie on myspace</a></li>' +
		'<li><a onclick="var nwin=window.open(\'http://www.artistsonly.com/azie.htm\');">mobstyle on artistsonly.com</a>' +
		'<li><a onclick="var nwin=window.open(\'http://www.angelfire.com/nc3/kaybroadnax/\');">interview in f.e.d.s. magazine</a>' +
		


		'<li>more links coming soon</li>' +
		'</ul>';
	}	
}






var Geom = {};
//var listMenu = new Object();
// things to do onload...
addEvent(window, 'load', function() {
/*	getWinX/Y(): return the position of the window on the screen
	getInnrW/H(): return the size of the browser viewport (inner width/height) area
	getDocW/H(): return the size of the document
	getScrH(): return the position of the horizontal scrollbar
	getScrV(): return the position fo the vertical scrollbar */
//	if (window.screenLeft) { // IE and others
//		Geom.getWinX = function() { return window.screenLeft; };
//		Geom.getWinY = function() { return window.screenTop; };
//	}
//	else if (window.screenX) { // FF and others
//		Geom.getWinX = function() { return window.screenX; };
//		Geom.getWinY = function() { return window.screenY; };
//	}
	if(window.innerWidth) { // ALL browsers - except IE
		Geom.getInnrW = function() { return window.innerWidth; };
		Geom.getInnrH = function() { return window.innerHeight; };
		Geom.getScrH = function() { return window.pageXOffset; };
		Geom.getScrV = function() { return window.pageYOffset; };
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
		//These functions are for IE6 when there is a DOCTYPE
		Geom.getInnrW = function() { return document.documentElement.clientWidth; };
		Geom.getInnrH = function() { return document.documentElement.clientHeight; };
		Geom.getScrH = function() { return document.documentElement.scrollLeft; };
		Geom.getScrV = function() { return document.documentElement.scrollTop; };
	}
	else if (document.body.clientWidth) {
		//These functions are for IE4, IE5, and IE6 when there is NO DOCTYPE
		Geom.getInnrW = function() { return document.body.clientWidth; };
		Geom.getInnrH = function() { return document.body.clientHeight; };
		Geom.getScrH = function() { return document.body.scrollLeft; };
		Geom.getScrV = function() { return document.body.scrollTop; };
	}
//	// The following functions return the size of the DOCUMENT, not the window.
//	if  (document.documentElement && document.documentElement.scrollWidth) {
//		Geom.getDocW = function() { return document.documentElement.scrollWidth; };
//		Geom.getDocH = function() { return document.documentElement.scrollHeight; };
//	}
//	else if (document.body.scrollWidth) {
//		Geom.getDocW = function() { return document.body.scrollWidth; };
//		Geom.getDocH = function() { return document.body.scrollHeight; };
//	}
	ceibw = d.getElementById('ceibw');
	var ceibwT = parseInt(((Geom.getInnrH() - ceibw.offsetHeight) / 2) - 30);
	if (ceibwT < 0) { ceibwT = 0; }
	ceibw.style.top = ceibwT + 'px';
	ceibw.style.visibility = 'visible';
	//document.getElementsByTagName('title')[0].text = defaultTitle;
//	getRootPath();
//	makeMenu();
//	makeCopyFtr();
	hm = true;// for switchLeftContent()
});

addEvent(window, 'resize', function() {
	var ceibwT = parseInt(((Geom.getInnrH() - ceibw.offsetHeight) / 2)) - 30;
	if (ceibwT < 0) { ceibwT = 0; }
	ceibw.style.top = ceibwT + 'px';
});


var player;
function playerReady(obj) {
	player = document.getElementById(obj['id']);
};
function createPlayer() {
	var flashvars = {
		file: 'video/playlist.xspf.xml',
		playlist: 'bottom',
		playlistsize: '100',
		icons: 'true',
		volume: "60",
		autostart:"false",
		resize:"true",
		stretching: "uniform",
		screencolor:"#000000",
		frontcolor:"#EFEFEF",
		backcolor: "#000000",
		lightcolor:"#666666",
		javascriptid:"vid_player"
	};

	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always",
		wmode:"window",
		javascriptid:"vid_player"
	};

	var attributes = {
		id:"vid_player",  
		name:"vid_player"
	};

	swfobject.embedSWF("shw_lib/player.swf", 'tmp_div', "540", "400", "9.0.115", null, flashvars, params, attributes);
}

