ddsmoothmenu.init({
	mainmenuid: "smoothmenu-h", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

ddsmoothmenu.init({
	mainmenuid: "smoothmenu-v", //Menu DIV id
	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
	//customtheme: ["#804000", "#482400"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

function show_menu(id){
	document.getElementById(id).style.visibility = "visible";
}

var xmlhttp = createRequest();	//xmlhttp holds the ajax object
 
function ajaxFunction(url) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
    xmlhttp.open("POST","login.php",true); //calling testing.php using POST method
    //xmlhttp.onreadystatechange  = handleServerResponse;
	xmlhttp.onreadystatechange  = function handleServerResponse() {
									   if (xmlhttp.readyState == 4) {
										 if(xmlhttp.status == 200) {
										   document.getElementById("user").innerHTML=xmlhttp.responseText; //Update the HTML Form element 
										   window.location=url
										 }
										 else {
											alert("Error during AJAX call. Please try again");
										 }
									   }
									}
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send("username=" + username + "&password=" + password ); //Posting txtname to PHP File
  }
}
 
function handleServerResponse2() {
   if (xmlhttp.readyState == 4) {
     if(xmlhttp.status == 200) {
       document.getElementById("user").innerHTML=xmlhttp.responseText; //Update the HTML Form element 
	   window.location='index.php'
     }
     else {
        alert("Error during AJAX call. Please try again");
     }
   }
}

function login(url){
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
    xmlhttp.open("POST","login.php",true); //calling testing.php using POST method
    //xmlhttp.onreadystatechange  = handleServerResponse;
	xmlhttp.onreadystatechange  = function handleServerResponse() {
									   if (xmlhttp.readyState == 4) {
										 if(xmlhttp.status == 200) {
										   //document.getElementById("user").innerHTML=xmlhttp.responseText; //Update the HTML Form element 
										   window.location=url
										 }
										 else {
											alert("Error during AJAX call. Please try again");
										 }
									   }
									}
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send("username=" + username + "&password=" + password ); //Posting txtname to PHP File
  }
}
