// [_v]
var oc=new Array();
var pleaseSigninBlock;
pleaseSigninBlock = new Array();
// [_v]
function _out( fn, vl, mes ,d )
{
   var div, html = "";
   switch ( fn ) 
   {
      // [A]
      case "please_signin":

           html = "Please <a href=\""+base_domain+"/?com=signin&gourl="+base_url+"&govl="+vl+"\">Sign in</a> or <a href=\""+base_domain+"/?com=joinnow\">Register</a>, It's Free . <a class=\"pleaseSigninVQ\" href=\"#\" onClick=\"return( _out( 'please_signin',"+vl+"))\"><img src=\"/pictures/close.jpg\"></a>";

           if ( mes == 'vote' )
              html = "To vote, please <a href=\""+base_domain+"/?com=signin&gourl="+base_url+"&govl="+vl+"\">Sign in</a> or <a href=\""+base_domain+"/?com=joinnow\">Register</a>, It's Free . <a class=\"pleaseSigninVQ\" href=\"#\" onClick=\"return( _out( 'please_signin',"+vl+"))\"><img src=\"/pictures/close.jpg\"></a>";

           div = document.getElementById( 'please_signin_'+vl );
           if ( div )
           {
              _closeOpenBox(vl);
              if ( div.style.display == "none" )
              {
                 pleaseSigninBlock[vl]=vl;
                 div.style.display = "block";	
                 div.innerHTML = html;
              } 
              else 
              {
                 div.style.display = "none"; 
                 div.innerHTML = "";
              }
           }
           break;

      case "please":
           if ( div = document.getElementById( 'please_'+vl ) )
           {
              div.style.display = "block";
              div.innerHTML = mes;
           }
           break;

      case "signinform":
              div = document.getElementById( 'signin_form' );
              if ( div )
              {
                 if ( div.style.display == "none" )
                 {
                    div.style.display = "block";	
                    html = "<DIV class=\"signinform\">";
                    html = html + "<FORM method=\"post\" action=\""+base_domain+"/index.php\">";
                    html = html + "Username:&nbsp;<INPUT type=\"text\" name=\"login\" value=\"\">&nbsp;";
                    html = html + "Password:&nbsp;<INPUT type=\"password\" name=\"pass\" value=\"\">&nbsp;";
                    html = html + "<SPAN style=\"font-size:10px;\">Remember me?</SPAN>&nbsp;<INPUT checked=\"checked\" type=\"checkbox\" name=\"remember\">&nbsp;";
                    html = html + "<INPUT type=\"hidden\" name=\"com\" value=\"signin\">";
                    html = html + "<INPUT type=\"hidden\" name=\"gourl\" value=\""+base_url+"\">";
                    html = html + "<INPUT type=\"hidden\" name=\"form_key\" value=\"c7gHjdh\">";
                    html = html + "<INPUT type=\"submit\" value=\"Log In\"> <a href=\""+base_domain+"/?com=retrieve\">Forgot password?</a>";
                    html = html + "</FORM>";
                    html = html + "</DIV>";
                    div.innerHTML = html;
                 } 
                 else 
                 {
                    div.style.display = "none"; 
                    div.innerHTML = "";
                 }
              }
           break;

      case "redirect_vl":
           _re( '/?vl='+vl );
           break;

      case "addpoints":
              div = document.getElementById( 'signin_points' );
              if ( div )
              {
                 if ( div.style.display == "none" )
                 {
                    div.style.display = "block";
                    html = "<DIV class=\"signinform\">";
                    html = html + "Thanks for visiting. +"+d+"<img src=\"/pictures/signinflower.gif\" border=\"0\"> flower";
                    html = html + "</DIV>";
                    div.innerHTML = html;
                 } 
                 else 
                 {
                    div.style.display = "none"; 
                    div.innerHTML = "";
                 }
              }
           break;

      default:
   }
   return(false);
}
// [A]
function _re( l )
{
   return window.location=l
}
// [A]
function _closeOpenBox( vl )
{
   var buf=new Array();
   var i,div;
   if (!pleaseSigninBlock[vl])
   {
      for( i in pleaseSigninBlock )
      {
         div = document.getElementById( 'please_signin_'+i );
         if (( div ) && ( div.style.display == "block" ))
         {
            div.style.display = "none"; 
            div.innerHTML = "";
         }
      }
      pleaseSigninBlock=buf;
   }
   return(false);
}
