<!--//
 /******************************
    Notice : Permission to use this script is
    restricted, unless this header remains intact.
    Copyright (c) 2008 Joppadesign
    
    Writer - Curt Arbtin
    Contact - curt@joppadesign.com
    Date Created - Aug 2008
    Use - form validation
    Requires - no other sources
 *******************************/

function next(objID)
{
	if(!objID)
	{
		return;
	}
	else
	{
		//Get element ID
		targetObj = document.getElementById(objID);

		//Load up array
		sections = new Array("start","podcasts","videocast","social","cellphone","online");

		// loop and set all except the passed ID to display None
		for(i = 0; i < sections.length; i++)
		{
			if(sections[i] != objID)
			{
				document.getElementById(sections[i]).style.display = "none";
			}
			else if(sections[i] == objID)
			{
				targetObj.style.display = "";
			}
		}
	}
}

function trimURL(trimStr)
{
	//match
	var url = /(\w+):\/\/([\w.]+)\/([\S*\/]+)\/(\S*)/;
	// get last section of url which is the image name
	var result = trimStr.match(url);
	if (result != null)
	{
		return result[4]; //returns the image name
	}
}

function maxLength(obj)
{
	var mlength = obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : ""
  
  if (obj.getAttribute && obj.value.length > mlength)
  {
  	obj.value = obj.value.substring(0, mlength)
  }
}

//-->