function change_class(target_item, new_class) {
   //alert(target);
   target_item.className=new_class;
} 

function parse_nav_click(clicked_on){
	clicked_on=clicked_on.toLowerCase().split("_").pop();
	//alert(clicked_on)
	switch(clicked_on){
		case "home":
		location.href="index.php"
		break;
		case "projects":
		location.href="projects.php"
		break;
		case "photos":
		location.href="photos.php"
		break;
		case "music":
		location.href="music.php"
		break;
		case "text":
		location.href="text.php"
		break;
		case "administrate":
		location.href="administrate.php"
		break;
		case "logout":
		location.href="logout.php"
		break;
	}
	//location.href="http://www.all-BI.com";
}


function nav_to (target, args) {
  var posting_form = document.createElement("form");
  posting_form.method="post" ;
  //alert ('target: ' + target)
  posting_form.action = target;
  for (var nona in args) {
    alert(nona + "=" + args[nona]);
	var myInput = document.createElement("input") ;
    myInput.setAttribute("name", nona) ;
    myInput.setAttribute("value", args[nona]);
    posting_form.appendChild(myInput) ;
  }
  document.body.appendChild(posting_form) ;
  posting_form.submit() ;
  document.body.removeChild(posting_form) ;
}

function make_new_form(){
	 var submitForm = document.createElement("FORM");
	 document.body.appendChild(submitForm);
	 submitForm.method = "POST";
	 return submitForm;
}

//helper function to add elements to the form 
function make_new_form_element(inputForm, elementName, elementValue){ 
	var newElement = document.createElement("input"); 
	newElement.name = elementName; 
	newElement.type = 'hidden'; 
	newElement.value = elementValue;
	inputForm.appendChild(newElement); 
	//return newElement; 
} 