var stop_toolbar; //=1 when to stop the d2p toolbar
var d2p_url = 'http://www.d2pass.com/';

function showLoginButton(){
        netia = getCookie('NetiA');
        if(netia){
                document.write('<a href="/logout.php" target="_parent"><img src="/img/home/btn_logout.gif" width="198" alt="$B%m%0%"%&%H$O$3$A$i(B"></a><br>');
        }
        else{
                document.write('<a href="/members/login.php" target="_parent"><img src="/img/home/btn_login.gif" width="198" alt="$B%m%0%$%s$O$3$A$i(B"></a><br>');

        }
}

function showD2PToolbar() {
  if (stop_toolbar != 1) {
        netia = getCookie('NetiA');
        ml = '';
        if(netia) {
            cForm = netia.split(":");
            check = /.+@.+\..+/;
            if (cForm[0].match(check)) {
                document.write('<div class="d2_toolbar"><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 ><TBODY><TR><TD height=23><IFRAME src="' + d2p_url + 'toolbarD2P/www.mondo64.com');
                document.write('?user_name=' + cForm[0]);
                document.write('" frameBorder=0 width="100%" scrolling=no height=23></IFRAME></TD></TR></TBODY></TABLE></div>');
            }
        } else {
		document.write('');
	}	
  }
}

function getCookie(cookieName){

      var search = cookieName + '=';
          if (document.cookie.length>0) {
            offset = document.cookie.indexOf(search)
            if (offset != -1){
              offset += search.length;
              end     = document.cookie.indexOf(';',offset)
              if(end == -1)
                end = document.cookie.length;
              return unescape(document.cookie.substring(offset,end))
            }
          }
          return null;
}

function setCookie (name, value){
    document.cookie = name + '=' + escape(value) + ";path=/;"
}

