﻿var fesco_float = function ()
{
	this.show = function(typeid)
	{
		$('float_ctl').innerHTML = this.getBaseHTML(typeid) ;
		Utility.show('fesco_float_'+typeid);
		Utility.center('fesco_float_'+typeid); 
		this.controlSelect("hidden");
	};
	this.hide = function (typeid)
	{ 
		Utility.hide('fesco_float_'+typeid);
		this.controlSelect("visible");
	}; 
 	this.getBaseHTML = function(typeid)
	{
		var html,title,body;
		if(typeid == 1)
		{
			title = "Sign Up"; 
			body = this.getRegHTML() ;
		}else if(typeid == 2)
		{
			title = "Welcome"; 
			body = this.getWelcomeHTML() ;
		}else if(typeid ==3)
  		{
  			title = 'Sign In'; 
  			body = this.getLoginHTML() ;
   		}else if(typeid == 4)
 		{
  			title = 'Modify My Account Information';
  			body = this.getEditHTML();
  		}else if(typeid == 5)
  		{
  			title = 'Upload' ;
			body = this.getUploadHTML(); 
   		}
  		html = "<div id=fesco_float_"+typeid+" style='display:none;'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src=img/layer_bg01.jpg></td></tr><tr><td style='background:url(img/layer_bg02.jpg)' align=center><table border='0' cellspacing='0' cellpadding='0' width=90%><tr><td align=left><img src=img/logo_fesco.jpg></td><td align=right><div><a href=javascript:__fesco_float.hide('"+typeid+"')><img src=img/x_close.gif alt=close></a></div><div style=height:30px;line-height:150%;margin-top:20px;><b><span><li style='font-size:22px;color:#1f68b0'>"+title+"</li></span></b></div></td></tr><tr><td colspan=2><Div style='border-bottom: #000000 1px dotted;height=1px;'></div></td></tr><tr><td colspan=2 style=padding-top:15px>"+body+"</td></tr></table></td></tr><tr><td><img src=img/layer_bg03.jpg></td></tr></table></div>";
		return html;
	};
	this.getEditHTML  = function()
	{
		var body;
		body = "<table border='0' cellspacing='0' cellpadding='0'>\
					<tr>\
						<td colspan=3 align=left><span style='font-size=14px;'></span></td>\
					</tr>\
					<tr>\
						<td Height=20 colspan=3></td>\
					</tr>\
					<tr>\
						<td Height=25 align=right><div style='margin-top:3px;'>Account ID：</div></td><td width=15></td><td align=left><div id=fesco_float_edit_username_html></div></td>\
					</tr>\
					<tr>\
						<td Height=10 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top align=right><div style='margin-top:3px;'>Nickname：</div></td><td></td><td align=left ><input type=text name=nickname id=fesco_float_edit_nickname style='width:150px;' onkeydown='if(event.keyCode==13) __fesco_validate.validateEdit();'><br><div id=fesco_float_edit_nickname_html>Maximum of 20 characters</div></td>\
					</tr>\
					<tr>\
						<td Height=5 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top align=right><div style='margin-top:3px;'>Password：</div></td><td></td><td align=left ><input type=password id=fesco_float_edit_password style='width:150px;' onkeydown='if(event.keyCode==13) __fesco_validate.validateEdit();'><br><div id=fesco_float_edit_password_html>Minimum of 6 characters</div></td>\
					</tr>\
					<tr>\
						<td Height=5 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top align=right><div style='margin-top:3px;'>Confirm Password：</div></td><td></td><td align=left ><input type=password name=confirmpass id=fesco_float_edit_confirmpass style='width:150px;' onkeydown='if(event.keyCode==13) __fesco_validate.validateEdit();'><br><div id=fesco_float_edit_confirmpass_html>Re-enter your password</div></td>\
					</tr>\
					<tr>\
						<td Height=5 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top colspan=3><img src='img/button_submit.jpg' onclick=__fesco_validate.validateEdit(); style='cursor:pointer;'></td>\
					</tr>\
					<tr>\
						<td Height=20 colspan=3></td>\
					</tr>\
				</table>";
		__fesco_login.getUsername();
		__fesco_login.getNickname();
		return body;
	};
	this.getUploadHTML  = function()
	{
		var body;
		body = "<table border='0' cellspacing='0' cellpadding='0'>\
					<iframe id=iframe_data style='display:none;' name='iframe_data'></iframe>\
					<form onSubmit='return __fesco_upload.validate(this);' method='post' action='upload.php' target='iframe_data' enctype='multipart/form-data'>\
					<tr>\
						<td colspan=3 align=left><span style='font-size=14px;'>Upload My Photo</span></td>\
					</tr>\
					<tr>\
						<td Height=40 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top Height=30><div style='margin-top:7px;'>Select Photo for Upload：</div></td><td></td><td align=left ><input type=file name=photo ></td>\
					</tr>\
					<tr>\
						<td Height=40 colspan=3></td>\
					</tr>\
					<tr>\
						<td valign=top><input type=image src='img/button_submit.jpg'></td><td></td><td align=left ></td>\
					</tr>\
					<tr>\
						<td Height=40 colspan=3></td>\
					</tr>\
					</form>\
				</table>";
		return body;
	};
	this.getLoginHTML = function()
	{ 
		var body ; 
		body = "<table border='0' cellspacing='0' cellpadding='0'>\
					<tr>\
					<td><span style='font-size:14px;'><b>Sign in with Your Account</b></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-size:14px;'><b></b></span></td>\
					</tr>\
					<tr> \
					<Td Height=40><div id='fesco_float_login_username_html'></div></td>\
					</tr> \
					<tr> \
					<Td Height=35>Account ID：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text style='width=170px' id='fesco_float_login_username' maxlength=40 onkeydown='if(event.keyCode==13) __fesco_validate.validateLogin();'></td>\
					</tr> \
					<tr> \
					<Td Height=35>Password：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=password style='width:170px' id='fesco_float_login_password' maxlength=20 onkeydown='if(event.keyCode==13) __fesco_validate.validateLogin();'></td>\
					</tr> \
					<tr> \
					<Td Height=30></td>\
					</tr> \
					<tr> \
					<Td Height=60><div style='float:left'><img src=img/button_login.jpg style='cursor:pointer;' onclick='__fesco_validate.validateLogin();'></div><div style='float:left'>&nbsp;&nbsp;No Account ID,Please click&nbsp;&nbsp;</div><div style='float:left'><a href=javascript:__fesco_float.show(1);><img src=img/button_signup.jpg ></a></div></td>\
					</tr> \
					<tr> \
					<Td Height=30></td>\
					</tr> \
				</table>";
		return body ;
	};
	this.getWelcomeHTML = function()
	{  
		var body,username;
		body = "<table border='0' cellspacing='0' cellpadding='0' width=100%>\
					<tr>\
					<td><span style='font-size:14px;'><b>welcome <span id='welcome_username'></span>,Select the following services</b></span></td>\
					</tr>\
					<tr>\
					<td height=40></td>\
					</tr>\
					<tr> \
					<Td>\
						<table border='0' cellspacing='0' cellpadding='0' >\
							<tr>\
								<td align=right style='line-height:180%;'>\
									<a href=index.php style='color:#1f68b0'>Home</a><br>\
									<a href=business.php style='color:#1f68b0'>Commercial Service</a><br>\
									<a href=auto.php style='color:#1f68b0'>Motor Vehicle Service</a><br>\
									<a href=homework.php style='color:#1f68b0'>Household Service</a><br>\
									<a href=job.php style='color:#1f68b0'>Job Seeking</a><br>\
									<A href=other.php style='color:#1f68b0'>Others</a><br>\
								</td>\
								<td width=25></td>\
								<td width=2 bgcolor='#8fb6d7'></td>\
								<td width=25></td>\
								<td style='color:#1f68b0'><div style=float:left><a href=myresume.php><img src=img/icon_resume.jpg></a></div><div style=float:left;height=60px;><br><a href=myresume.php style='color:#1f68b0'><div>Please Fill out Your Resume </div><div> to Advance Your Career</div></a></div></td>\
							</tr>\
						</table>\
					</td>\
					</tr> \
					<tr> \
					<Td Height=40></td>\
					</tr> \
				</table>";
		this.getNickname();
		return body ;
	};
	this.getRegHTML = function ()
	{ 
		var body;
		body = "<table border='0' cellspacing='0' cellpadding='0'>\
					<tr>\
						<td width=250 align=left>\
						<span style=font-size:14px;><b>Terms of Service：</b></span><br><br>\
							<div style='line-Height=150%;width:95%;height:200px;overflow-y: scroll;SCROLLBAR-BASE-COLOR:  #505f94; SCROLLBAR-ARROW-COLOR: #FFFFFF;padding-right:10px;'>\
<span class='grey'>1. To become a member of Beijing FESCO ChenGuang Labor Service Co.,Ltd Website, all you have to do is to register on our website, submit your personal resume and entrust our company to help advance your career. Having completed your personal resume, you will have opportunities to be invited by our experienced Human Resource Consultant to beacon and illuminate your career face-to-face or via phone and internet. After fully comprehend your job objectives, our Human Resource Consultant will contact you in time and recommend suitable positions to you. All you need to do is to provide your Email (register for free) and update your personal resume.<br><br>\
2.We will look for career opportunities for you with your personal resume. However, we respect your privacy and will strive to keep your personal information confidential. Your resume shall be used only within our business scope. Our clients are mainly famous global companies and state-run enterprises and institutions. As soon as there are job vacancies from these companies, we will send your resume to them as qualified candidates. Whenever you want to terminate the services by us, please inform us about it via telephone so that we can stop disclosing your resume to our clients. If you do not confirm canceling the services with us that may leads to your personal information disclosing, we shall take no responsibility for it.</br></br>\
3.After registering on our website, you shall make sure you will not post any material which is false, defamatory, inaccurate, abusive, vulgar, hateful, harassing, obscene, profane, sexually oriented, threatening, invasive of a person's privacy, adult material, or otherwise in violation of any International or Chinese Domestic Law. Please fill out a detailed profile carefully so that we can provide you better services.</br></br>\
</span>\
</div>\
						</td>\
						<td width=290 align=right valign=top>\
							<table border='0' cellspacing='0' cellpadding='0' width='95%'>\
								<form>\
								<tr>\
									<td colspan=2 style='padding-bottom:15px;font-size:14px;' align=left><b>Required Information for Your Account</b></td>\
								</tr>\
								<tr>\
									<td width='30%' align=left valign=top>Account ID：</td><td align=left><input type=text maxLength=40 name=username id=fesco_float_reg_username style='width:172px' onkeydown='if(event.keyCode==13) __fesco_validate.validateReg();'><div id=fesco_float_reg_username_html class=grey>Your valid Email address as your account ID</div></td>\
								</tr>\
								<tr>\
									<td align=left valign=top>Nickname：</td><td align=left><input type=text maxLength=20 name=nickname id=fesco_float_reg_nickname style='width:172px' onkeydown='if(event.keyCode==13) __fesco_validate.validateReg();'><div id = fesco_float_reg_nickname_html class=grey>Alphanumeric Character within 20 characters</div></td>\
								</tr>\
								<tr>\
									<td align=left valign=top>Password：</td><td align=left><input type=password  id=fesco_float_reg_password style='width:172px' maxLength=20 onkeydown='if(event.keyCode==13) __fesco_validate.validateReg();'><div id=fesco_float_reg_password_html class=grey>Minimum of 6 Characters with Alphanumeric Character</div></td>\
								</tr>\
								<tr>\
									<td align=left valign=top>Confirm Password：</td><td align=left><input type=password id=fesco_float_reg_confirmpass style='width:172px' maxLength=20 onkeydown='if(event.keyCode==13) __fesco_validate.validateReg();'><div id=fesco_float_reg_confirmpass_html class=grey>Re-enter Your Password</div></td>\
								</tr>\
								<tr>\
									<td Height=15></td>\
								</tr>\
								<tr>\
									<td align=left valign=top colspan=2><input type=Checkbox id='fesco_float_reg_checkbox'>I have read and agree to the Terms of Service.&nbsp;&nbsp;&nbsp;&nbsp;<img src=img/button_submit.jpg style='cursor:pointer;' onclick='return __fesco_validate.validateReg();'></td>\
								</tr>\
								</form>\
							</table>\
						</td>\
					</tr>\
					<tr>\
					<td Height=15></td>\
					</tr>\
				</table>";
		return body;
	};
	this.getNickname = function ()
	{
		var ajax = Ajax.Request('header.php?action=nick','GET',this.welcomeCallback);	
	}; 
	this.welcomeCallback = function(response)
	{
 		$('welcome_username')
.innerHTML =  response.responseText;
	};
	this.controlSelect = function(action)
	{ 
		var select_array ;
		select_array = document.getElementsByTagName("select");
		Utility.display(select_array,action);
  	};
}
var __fesco_float = new fesco_float();
