//skin stuff

function getValue(varname)
{
  // First, we load the URL into a variable
  var url = window.location.href;

  //document.write(url);

  // Next, split the url by the ?
  var qparts = url.split("?");

  //document.write(qparts.length);
  // Check that there is a querystring, return "" if not
  if (qparts.length == 0)
  {
    document.write("no query string");
    return "";
  }

  // Then find the querystring, everything after the ?
  var query = "";
  if( qparts.length > 0 ) {
    query = qparts[1];
  }
  // Split the query string into variables (separates by &s)
  var vars = "";
  //document.write(query);
  if( query.length > 0 ) {
    vars = query.split("&");
  }
  // Initialize the value with "" as default
  var value = "";

  // Iterate through vars, checking each one for varname
  for (i=0;i<vars.length;i++)
  {
    //document.write(vars.length);
    // Split the variable by =, which splits name and value
    var parts = vars[i].split("=");
    // Check if the correct variable
    if (parts[0] == varname)
    {
      // Load value into variable
      value = parts[1];

      // End the loop
      break;
    }
  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}

var skin = "";

var skinVal = getValue("skin");
if (skinVal != null){
	skin = skinVal;
}