function CloseDiv()
{
  document.getElementById("Login_form").style.display="none";
  document.getElementById("Reg_float").style.display="none";
}

    function showBox(ml)
{	CloseDiv();
	var _isLogin=getCookie("userid");
    if(_isLogin==null)
    {document.getElementById("Login_form").style.display='block';}
    else
    {location=ml;}
    cs1();
}
function cs1()
{
 document.getElementById("Login_form").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("Login_form").offsetHeight)/2)+"px";
 document.getElementById("Login_form").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("Login_form").offsetWidth)/2)+"px";   
} 
function cs2()
{
 document.getElementById("Reg_float").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("Reg_float").offsetHeight)/2)+"px";
 document.getElementById("Reg_float").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("Reg_float").offsetWidth)/2)+"px";   
} 
function scall(){
 cs1();cs2();
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;

function reg_form(){
CloseDiv();
var inmsg='';
document.getElementById("reg_content").innerHTML="<H1 class=\"ilts\" style=\"padding-left:130px;\">Account Registration</H1>If registeration fails,pls email to <a href=\"mailto:service@toperfectart.com\">service@toperfectart.com</a>. Thanks!<FORM action=\"/Reg.asp?action=save\" method=\"post\"><TABLE cellSpacing=\"3\" cellPadding=\"3\" width=\"380\" border=\"0\"><TBODY><TR><TD>Member ID</TD><TD><input name=\"uid\" id=\"uid\" /></TD></TR><TR><TD>Password *<BR>(min.   5 characters)</TD><TD><INPUT type=\"password\" value=\"\" name=\"password\"></TD></TR><TR><TD>Confirm password *</TD><TD><INPUT type=\"password\" value=\"\" name=\"repassword\"></TD></TR><TR><TD width=\"190\">Title *</TD><TD width=\"190\"><SELECT name=\"title\"><OPTION selected></OPTION><OPTION>Mr</OPTION><OPTION>Mrs</OPTION><OPTION>Ms</OPTION><OPTION>Miss</OPTION><OPTION>Dr</OPTION><OPTION>Prof</OPTION><OPTION>Sir</OPTION><OPTION>Rev</OPTION></SELECT>          </TD></TR><TR><TD>First Name *</TD><TD><INPUT name=\"firstname\"></TD></TR><TR><TD>Last Name *</TD><TD><INPUT name=\"lastname\"></TD></TR><TR><TD>Country *</TD><TD><INPUT name=\"Country\"></TD></TR><TR><TD>Telephone *</TD><TD><input name=\"tel\" id=\"tel\" /></TD></TR><TR><TD>Email Address *</TD><TD><INPUT name=\"email\"></TD></TR><TR><TD align=\"middle\" colSpan=\"2\">Fields marked with * are   required</TD></TR><TR><TD>&nbsp;<INPUT type=\"hidden\" value=\"1\" name=\"jmail\"></TD><td align=\"left\"><INPUT name=\"submit\" type=\"submit\" value=\"Submit >\"></TD></TR></TBODY></TABLE></FORM>";
document.getElementById("Reg_float").style.display='block';
cs2();
}