DAN ZEN EXPO - CODE EXHIBIT - ZEN DECK


// parameters coming in to specify where to get the data
file=(f == undefined)?"zendeck.xml":f;
zid=(z == undefined)?"zendeck":z;
sendXML = new XML("<data zid="+zid+"></data>");
myXML = new XML();
myXML.ignoreWhite;
myXML.onLoad = getInformation;
sendXML.sendAndLoad(file, myXML);

function getInformation() {
	myNodes = myXML.childNodes[0].childNodes;
	dataList = [];
	for (i in myNodes) {
		if (myNodes[i].attributes.color != undefined) {			
			_root[myNodes[i].nodeName] = "0x"+myNodes[i].attributes.color.substr(1,6);
		} else if (myNodes[i].nodeName == "card") {		
			c_list = [];
			myCard = myNodes[i].childNodes;			
			for (j in myCard) {
				if (myCard[j].nodeName != undefined) {								
					c_list.unshift(myCard[j].firstChild.nodeValue);
				}
				c_list.push(myNodes[i].attributes.extension);
			}						
			dataList[myNodes[i].attributes.id] = c_list;
		} else if (myNodes[i].nodeName != undefined) {					
			_root[myNodes[i].nodeName] = myNodes[i].firstChild.nodeValue;
		}
	}	

	c_cat_title = []; c_cat_caption = [];
	for (i in dataList) {
		c_title = dataList[i];
		} else if (myCard[j].nodeName == "caption") {
			c_caption = myCard[j].firstChild.nodeValue;
		} else if (myCard[j].nodeName == "category") {		
			cats = myCard[j].firstChild.nodeValue.split(",");
			for (k in cats) {
				cat = cats[k];
				if (!c_cat_title[cat]) {
					c_cat_title[cat] = [];
					c_cat_caption[cat] = [];
				}
				c_cat_title[cat].push(c_title+"^"+myNodes[i].attributes.id);
				c_cat_caption[cat].push(c_caption+"^"+myNodes[i].attributes.id);
			}
		}
	}
	
	
	trace (c_cat_title["Portals"].reverse());
	
	pullTitle = [[],["danzen","flashkit","joshdavis","joshdavis2","joshdavis3"],["danzen","flashkit","joshdavis","joshdavis2","joshdavis3"],[],[],[],["danzen","joshdavis"],["danzen","joshdavis"],[],["danzen"],["flashkit"],["flashkit"],[],[],[],["flashkit"],["danzen","flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["flashkit"],["flashkit"],["danzen","flashkit","joshdavis"],["joshdavis"],[],[],[],["flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["danzen","flashkit"],["danzen","flashkit"],["danzen","flashkit"],["flashkit"],["flashkit"],["danzen","flashkit"],["flashkit"],[],["danzen","flashkit"],["flashkit"],["flashkit","joshdavis"],["flashkit","joshdavis"]];
	pullName = [[],["joshdavis","joshdavis2","joshdavis3","flashkit","danzen"],["joshdavis","joshdavis2","joshdavis3","flashkit","danzen"],[],[],[],["joshdavis","danzen"],["joshdavis","danzen"],[],["danzen"],["flashkit"],["flashkit"],[],[],[],["flashkit"],["joshdavis","flashkit","danzen"],["joshdavis","flashkit","danzen"],["joshdavis","flashkit"],["joshdavis","flashkit","danzen"],["flashkit"],["flashkit"],["joshdavis","flashkit","danzen"],["joshdavis"],[],[],[],["joshdavis","flashkit"],["joshdavis","flashkit","danzen"],["flashkit","danzen"],["flashkit","danzen"],["flashkit","danzen"],["flashkit"],["flashkit"],["flashkit","danzen"],["flashkit"],[],["flashkit","danzen"],["flashkit"],["joshdavis","flashkit"],["joshdavis","flashkit"]];
	
	
	pullList = categorylist.split(",");	
	
//dataList = {danzen:["DAN ZEN","DAN ZEN","www.danzen.com","DAN ZEN<br>Dan Zen<br><a href='http://www.danzen.com'>www.danzen.com</a>\n\nCATEGORIES\nArt, Applications, Games, Motion, Interface, Scrollers, Data-driven, hitTest, _x _y, _xscale, Sound, Components, setMask, Tween, Shape Tween\n\nDESCRIPTION\nDan Zen is a mad inventor who has built a site of games, gadgets and community features.\n\nOf note are Opartica, an online op art making tool, RichDeck a data-driven card trading game: MotoGami which features various motion games, Tilator where you can collage various images, and the Pagoda menu with a moving scroll interface.\n\nINTERVIEW\nThe site has been 10 years in the making and holds a variety of HTML/CGI, DHTML, Shockwave and Flash. Flash is currently the tool of choice. \n\nThe features are created as inventive ideas come. They have a peaceful, fun focus that promotes story telling, creativity and community. About three or four features are launched a year totaling about 30-40 games.\n\nExperimental interfaces and concepts make a challenge for users with short attention spans and limited exploration skills, but if you dig deeply, there is a lot of interesting and original content here which has lead to hundreds of thousands of hours of mind expanding entertainment.\n\nPop on into the Zen Garden to get an idea of who visits Dan Zen and let us know what you think. Sign up for Telepathy to receive thoughts when there is something new at Dan Zen.\n\nINTERVIEWER\nDan Zen"],flashkit:["FLASH KIT"," MISCELLANEOUS","www.flashkit.com","FLASH KIT\nMiscellaneous\nwww.flashkit.com\n\nCATEGORIES\nPortals, Tutorials, Animation, Data-driven, Interface, Mobile, Motion, Multi-user, Physics, Scrollers, Visualization , _alpha, _x _y, _xscale, Components, hitTest, Keys, Motion Tweens, setMask, Shape Tweens, Shared bjects, Sound, startDrag, Tweens, Video\n\nDESCRIPTION\nFlash Kit is the world's largest Flash resource site. It is a one stop raw materials centre for flash creations, containing thousands of open source movies, online tutorials, help forums, sound effects and loops, and fonts.\n\n\nINTERVIEW\nWe've got 511,430 and we're growing! Flash Kit started late October in 1999. We built it because we wanted to create a resource site that as flash developers, we would find useful. We built it to create a one stop raw materials centre for flash creations, after having spent hours surfing for sounds, images and ideas, it seemed to me a great idea to collate and collect as much as we could into one place!\n\nTo undertake the site I partnered with Steve Williams from TurnAround Solutions, CEO of an Australian development house. Between us we have pushed Flash Kit to the limit, hopefully providing a valuable and useful site to the flash and multimedia community at large.\n\nIn January 2000, we became part of the internet.com network, a great sign of recognition, and its propelled the site further forward with us being able to create a host of new features, and even better, we have lots of bandwidth to use!\n\nINTERVIEWER\nDan Zen"],joshdavis:["JOSHUA DAVIS STUDIO","JOSHUA DAVIS & BRANDEN HALL","www.joshuadavis.com","JOSHUA DAVIS STUDIO\nJoshua Davis & Branden Hall\nwww.joshuadavis.com\n\nCATEGORIES\nArt, Applications, Data-driven, Interface, Motion, Scrollers, Visualization, Mobile, _alpha, _x _y, Tweens, Video\n\nDESCRIPTION\nJoshua Davis has long been considered the leading Flash Developer in the world. He is a teacher in New York and very popular speaker who has shared his work through the years.\n\nHe is interested in interfaces, the creative flow, deconstruction and generative art and has successfully introduced some of these elements to the world of big business.\n\nINTERVIEW\nWe just finished a mini-site for the Nokia N-Gage gaming phone for the upcoming title release of Worms World Party. This project incorporates a sphere-mapping navigation and a cpu vs. cpu surface world battle. Should be cool.\n\nINTERVIEWER\nDan Zen"],joshdavis2:["JOSHUA DAVIS STUDIO","JOSHUA DAVIS & BRANDEN HALL","www.joshuadavis.com","JOSHUA DAVIS STUDIO\nJoshua Davis & Branden Hall\nwww.joshuadavis.com\n\nCATEGORIES\nArt, Applications, Data-driven, Interface, Motion, Scrollers, Visualization, Mobile, _alpha, _x _y, Tweens, Video\n\nDESCRIPTION\nJoshua Davis has long been considered the leading Flash Developer in the world. He is a teacher in New York and very popular speaker who has shared his work through the years.\n\nHe is interested in interfaces, the creative flow, deconstruction and generative art and has successfully introduced some of these elements to the world of big business.\n\nINTERVIEW\nWe just finished a mini-site for the Nokia N-Gage gaming phone for the upcoming title release of Worms World Party. This project incorporates a sphere-mapping navigation and a cpu vs. cpu surface world battle. Should be cool.\n\nINTERVIEWER\nDan Zen"],joshdavis3:["JOSHUA DAVIS STUDIO","JOSHUA DAVIS & BRANDEN HALL","www.joshuadavis.com","JOSHUA DAVIS STUDIO\nJoshua Davis & Branden Hall\nwww.joshuadavis.com\n\nCATEGORIES\nArt, Applications, Data-driven, Interface, Motion, Scrollers, Visualization, Mobile, _alpha, _x _y, Tweens, Video\n\nDESCRIPTION\nJoshua Davis has long been considered the leading Flash Developer in the world. He is a teacher in New York and very popular speaker who has shared his work through the years.\n\nHe is interested in interfaces, the creative flow, deconstruction and generative art and has successfully introduced some of these elements to the world of big business.\n\nINTERVIEW\nWe just finished a mini-site for the Nokia N-Gage gaming phone for the upcoming title release of Worms World Party. This project incorporates a sphere-mapping navigation and a cpu vs. cpu surface world battle. Should be cool.\n\nINTERVIEWER\nDan Zen"]};	
	
	getPrep();
		
	so = SharedObject.getLocal("all","/"); 
	if (!so.data.id) {
		so.data.id = Math.floor(Math.random()*10000000);
	}
	_root.id = so.data.id;
	
	baseURL = u; // from params
	baseCard = c; // from params 
	order = "title";
	//pullList = ["Categories","All by Title","All by Author","---------------","Category","---------------","Art","Applications","Education","Games","Portals","Tutorials","---------------","Key Words","---------------","Animation","Data-driven","Interface","Mobile","Motion","Multi-user","Physics","Scrollers","Visualization","---------------","Flash Terms","---------------","_alpha","_x _y","_xscale","Components","hitTest","Keys","Motion Tweens","setMask","Shape Tweens","Shared Objects","Sound","startDrag","Tweens","Video"];
	for (var i=0; i<pullList.length; i++) {	
	  pull.addItem(pullList[i]); 
	}	
	pullTitle = [[],["danzen","flashkit","joshdavis","joshdavis2","joshdavis3"],["danzen","flashkit","joshdavis","joshdavis2","joshdavis3"],[],[],[],["danzen","joshdavis"],["danzen","joshdavis"],[],["danzen"],["flashkit"],["flashkit"],[],[],[],["flashkit"],["danzen","flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["flashkit"],["flashkit"],["danzen","flashkit","joshdavis"],["joshdavis"],[],[],[],["flashkit","joshdavis"],["danzen","flashkit","joshdavis"],["danzen","flashkit"],["danzen","flashkit"],["danzen","flashkit"],["flashkit"],["flashkit"],["danzen","flashkit"],["flashkit"],[],["danzen","flashkit"],["flashkit"],["flashkit","joshdavis"],["flashkit","joshdavis"]];
	pullName = [[],["joshdavis","joshdavis2","joshdavis3","flashkit","danzen"],["joshdavis","joshdavis2","joshdavis3","flashkit","danzen"],[],[],[],["joshdavis","danzen"],["joshdavis","danzen"],[],["danzen"],["flashkit"],["flashkit"],[],[],[],["flashkit"],["joshdavis","flashkit","danzen"],["joshdavis","flashkit","danzen"],["joshdavis","flashkit"],["joshdavis","flashkit","danzen"],["flashkit"],["flashkit"],["joshdavis","flashkit","danzen"],["joshdavis"],[],[],[],["joshdavis","flashkit"],["joshdavis","flashkit","danzen"],["flashkit","danzen"],["flashkit","danzen"],["flashkit","danzen"],["flashkit"],["flashkit"],["flashkit","danzen"],["flashkit"],[],["flashkit","danzen"],["flashkit"],["joshdavis","flashkit"],["joshdavis","flashkit"]];

	slo = SharedObject.getLocal("zd_"+zid, "/");
	if (slo.data.faveList != null) {
		faveList = slo.data.faveList;
	} else {
		slo.data.faveList = [];
		faveList = slo.data.faveList;
	}	
	setMenus();	
	firstCard = 0;
	if (baseCard != undefined) {
		for (i=0; i<pullTitle[1].length; i++) {
			if (pullTitle[1][i] == baseCard) {
				firstCard = i;
				break;
			}
		}
	}
	showCard(firstCard, _root.slider);
}



function getPrep() {

	logo.loadMovie(promourl);
	
	textZendeck.textColor = mediumback;
	textFaves.textColor = darktext;
	abouthelp.textColor = darktext;
	textHide.textColor = mediumback;
	textZoom.textColor = mediumback;
	textSpeed.textColor = mediumback;
	textAuto1.textColor = mediumback;
	textAuto2.textColor = mediumback;
	textLaunch.textColor = mediumtext;
	textFave.textColor = mediumtext;
	textSend.textColor = mediumtext;
	
	information.description.textColor = mediumtext;
	cardInfo.owner.textColor = mediumtext;
	cardInfo.title.textColor = mediumtext;
	help.helpTitle.textColor = mediumtext;
	about.aboutTitle.textColor = mediumtext;
	about.xText.textColor = mediumtext;
	help.xText.textColor = mediumtext;
	send.xText.textColor = mediumtext;
	
	lightback_c = new Color(lightback_mc);
	lightback_c.setRGB(lightback);
	lightback2_c = new Color(lightback2_mc);
	lightback2_c.setRGB(lightback);		
	mediumback_c = new Color(mediumback_mc);
	mediumback_c.setRGB(mediumback);
	darkback_c = new Color(darkback_mc);
	darkback_c.setRGB(darkback);
	
	helpback_c = new Color(help.helpback_mc);
	helpback_c.setRGB(mediumback);	
	aboutback_c = new Color(about.aboutback_mc);
	aboutback_c.setRGB(mediumback);		
	helpline_c = new Color(help.helpline_mc);
	helpline_c.setRGB(darkback);	
	aboutline_c = new Color(about.aboutline_mc);
	aboutline_c.setRGB(darkback);		
	
	buttonback_c = new Color(buttonback_mc);
	buttonback_c.setRGB(mediumback);	
	buttonline_c = new Color(buttonline_mc);
	buttonline_c.setRGB(darkback);			
	bottomarrows_c = new Color(bottomarrows_mc);
	bottomarrows_c.setRGB(mediumback);	
	zdlogo_c = new Color(zdlogo_mc);
	zdlogo_c.setRGB(mediumback);		
	
	pull.setStyleProperty('arrow', darkback);
	pull.setStyleProperty('textcolor', 0x4D3818);
	pull.setStyleProperty('textselected', 0x4D3818);
	pull.setStyleProperty('selection', 0xDDDDDD);	
	pull.setStyleProperty('background', 0xffffff);
	pull.setStyleProperty('selectionUnfocused', 0xDDDDDD);
	pull.setStyleProperty('scrolltrack', 0xDDDDDD);
	pull.setStyleProperty('focusrectinner', 0xDDDDDD);
	pull.setStyleProperty('face', scrollcolor);
	pull.setStyleProperty('highlight', scrollcolor);
	pull.setStyleProperty('highlight3d', scrollborder);
	pull.setStyleProperty('shadow', scrollcolor);
	pull.setStyleProperty('darkshadow', scrollborder);	
	

	help.helpText.html = true;
	help.helpText.htmlText = "<font color='#"+mediumText.substr(2,6)+"'><p><font size='10'><b>Use the menu at the right to select a site.  Just drag the icons or the scroll bar then click to select and read about a site at left.  Use the Categories pulldown to filter sites.</b></font></p><p> </p><p><font size='10'><b>Use the LAUNCH button to launch the selected site.</b></font></p><p><font size='10'><b>Use the FAVE button to add or remove the selected site to the FAVES menu.</b></font></p><p><font size='10'><b>Use the SEND button to e-mail the selected site to friends.</b></font></p><p></p><p><font size='10'><b>The lower arrows HIDE the navigation and let you ZOOM in on a card. You can drag the card when it is magnified.  The AUTO arrows on the right let you cycle through the cards automatically like a slide show.  Just click the arrow again to turn the slide show off.  The SPEED arrows lets you adjust the speed when the slide show is running.</b></font></p></font>"
	help.helpScroll.setStyleProperty('scrolltrack', mediumback);
	help.helpScroll.setStyleProperty('arrow', darkback);
	help.helpScroll.setStyleProperty('face', scrollcolor);
	help.helpScroll.setStyleProperty('highlight', scrollcolor);
	help.helpScroll.setStyleProperty('highlight3d', scrollborder);
	help.helpScroll.setStyleProperty('shadow', scrollcolor);
	help.helpScroll.setStyleProperty('darkshadow', scrollborder);	
	
	about.aboutText.html = true;
	about.aboutText.htmlText = "<font color='#"+mediumText.substr(2,6)+"'><b>"+abouttext+"</b></font>";
	about.aboutScroll.setStyleProperty('scrolltrack', mediumback);
	about.aboutScroll.setStyleProperty('arrow', darkback);
	about.aboutScroll.setStyleProperty('face', scrollcolor);	
	about.aboutScroll.setStyleProperty('highlight', scrollcolor);
	about.aboutScroll.setStyleProperty('highlight3d', scrollborder);
	about.aboutScroll.setStyleProperty('shadow', scrollcolor);
	about.aboutScroll.setStyleProperty('darkshadow', scrollborder);	

	information.description.html = true;
	information.informationScroll.setStyleProperty('scrolltrack', mediumback);
	information.informationScroll.setStyleProperty('arrow', darkback);
	information.informationScroll.setStyleProperty('face', scrollcolor);
	information.informationScroll.setStyleProperty('highlight', scrollcolor);
	information.informationScroll.setStyleProperty('highlight3d', scrollborder);
	information.informationScroll.setStyleProperty('shadow', scrollcolor);
	information.informationScroll.setStyleProperty('darkshadow', scrollborder);
		
	
}



function setMenus(skip) {
	if (skip != true) {
		param = new Object();
		param.sl_onClick = "showCard";
		param.sl_number = 0;
		param.sl_path = "cards/";
		param.sl_spacing = 12;
		param.sl_marginY = 10;
		param.sl_marginX = 14;
		param.sl_barcolor = barcolor.substr(2,6);
		param.sl_barheight = 10;
		param.sl_color = lightback.substr(2,6);
		param.sl_height = 341;
		param.sl_width = 93;
		param.sl_list = pullTitle[2];
		attachMovie("iconomizer", "slider", 2, param);
		slider._x = 571;
		slider._y = 50;
	}
	param2 = new Object();
	param2.sl_onClick = "showCard";
	param2.sl_number = 0;
	param2.sl_path = "cards/";
	param2.sl_spacing = 12;
	param2.sl_marginY = 10;
	param2.sl_marginX = 14;
	param2.sl_barcolor = barcolor.substr(2,6);
	param2.sl_barheight = 10;
	param2.sl_color = lightback.substr(2,6);
	param2.sl_height = 316;
	param2.sl_width = 93;
	param2.sl_list = faveList;
	attachMovie("iconomizer", "slider2", 5, param2);
	slider2._x = 665;
	slider2._y = 75;
}

function showCard(n, scope) {
	cardName = scope.getList()[n];	
	card._visible = 0;	
	c = "cards/"+cardName+"."+dataList[cardname][4];
	card.loadMovie(c);
	card2.loadMovie(c);
	ca = setInterval(makeCard, 40);
}

function makeCard() {	
	if (card._width<2) {
		return;
		trace("loading");
	}
	info = information.description;
	info.htmlText = "<font color='#"+mediumText.substr(2,6)+"'><b>"+dataList[cardName][3].toString()+"</b></font>";
	info.scroll = 1;
	cardInfo.owner.text = captionPrefix + dataList[cardName][1].toString();
	cardInfo.title.text = titlePrefix + dataList[cardName][0].toString();
	card._x = cardX-card._width/2;
	card._y = cardY-card._height/2;
	updateAfterEvent();
	card._visible = 1;
	card.tabChildren = 0;
	card.tabEnabled = 0;
	clearInterval(ca);
	if (zc > 0) {
		card.onPress = function() {
			if (_root.zc>0) {
				card.startDrag();
			}
		};
		card.onMouseUp = function() {
			card.stopDrag();
			cardX = card._x+card._width/2;
			cardY = card._y+card._height/2;
		};				
	}
}


////////////////////////////////////////////////////////
//  onLoad
////////////////////////////////////////////////////////


onLoad = function () {

	// for sending
	mySend = new LoadVars();
	afterSend = new LoadVars();
	afterSend.onLoad = send2;

	// general
	card._xscale = card._yscale = 60;
	currentcard = 0;
	zc = 0;	
	error.duplicateMovieClip("error_2", 606);
	error.swapDepths(error_2);
	error._visible = error_2._visible=0;
	error._x = error._y=0;	
	contentX = 200;
	contentY = 19;
	contentWidth = 370;
	cardStartX = cardX=contentX+contentWidth/2;
	cardStartY = cardY=contentY+contentWidth/2;
	card._visible = 0;
	send.duplicateMovieClip("send_2", 502);
	send.swapDepths(send_2);
	send._visible = 0;
	send._y = 0;
	help.duplicateMovieClip("help_2", 600);
	help.swapDepths(help_2);
	about.duplicateMovieClip("about_2", 601);
	about.swapDepths(about_2);
	shield.duplicateMovieClip("shield_2", 605);
	shield.swapDepths(shield_2);
	about._visible = about_2._visible=0;
	help._visible = help_2._visible=0;
	shield._visible = shield_2._visible=0;
	about._x = help._x=475;
	about._y = help._y=83.5;
	slidespeed = 5;
};





////////////////////////////////////////////////////////
//  Pulldown functions
////////////////////////////////////////////////////////

function doSelection() {
	f = setInterval(loseFocus, 10);
}
function loseFocus() {
	
	clearInterval(f);
	no = pull.getSelectedIndex();
	pullValue = pullList[no];
	if (pullValue == "All by Title") {
		order="title";
	} else if (pullValue == "All by Author") {
		order="author";	
	}
	if (no<1) {
		slider.setList((order=="title")?pullTitle[2]:pullName[2], 0);
	} else if (pullValue == "Categories" || pullValue == "Category" || pullValue == "Key Words" || pullValue == "Flash Terms" || pullValue == "---------------") {
		// does not seem to work - what do you know
		pull.selectedIndex = 1;
	} else {		
	trace (order);
		slider.setList((order=="title")?pullTitle[no]:pullName[no], 0);			
	}
	Selection.setFocus("dummy");
}




////////////////////////////////////////////////////////
//  Launch, Fave and Send Buttons
////////////////////////////////////////////////////////

btn_launch.onRollOver = function() {
	textLaunch.textColor=darktext;
}
btn_launch.onRollOut = btn_launch.onReleaseOutside = function() {
	textLaunch.textColor=mediumtext;
}
btn_fave.onRollOver = function() {
	textFave.textColor=darktext;
}
btn_fave.onRollOut = btn_fave.onReleaseOutside = function() {
	textFave.textColor=mediumtext;
}
btn_send.onRollOver = function() {
	textSend.textColor=darktext;
}
btn_send.onRollOut = btn_send.onReleaseOutside = function() {
	textSend.textColor=mediumtext;
}


btn_Launch.onRelease = function() {
	getURL("JavaScript:pop('"+dataList[cardName][2]+"');");
}

btn_Fave.onRelease = function() {
	faveCheck = 0;
	newFave = [];
	for (i in faveList) {
		if (cardName == faveList[i]) {
			faveCheck = 1;					
		} else {
			newFave.push(faveList[i]);
		}
	}
	if (faveCheck == 0) {
		newFave.push(cardName);
	}
	slo.data.faveList = faveList = newFave;
	
	setMenus(true);	// true causes function to skip setting first menu
}



send.btn_send.onRelease = function() {
	if (checkdouble()) {return;}
	for (i=1; i<=8; i++) {
		mySend["email"+i] = send["email"+i].text;
	}
	mySend.user = id;
	mySend.card = cardName;	
	mySend.title = dataList[cardName][0];
	mySend.author = dataList[cardName][1];
	// this would come from JavaScript reading 1. page location and 2. search string
	mySend.url = baseURL;
	// make sure that the JavaScript that writes the plugin call allows danzen data
	mySend.sendAndLoad("http://www.danzen.com/flashdeck/send.php", afterSend, "POST");
};
function send2() {
	if (aftersend.num == 1) {
		added = "letter was";
		added2 = "friend";
	} else {
		added = "letters were";
		added2 = "friends";
	}
	mymess = aftersend.num+" "+added+" sent.  The "+added2+" will recieve an invite to the current site!";
	errorbox(mymess);
	unhidecard();
	send._visible = 0;
}
btn_send.onRelease = function() {
	
	hidecard();
	send._visible = 1;
	send.email1.tabIndex = 20;
	send.email2.tabIndex = 21;
	send.email3.tabIndex = 22;
	send.email4.tabIndex = 23;
	send.email5.tabIndex = 24;
	send.email6.tabIndex = 25;
	send.email7.tabIndex = 26;
	send.email8.tabIndex = 27;	
	send.btn_send.tabIndex = 28;
};


send.btn_off.onRelease = send.closeme.onRelease=function () {
	unhidecard();
	send._visible = 0;
};










////////////////////////////////////////////////////////
//  About and Help buttons
////////////////////////////////////////////////////////

btnAbout.onRelease = function() {
	pull._visible = 0;
	shield._visible = 1;
	about._visible = 1;
	help._visible = 0;
	about.aboutText.tabIndex = 10;
	
};
about.btnAboutClose.onRelease = function() {
	pull._visible = 1;
	about._visible = 0;
	shield._visible = 0;
};

btnHelp.onRelease = function() {
	pull._visible = 0;
	shield._visible = 1;
	help._visible = 1;
	about._visible = 0;
	about.aboutText.tabIndex = 10;
};
help.btnHelpClose.onRelease = function() {
	pull._visible = 1;
	help._visible = 0;
	shield._visible = 0;
};
shield.onRelease = function() {
	pull._visible = 1;
	help._visible = 0;
	about._visible = 0;
	shield._visible = 0;
};











////////////////////////////////////////////////////////
//  Universal Zen Deck Lower Functions
////////////////////////////////////////////////////////

btnZoom0.onRelease = function() {
	zoom(0);
};
btnZoom1.onRelease = function() {
	zoom(1);
};
function zoom(w) {
	if (w == 0) {
		zc = zc-1;
		//ensure that card does not go offstage when shrinking		
		cardX = cardX+(cardStartX-cardX)/2;
		cardY = cardY+(cardStartY-cardY)/2;
		if (zc<=0) {
			zc = 0;
			cardX = cardStartX;
			cardY = cardStartY;
			zoomCheck = false;
			delete card.onPress;	
			delete card.onMouseUp;				}		
	} else {
		card.onPress = function() {
			if (_root.zc>0) {
				card.startDrag();
			}
		};
		card.onMouseUp = function() {
			card.stopDrag();
			cardX = card._x+card._width/2;
			cardY = card._y+card._height/2;
		};							
		zc = zc+1;
		if (zc>10) {
			zc = 10;
			return;
		}
	}
	card._xscale = (1+(zc*zc)/6)*100 *.6;
	card._yscale = (1+(zc*zc)/6)*100 *.6;
	card._x = cardX-card._width/2;
	card._y = cardY-card._height/2;
	setCardInfo(zc);
}

function setCardInfo(t) {
	if (t == 0) {
		cardInfo._visible = 1;
	} else {
		cardInfo._visible = 0;
	}
}

btnSpeed.onRelease = function() {
	slidespeed++;
	if (slidespeed>30) {
		slidespeed = 30;
	}
	resetSlide();
};
btnSpeed2.onRelease = function() {
	slidespeed--;
	if (slidespeed<=0) {
		slidespeed = 1;
	}
	resetSlide();
};
function resetSlide() {
	if (btnPlay_2._x>0) {
		clearInterval(slidePlay);
		slidePlay = setInterval(playSlide, slidespeed*1000);
	} else if (btnReverse_2._x>0) {
		clearInterval(slideReverse);
		slideReverse = setInterval(reverseSlide, slidespeed*1000);
	} else if (btnPlay2_2._x>0) {
		clearInterval(slidePlay2);
		slidePlay2 = setInterval(playSlide2, slidespeed*1000);
	} else if (btnReverse2_2._x>0) {
		clearInterval(slideReverse2);
		slideReverse2 = setInterval(reverseSlide2, slidespeed*1000);
	}
}
function sliderPlayOff() {
	clearInterval(slidePlay);
	btnPlay._x = 645.2;
	btnPlay_2._x = -2000;
	clearInterval(slideReverse);
	btnReverse._x = 590.2;
	btnReverse_2._x = -2000;
}
function slider2PlayOff() {
	clearInterval(slidePlay2);
	btnPlay2._x = 743.2;
	btnPlay2_2._x = -2000;
	clearInterval(slideReverse2);
	btnReverse2._x = 688.2;
	btnReverse2_2._x = -2000;
}
//Play2 Forwards
function playSlide2() {
	currentcard2++;
	ppp = slider2.getlist();
	if (currentcard2>ppp.length-1) {
		currentcard2 = 0;
	}
	showCard(currentcard2, _root.slider2);
	slider2.setNumber(currentcard2);
	currentcard = rd_lookup[ppp[currentcard2]];
}
btnPlay2.onRelease = function() {
	ppp = slider2.getlist();
	//[chemist, bat, foot]
	if (ppp.length<1) {
		return;
	}
	twocheck = 0;
	for (currentcard2=0; currentcard2<ppp.length; currentcard2++) {
		if (rd_lookup[ppp[currentcard2]] == currentcard) {
			twocheck = 1;
			break;
		}
	}
	if (twocheck == 0) {
		currentcard2 = 0;
	}
	playSlide2();
	// everytime you click it goes one next
	slidePlay2 = setInterval(playSlide2, slidespeed*1000);
	btnPlay2_2._x = 743.2;
	btnPlay2._x = -2000;
	clearInterval(slideReverse2);
	btnReverse2._x = 688.2;
	btnReverse2_2._x = -2000;
	sliderPlayOff();
};
btnPlay2_2.onRelease = function() {
	//highlight off
	clearInterval(slidePlay2);
	btnPlay2._x = 743.2;
	btnPlay2_2._x = -2000;
};
//Play2 Backwards
function reverseSlide2() {
	currentcard2--;
	if (currentcard2<0) {
		currentcard2 = slider2.getlist().length-1;
	}
	showCard(currentcard2, _root.slider2);
	slider2.setNumber(currentcard2);
	currentcard = rd_lookup[ppp[currentcard2]];
}
btnReverse2.onRelease = function() {
	ppp = slider2.getlist();
	if (ppp.length<1) {
		return;
	}
	twocheck = 0;
	for (currentcard2=0; currentcard2<ppp.length; currentcard2++) {
		if (rd_lookup[ppp[currentcard2]] == currentcard) {
			twocheck = 1;
			break;
		}
	}
	if (twocheck == 0) {
		currentcard2 = 0;
	}
	reverseSlide2();
	// everytime you click it goes one next
	slideReverse2 = setInterval(reverseSlide2, slidespeed*1000);
	btnReverse2_2._x = 688.2;
	btnReverse2._x = -2000;
	clearInterval(slidePlay2);
	btnPlay2._x = 743.2;
	btnPlay2_2._x = -2000;
	sliderPlayOff();
};
btnReverse2_2.onRelease = function() {
	//highlight off
	clearInterval(slideReverse2);
	btnReverse2._x = 688.2;
	btnReverse2_2._x = -2000;
};
//Play Forwards
function playSlide() {
	currentcard2++;
	ppp = slider.getlist();
	if (currentcard2>ppp.length-1) {
		currentcard2 = 0;
	}
	showCard(currentcard2, _root.slider);
	slider.setNumber(currentcard2);
	currentcard = rd_lookup[ppp[currentcard2]];
}
btnPlay.onRelease = function() {
	ppp = slider.getlist();
	//[chemist, bat, foot]
	if (ppp.length<1) {
		return;
	}
	twocheck = 0;
	for (currentcard2=0; currentcard2<ppp.length; currentcard2++) {
		if (rd_lookup[ppp[currentcard2]] == currentcard) {
			twocheck = 1;
			break;
		}
	}
	if (twocheck == 0) {
		currentcard2 = 0;
	}
	playSlide();
	// everytime you click it goes one next
	slidePlay = setInterval(playSlide, slidespeed*1000);
	btnPlay_2._x = 645.2;
	btnPlay._x = -2000;
	clearInterval(slideReverse);
	btnReverse._x = 590.2;
	btnReverse_2._x = -2000;
	slider2PlayOff();
};
btnPlay_2.onRelease = function() {
	//highlight off
	clearInterval(slidePlay);
	btnPlay._x = 645.2;
	btnPlay_2._x = -2000;
};
//Play Backwards
function reverseSlide() {
	currentcard2--;
	if (currentcard2<0) {
		currentcard2 = slider.getlist().length-1;
	}
	showCard(currentcard2, _root.slider);
	slider.setNumber(currentcard2);
	currentcard = rd_lookup[ppp[currentcard2]];
}
btnReverse.onRelease = function() {
	ppp = slider.getlist();
	if (ppp.length<1) {
		return;
	}
	twocheck = 0;
	for (currentcard2=0; currentcard2<ppp.length; currentcard2++) {
		if (rd_lookup[ppp[currentcard2]] == currentcard) {
			twocheck = 1;
			break;
		}
	}
	if (twocheck == 0) {
		currentcard2 = 0;
	}
	reverseSlide();
	// everytime you click it goes one next
	slideReverse = setInterval(reverseSlide, slidespeed*1000);
	btnReverse_2._x = 590.2;
	btnReverse._x = -2000;
	clearInterval(slidePlay);
	btnPlay._x = 645.2;
	btnPlay_2._x = -2000;
	slider2PlayOff();
};
btnReverse_2.onRelease = function() {
	//highlight off
	clearInterval(slideReverse);
	btnReverse._x = 590.2;
	btnReverse_2._x = -2000;
};
//madeline was here
btnBlowup.onRelease = function() {
	if (btnBlowup2_2._x>0) {
		blowup._x = 379.7; //380.7;
		blowup._width = 756.2; //758.2;
		slider._visible = 0;
		slider2._visible = 0;
	} else {
		blowup._x = 286;
		blowup._width = 567.4;
		slider._visible = 1;
		slider2._visible = 1;
	}
	btnBlowup_2._x = 249;
	btnBlowup._x = -2000;
	
};
btnBlowup2.onRelease = function() {
	if (btnBlowup_2._x>0) {
		blowup._x = 379.7; // 380.7;
		blowup._width = 756.2; // 758.2;
		slider._visible = 0;
		slider2._visible = 0;
	} else {
		blowup._x = 477.9; // 478.9;
		blowup._width = 560.4; // 562.4;
		slider._visible = 0;
		slider2._visible = 0;
	}
	btnBlowup2_2._x = 303;
	btnBlowup2._x = -2000;
};
btnBlowup_2.onRelease = function() {
	slider._visible = 1;
	slider2._visible = 1;
	if (btnBlowup2_2._x>0) {
		blowup._x = 477.9; //478.9;
		blowup._width = 560.4; // 562.4;
		slider._visible = 0;
		slider2._visible = 0;
	} else {
		blowup._x = 383.8;
		blowup._width = 372; // 372;
		slider._visible = 1;
		slider2._visible = 1;
	}
	btnBlowup._x = 249;
	btnBlowup_2._x = -2000;	
};
btnBlowup2_2.onRelease = function() {
	slider._visible = 1;
	slider2._visible = 1;
	if (btnBlowup_2._x>0) {
		blowup._x = 286;
		blowup._width = 567.4;
		slider._visible = 1;
		slider2._visible = 1;
	} else {
		blowup._x = 383.8;
		blowup._width = 372;
		slider._visible = 1;
		slider2._visible = 1;
	}
	btnBlowup2._x = 303;
	btnBlowup2_2._x = -2000;
};


function checkDouble() {
	if (doublecheck == 1) {return 1;}
	doublecheck = 1;
	doublestop = setInterval(doublePrevent,500);
	return 0;
}
function doubleprevent() {
	doublecheck = 0;
	clearInterval(doublestop)
}

function hidecard() {
	card._visible = 0;
	cardinfo.owner._visible = 0;
}
function unhidecard() {
	card._visible = 1;
	cardinfo.owner._visible = 1;
}

function errorbox(m) {
	error.error.text = m;
	error._visible = 1;
}