

function switch_login (type)
{
	if (type == "admin")
	{
		document.getElementById('tools').innerHTML = '<form method="post" name="log_admin" id="log_admin" enctype="multipart/form-data"  action="fwd.php"> <strong>Admin Login : </strong> <input type="text" class="input-txt" name="be37AmUc" value="" /> <br/> <strong>Password : </strong> <input class="input-txt" name="5rasesPu" type="password" /> <br/> <input type="submit" value="Submit" /> </form>';
	} 
	else if (type == "client")
	{
		document.getElementById('tools').innerHTML = '<form method="post" name="log_admin" id="log_admin" enctype="multipart/form-data"  action="fwdc.php"> <strong>Login : </strong> <input type="text" class="input-txt" name="be37AmUc" value="" /> <br/> <strong>Password : </strong> <input class="input-txt" name="5rasesPu" type="password" /> <br/> <input type="submit" value="Submit" /> </form>';
	}
}


function logout (target)
{
	document.getElementById(target).innerHTML = '<img src="./img/loading.gif" alt="loading" /> loading...';
	if (window.XMLHttpRequest) { req = new XMLHttpRequest();
        req.onreadystatechange = function() {logout_done(target);};
        req.open("GET", "logout.php", true);
        req.send(null);
    } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) { req.onreadystatechange = function() {logout_done(target);};
            req.open("GET", "logout.php", true);
            req.send(); }
    }
}

function logout_done (target)
{
	if (req.readyState == 4) { if (req.status == 200) {
            results = req.responseText;
            document.getElementById(target).innerHTML = results;
        } else { document.getElementById(target).innerHTML="jah error:\n" + req.statusText; }
    }
}


