Hello,

I am working on hide/show login panel. it seems got stucked with my JS function. using this function showall/hideall function is necessary. besides that i want to show my user name and passwords textboxes at time not seapertly.

can anyone please guide me. how can i achieve this?
here is my js code.
Code JavaScript:
 function elemOn(elem_id){
    	if(document.getElementById(elem_id))
   document.getElementById(elem_id).style.display = "block";
    }
 
    function elemOff(elem_id){
	if(document.getElementById(elem_id))
		document.getElementById(elem_id).style.display = "none";
    }
    function hideAll(){
	for( var i = 1; i <= 4; i++ )
		elemOff( 'div'+i );
    }
 
    function showAll(){
	for( var i = 1; i <= 4; i++ )
		elemOn( 'div'+i );
    }
 
    function showOne(elem_id){
	hideAll( );
	elemOn( elem_id );
    }
and here is php code
PHP Code:
<fieldset>
<a href="javascript:showOne('div1');">Login</a>
<div class="row">
<label for="username">Username</label><input type="text" name="username" id="username" value="<?=$username;?>" title="Enter your username" size="9" class="textboxfield" />

<label for="passwd">Password</label>
<input type="password" name="passwd" id="passwd" title="Enter your Password" value="<?=$passwd;?>" size="9" class="textboxfield" onkeypress="javascript: return specChar(event); maxlength=15" />
</div>
</fieldset>
when i keep both the text boxes then this function is not working. while if i keep only one texbox its working.


thanks in advance.