function GetCookie( name ) { var start = document.cookie.indexOf(" " + name + "="); var len = start+name.length+2; if ( start == -1 ) { start = document.cookie.indexOf(name + "="); if (start != 0) return null; len = start+name.length+1; } var end = document.cookie.indexOf( ";", len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring(len,end) ); } function getElementById(id) { if (document.getElementById && document.getElementById(id)) return document.getElementById(id); else if (document.id) return document.id; else if (document.all) return document.all.id; else return null; } function FillName() { var username = GetCookie('username'); var f_username = GetCookie('f_username'); var password = GetCookie('password'); var f_password = GetCookie('f_password'); var logindiv = getElementById('login'); var html1 = ''; var html2 = ''; if (username && password) { html1 += "
Welcome, " + username + "
Manage Account
Post Project
Logout
"; if (f_username && f_password) { }else{ html1 += "
Login as Programmer...
"; } } if (f_username && f_password) { html2 += "
Welcome, " + f_username + "
Manage Account
View Projects
Logout
"; if (username && password) { }else{ html2 += "
Login as Webmaster...
"; } } if (html1 || html2) { } else { if (username) uname = username; else if (f_username) uname = f_username; else uname = ''; html1 += "
" + "" + " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ "
Login:
Password:
 "+ " "+ " remember me
"; html2 += ""+ ""+ ""+ "" + "
Forgot password? "+ "
Signup As Freelancer
"+ "Signup As Webmaster
"; } if (html1) { }else{ html1 = html2; html2 = ''; } logindiv.innerHTML = "
"+html1+" "+html2+"
"; }