// JavaScript Document

function setSelectedTab(id)
{ 
	 var ref="tabid"+id;
	 document.getElementById(ref).className="active"; 		 
}


function getSyndicate(baseurl)
{
	window.open(baseurl+"user/view_code.php",'Jscode',"menubar=0,resizable=0,width=625,height=650,top=100,left=200");
}

	
function side_trimSpaces(stringValue) 
{
	   // Checks the first occurance of spaces and removes them
	   for(i = 0; i < stringValue.length; i++) 
	   {
		    if(stringValue.charAt(i) != " ") 
		     {			break;		}
	   }
	
	   if(i > 0) 
	   {		stringValue = stringValue.substring(i);	}
	
	   // Checks the last occurance of spaces and removes them
	   strLength = stringValue.length - 1;
	   for(i = strLength; i >= 0; i--) 
	   {
		   if(stringValue.charAt(i) != " ") 
		   {		break;		}
	   }
	
	   if(i < strLength) 
	   {		stringValue = stringValue.substring(0, i + 1);	}
	
	   // Returns the string after removing leading and trailing spaces.
	return stringValue;
}