function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function checkStatus(){

loginstatus=getCookie('loginstatus');

if (loginstatus=="out" || window.name=="CRS - Logged Out"){window.location="https://www.copyrightregistrationservice.com/logout.shtml";}

}

function selectCountry(){

country=getCookie('location');

if(country){
country=country.toUpperCase();
document.countryform.country.value=country;}

}

homebutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Home"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com"><img border="0" src="images/home.gif" alt="Home" width="110" height="25"></a></td></tr>\n';

youraccountbutton="";

registerbutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/register/"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Register"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/register/"><img border="0" src="images/register.gif" width="110" height="25" alt="Register"></a></td></tr>\n';

verifybutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/verify/"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Verify"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/verify/"><img border="0" src="images/verify.gif" width="110" height="25" alt="Verify"></a></td></tr>\n';

retrievebutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/retrieve/"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Retrieve"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/retrieve/"><img border="0" src="images/retrieve.gif" width="110" height="25" alt="Retrieve"></a></td></tr>\n';

faqbutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/faq/"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Frequently Asked Questions"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/faq/"><img border="0" src="images/faq.gif" width="110" height="25" alt="Frequently Asked Questions"></a></td></tr>\n';

affiliatebutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/affiliates/"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Affiliate Program"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/affiliates/"><img border="0" src="images/affiliateprogram.gif" width="110" height="25" alt="Affiliate Program"></a></td></tr>\n';

contactusbutton='<tr><td width="0%"><a href="http://www.copyrightregistrationservice.com/contactus"><img border="0" src="images/buttonoff.gif" width="22" height="25" alt="Contact Us"></a></td>\n'+
'<td width="100%"><a href="http://www.copyrightregistrationservice.com/contactus"><img border="0" src="images/contactus.gif" width="110" height="25" alt="Contact Us"></a></td></tr>\n';

username=getCookie('username');
password=getCookie('password');
accountnum=getCookie('accountnum');
fixpass=getCookie('fixpass');
src=getCookie('source');

if (username && password){

login1='<font face="Arial" size="2" color="#333333"><div align="center"><table border="0" cellpadding="2" cellspacing="0" width="95%">\n';
login2='<tr><form method="post" action="https://www.copyrightregistrationservice.com/cgi-bin/logout.cgi"><td><p align=center><font face="Arial" size="2" color="#333333"><b>You are logged in</b></font>\n';
login3='</td></tr><tr><td><p align=center>\n';
login4='<input border="0" src="images/logout.gif" name="I1" type="image" width="50" height="55" alt="Log out"></td></tr>\n';
login5='</td></form></tr></table></div>\n';

youraccountbutton='<tr><form method="post" action="https://www.copyrightregistrationservice.com/cgi-bin/account.cgi">\n'+
'<input type="hidden" name="email1" value="'+username+'">\n'+
'<input type="hidden" name="checkpassword" value="'+password+'">\n'+
'<input type="hidden" name="source" value="'+src+'">\n'+
'<td width="0%"><input border="0" src="images/buttonoff.gif" name="I1" alt="Your Account" width="22" height="25" type="image"></td>\n'+
'<td width="100%"><input border="0" src="images/youraccount.gif" name="I1" alt="Your Account" width="110" height="25" type="image"></td></form></tr>\n';

registerbutton='<tr><form method="post" action="https://www.copyrightregistrationservice.com/cgi-bin/register.cgi">\n'+
'<input type="hidden" name="email1" value="'+username+'">\n'+
'<input type="hidden" name="checkpassword" value="'+password+'">\n'+
'<input type="hidden" name="source" value="'+src+'">\n'+
'<td width="0%"><input border="0" src="images/buttonoff.gif" name="I1" alt="Register" width="22" height="25" type="image"></td>\n'+
'<td width="100%"><input border="0" src="images/register.gif" name="I1" alt="Register" width="110" height="25" type="image"></td></form></tr>\n';

retrievebutton='<tr><form method="post" action="https://www.copyrightregistrationservice.com/cgi-bin/registrations/list_registrations.cgi">\n'+
'<input type="hidden" name="username" value="'+username+'">\n'+
'<input type="hidden" name="passwordpass" value="'+password+'">\n'+
'<input type="hidden" name="accountnum" value="'+accountnum+'">\n'+
'<input type="hidden" name="fixpass" value="'+fixpass+'">\n'+
'<input type="hidden" name="source" value="'+src+'">\n'+
'<td width="0%"><input border="0" src="images/buttonoff.gif" name="I1" alt="Retrieve" width="22" height="25" type="image"></td>\n'+
'<td width="100%"><input border="0" src="images/retrieve.gif" name="I1" alt="Retrieve" width="110" height="25" type="image"></td></form></tr>\n';


setTimeout("location.href='https://www.copyrightregistrationservice.com/logout.shtml';",900000);

}else{
login1='<font face="Arial" size="2" color="#333333"><div align="center"><table border="0" cellpadding="2" cellspacing="0" width="95%">\n';
login2='<tr><form method="post" action="https://www.copyrightregistrationservice.com/cgi-bin/account.cgi"><td colspan="2"><font face="Arial" size="2" color="#333333"><b>Email address:</b></font><br>\n';
login3='<input type="text" name="email1" size="18"></td></tr><tr><td><font face="Arial" size="2" color="#333333"><b>Password:</b><br><input type="password" name="checkpassword" size="9"></font></td><td valign="bottom">\n';
login4='<input border="0" src="images/login.gif" name="I1" type="image" width="48" height="22" alt="Log in"></td></tr></font><tr><td colspan="2"><font face="Arial" color="#333333" size="1">\n';
login5='<i><a href="http://www.copyrightregistrationservice.com/account/retrievedetails.shtml" target="_top">Forgotten your details?</a></i></font></td></form></tr></table></div>\n';
}


function loginbox(){

document.write(login1+login2+login3+login4+login5);

}

function navigation(){

document.write('<div align="center">\n<table border="0" cellpadding="0" cellspacing="0" width="130">\n');

navbar=homebutton+youraccountbutton+registerbutton+verifybutton+retrievebutton+faqbutton+affiliatebutton+contactusbutton;

url=location.href;

document.write(navbar);

document.write('</table></div>\n');

}

