//	XSURLS//  Designed by Injection//  www.injectiondesign.com// Array of modules with default active statusvar Modules=new Array(4);Modules[0]=1; // VisibleModules[1]=0; // InvisibleModules[2]=0; // InvisibleModules[3]=0; // Invisible// Array of titles for modulesvar ModuleNames=new Array(4);ModuleNames[0]='First URL';ModuleNames[1]='Second URL';ModuleNames[2]='Third URL';ModuleNames[3]='Fourth URL';var arLen = Modules.length; // This variable calculates the number of modules.var ActiveCount = 1; // Default # of active modules (non hidden) = 1. function updateModuleNames() // Rewrites the titles of the modules after an action has been performed. Useful if the user hides a module that isn't the last module.{		ActiveCount = 0;	for (var i = 0; i < arLen ; ++i)	{		if (Modules[i] == 1)		{						var titleID = 'title_' + ++i;			i--;			document.getElementById(titleID).innerHTML = ModuleNames[ActiveCount];			ActiveCount++;		}	}}function updateNumLeft() // Updates the number left inside the "Add Another URL" box {	NumLeft = arLen - ActiveCount;	document.getElementById('numleft').innerHTML = NumLeft;}function toggleAddUrlBox() // Turns on or off the Add Url Box depending on if there are any URLs left to add or not.{	if (ActiveCount == 4)	{		document.getElementById('addModuleModule').style.display = 'none';	}	else	{		document.getElementById('addModuleModule').style.display = 'block';	}}function toggleModule(nModule) // Toggles a module between its hidden and unhidden state.{	var moduleID = 'module_' + nModule; // not for animation	var moduleClass = document.getElementById(moduleID).className;		// Case: Module is hidden, so show it	if (moduleClass == 'singlemodule-holder hide')	{		document.getElementById(moduleID).className = 'singlemodule-holder';		Modules[--nModule] = 1;		updateModuleNames();		updateNumLeft();		toggleAddUrlBox();				var titleID = 'title_' + ActiveCount;		var moduleContainer = 'modcont_' + ActiveCount;		var patiLinkContainer = 'patlink_' + ActiveCount;				// Bounce Out sides of container		var animParams = { width: {by: 20}}; 		var xsAnim = new YAHOO.util.Anim(moduleContainer, animParams, 0.11 , YAHOO.util.Easing.easeOut);		xsAnim.animate();				// Bounce and fade in the side box with the arrow.		var animParams = { right: { from: 20, to: 0 } };		var xsAnim = new YAHOO.util.Anim(patiLinkContainer, animParams, 0.20 , YAHOO.util.Easing.easeOut);		xsAnim.animate();				// Slowly fade in the title of the box		var animParams = { opacity: { from: 0, to: 1 } };		var xsAnim = new YAHOO.util.Anim(titleID, animParams, 1.5 , YAHOO.util.Easing.easeOut);		xsAnim.animate();				function returnAnim(id) 		{			// Bounce In the sides of the container			var animParams = { width: {by: -20}}; 			var xsAnim = new YAHOO.util.Anim(id, animParams, 0.11 , YAHOO.util.Easing.easeBackIn);			xsAnim.animate();		}				setTimeout(function(){returnAnim(moduleContainer);}, 110);			}	// Case: Module is visible, so hide it	else	{		document.getElementById(moduleID).className = 'singlemodule-holder hide';		Modules[--nModule] = 0;		updateModuleNames();		updateNumLeft();		toggleAddUrlBox();	}}function toggleNote(nModule) // Toggles the note box between its hidden and unhidden state.{	var noteID = 'note_' + nModule;	var noteButtonID = 'anb_' + nModule;		var noteClass = document.getElementById(noteID).className;		// Case: note is hidden, so show it	if (noteClass == 'note hide')	{		document.getElementById(noteButtonID).innerHTML = 'discard';		document.getElementById(noteID).className = 'note';	}	// Case: note is visible, so hide it	else	{		document.getElementById(noteButtonID).innerHTML = 'add note';		document.getElementById(noteID).className = 'note hide';	}}function addModule() // Adds a new module to the set{	for (var i = 0; i < arLen ; ++i)	{		if (Modules[i] == 0)		{			toggleModule(++i);			break;		}	}}
