//Redundant module - Replaced with 'webcraft.com.au/scripts/website.js. 

function GetNameValue( Name ){

  var QueryString = "";
  QueryString = document.location.href;                                  //QueryString is the entire URL.
  
  //alert( QueryString );
  
  var Pos = QueryString.indexOf( "?", 0 );
  
  if( Pos > -1 ){
  
    var IsFound = false;
  
    var FileName = QueryString.substring( Pos, QueryString.length );   //Rename! FileName is just the query beginning with the '?'.

    //alert( FileName );
    
    var StrName = Name + "=";
    var Pos1 = FileName.indexOf( StrName, 0 );
    var Pos2 = FileName.indexOf( "&", Pos1 );    
    
    if( Pos1 > -1 ){ 
    
      //alert( StrName );
      
      var FirstChar = FileName.substring( Pos1-1, Pos1 ); 
    
      if( FirstChar == "?" || FirstChar == "&" ){         //Is it entire?
        if( Pos2 == -1 ) Pos2 = FileName.length;    //In case of last item.

        var Value = "";        

        if( Pos2  > Pos1 ){
          Value = FileName.substring( Pos1+StrName.length, Pos2 );
          
          //Get rid of the "%20" space from the URL          
          Value = StripTextFormat( Value );  
          
          return Value;
        }        
      }  
    }    
  } 
  return "";   
}

function StripTextFormat( String ){
  
    var Pos = 0;
  
    while( String.indexOf( "%20" ) > 0 ){
    
      Pos = String.indexOf( "%20" );        //We don't want this format. 
      var String_1 = String.substring( 0, Pos );
      var String_2 = String.substring( Pos + 3, String.length );
      String = String_1 + " " + String_2;   //We want a space instead !
    }
  
    return String;
}
