<!-- Hide script from old browsers
	
/* SYNDICATEIT JavaScript */
		
	// Init
		function InitSyndicateIt() {
			
		}
		
		
	// Expand or Contract Objects	
		function ExpandContractContentDescription(ContentID,FMode)
		{
		// Display/Hide Object	
			var FullDescription = document.getElementById('FullContentDescription_'+ContentID);
			var FullDescriptionLink = document.getElementById('ViewMore_'+ContentID);
			var TruncatedDescription = document.getElementById('TruncatedContentDescription_'+ContentID);
			var TruncatedDescriptionLink = document.getElementById('ViewLess_'+ContentID);
			
			if(FMode == "More")
			{
				FullDescription.style.display = "block";
				TruncatedDescription.style.display = "none";
				FullDescriptionLink.style.display = "none";
				TruncatedDescriptionLink.style.display = "inline";
			}
			else
			{
				FullDescription.style.display = "none";
				TruncatedDescription.style.display = "block";
				FullDescriptionLink.style.display = "inline";
				TruncatedDescriptionLink.style.display = "none";
			}
		}
		
		function ExpandContractCategoryDescription(CategoryID,FMode)
		{
		// Display/Hide Object	
			var FullDescription = document.getElementById('FullCategoryDescription_'+CategoryID);
			var FullDescriptionLink = document.getElementById('ViewMore_'+CategoryID);
			var TruncatedDescription = document.getElementById('TruncatedCategoryDescription_'+CategoryID);
			var TruncatedDescriptionLink = document.getElementById('ViewLess_'+CategoryID);
			
			if(FMode == "More")
			{
				FullDescription.style.display = "block";
				TruncatedDescription.style.display = "none";
				FullDescriptionLink.style.display = "none";
				TruncatedDescriptionLink.style.display = "inline";
			}
			else
			{
				FullDescription.style.display = "none";
				TruncatedDescription.style.display = "block";
				FullDescriptionLink.style.display = "inline";
				TruncatedDescriptionLink.style.display = "none";
			}
		}
	
	
	// Display Content Section
		function DisplayContentSection(SectionName,ContentID,ContentURL) {
			// Selected Tab
				var SelectedTab = 'Tab_' + SectionName + '_' + ContentID;
				var SelectedTabObj = document.getElementById(SelectedTab);
			// Get Tab Elements
				var Tab_Overview = 'Tab_Overview_' + ContentID;
				var TabObj_Overview = document.getElementById(Tab_Overview);
				var Tab_Description = 'Tab_Description_' + ContentID;
				var TabObj_Description = document.getElementById(Tab_Description);
				var Tab_AddToYourSite = 'Tab_AddToYourSite_' + ContentID;
				var TabObj_AddToYourSite = document.getElementById(Tab_AddToYourSite);
			// Get Other Elements
				var ContentDisplayWindow = 'ContentDisplayWindow_' + ContentID;
				var ContentDisplayWindowObj = document.getElementById(ContentDisplayWindow);
				
				var ContentOverview = 'ContentOverview_' + ContentID;
				var ContentOverviewObj = document.getElementById(ContentOverview);
				
				var ContentDescription = 'ContentDescription_' + ContentID;
				var ContentDescriptionObj = document.getElementById(ContentDescription);
				
				var AddToYourSite = 'AddToYourSite_' + ContentID;
				var AddToYourSiteObj = document.getElementById(AddToYourSite);
				
			// Reset Tabs to Normal State
				RemoveClassName(TabObj_Overview, 'Selected');
				RemoveClassName(TabObj_Description, 'Selected');
				RemoveClassName(TabObj_AddToYourSite, 'Selected');
			// Highlight Selected Tab	
				AddClassName(SelectedTabObj, 'Selected');
			// Change ContentDisplayWindow Based on Section
				if(SectionName == 'Overview'){
					// Update IFRAME Source
						/*var IFRAMEURL = ContentURL; 
						var IFRAME = 'AddToYourSite_IF_' + ContentID;
						var IFRAMEObj = document.getElementById(IFRAME);
						IFRAMEObj.src = IFRAMEURL;*/
					ContentDisplayWindowObj.style.height='auto';
					ContentDisplayWindowObj.style.minHeight='75px';
					ContentDisplayWindowObj.style.maxHeight='400px';
					
					ContentOverviewObj.style.display='block';
					ContentDescriptionObj.style.display='none';
					AddToYourSiteObj.style.display='none';
				}
				else if(SectionName == 'Description'){
					// Update IFRAME Source
						if (ContentURL) {
							var IFRAMEURL = ContentURL; 
							var IFRAME = 'FullDescription_IF_' + ContentID;
							var IFRAMEObj = document.getElementById(IFRAME);
							IFRAMEObj.style.height='380px';
							IFRAMEObj.src = IFRAMEURL;
						}
					ContentDisplayWindowObj.style.height='auto';
					ContentDisplayWindowObj.style.minHeight='75px';
					ContentDisplayWindowObj.style.maxHeight='400px';
					
					ContentOverviewObj.style.display='none';
					ContentDescriptionObj.style.display='block';
					AddToYourSiteObj.style.display='none';
					
				}
				else if (SectionName == 'AddToYourSite') {
					// Update IFRAME Source
						var IFRAMEURL = ContentURL; 
						var IFRAME = 'AddToYourSite_IF_' + ContentID;
						var IFRAMEObj = document.getElementById(IFRAME);
						IFRAMEObj.style.height='380px';
						IFRAMEObj.src = IFRAMEURL;
					
					
					ContentDisplayWindowObj.style.height='auto';
					ContentDisplayWindowObj.style.minHeight='75px';
					ContentDisplayWindowObj.style.maxHeight='400px';
					
					ContentOverviewObj.style.display='none';
					ContentDescriptionObj.style.display='none';
					AddToYourSiteObj.style.display='block';
				}
		}
		
		function resetContentDisplayWindowStyles(ContentID) {
			var ContentDisplayWindow = 'ContentDisplayWindow_' + ContentID;
			var ContentDisplayWindowObj = document.getElementById(ContentDisplayWindow);
			ContentDisplayWindowObj.style.height='75px';
		}
		
		
// AddClassName

// Description : adds a class to the class attribute of a DOM element
//    built with the understanding that there may be multiple classes

// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add

function AddClassName(objElement, strClass, blnMayAlreadyExist)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // if the new class name may already exist in list
      if ( blnMayAlreadyExist )
         {

         // get uppercase class for comparison purposes
         var strClassUpper = strClass.toUpperCase();

         // find all instances and remove them
         for ( var i = 0; i < arrList.length; i++ )
            {

            // if class found
            if ( arrList[i].toUpperCase() == strClassUpper )
               {

               // remove array item
               arrList.splice(i, 1);

               // decrement loop counter as we have adjusted the array's contents
               i--;

               }

            }

         }

      // add the new class to end of list
      arrList[arrList.length] = strClass;

      // add the new class to beginning of list
      //arrList.splice(0, 0, strClass);
      
      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   else
      {

      // assign modified class name attribute      
      objElement.className = strClass;
   
      }

   }




// RemoveClassName

// Description : removes a class from the class attribute of a DOM element
//    built with the understanding that there may be multiple classes

// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to remove

function RemoveClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // remove array item
            arrList.splice(i, 1);

            // decrement loop counter as we have adjusted the array's contents
            i--;

            }

         }

      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   // there is nothing to remove

   }		
		
	
	
	// AJAX CALL
		function UpdateSubCategories(PageRequestURL,PageRequestMethod,LoaderID) {
			if (LoaderID) {
				var LoaderObj = document.getElementById(LoaderID);
				LoaderObj.style.display = 'inline';
			}
			var PageRequest = false;
			if (window.XMLHttpRequest) {PageRequest = new XMLHttpRequest();}
			else if (window.ActiveXObject) {if (window.ActiveXObject) {try {PageRequest = new ActiveXObject("Microsoft.XMLHTTP");}catch (ErrorInfo) {return false;}}}
			else {return false;}
			if (PageRequest) {
				// Make Page Request
					PageRequest.open(PageRequestMethod,PageRequestURL,true);
				// When ready state changes...	
					PageRequest.onreadystatechange = function() {
						// Determine ReadyState/Status
							if (PageRequest.readyState == 4) {
								if (PageRequest.status == 200) {
									// NO ERORRS	
										// Set Response Var
											var Response = PageRequest.responseText;
										//UPDATE HTML
											var object = document.getElementById("SubCategoriesContent");
											object.innerHTML = Response;
								}
								else if (PageRequest.status == 404) {
									// 404 ERROR
										var object = document.getElementById("SubCategoriesContent");
										object.innerHTML = 'Error';
								}
								else {
									// OTHER ERROR
										return false;
								}
							}	else return;
					}
				// Send the request	
					PageRequest.send(null);
			}
			else {
				// 	PAGEREQUEST VAR NOT SET
					// Run action(s) when unable to make AJAX call
						return false;
			}
		}		
// End hiding script from old browsers -->
