var captchaKey; var reg_vis; String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } function show_login() { scroll(0,0); hide_registration(); hide_password_reset(); hide_email_friend(); attributes = { height: { to: 120 }, paddingTop:{ to:50} } anim = new YAHOO.util.Anim('login_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function hide_login() { attributes = { height: { to: 0 }, paddingTop:{ to:0} } anim = new YAHOO.util.Anim('login_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function show_registration() { if(reg_vis != 'true'){ scroll(0,0); hide_login(); hide_password_reset(); hide_email_friend(); generateCaptcha(); attributes = { height: { to: 210 }, paddingTop:{ to:50} } reg_vis = 'true'; anim = new YAHOO.util.Anim('registration_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } } function hide_registration() { if(reg_vis == 'true'){ removeCaptcha(); } attributes = { height: { to: 0 }, paddingTop:{ to:0} } anim = new YAHOO.util.Anim('registration_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); reg_vis = 'false' } function show_password_reset() { hide_login(); hide_registration() hide_email_friend() attributes = { height: { to: 80 }, paddingTop:{ to:50} } anim = new YAHOO.util.Anim('forgot_password_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function hide_password_reset(){ attributes = { height: {to: 0}, paddingTop:{ to:0} }; anim = new YAHOO.util.Anim('forgot_password_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function show_email_friend() { scroll(0,0); hide_login(); hide_registration() attributes = { height: { to: 370 }, paddingTop:{ to:50} } anim = new YAHOO.util.Anim('email_friend_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function hide_email_friend(){ attributes = { height: {to: 0}, paddingTop:{ to:0} }; anim = new YAHOO.util.Anim('email_friend_container', attributes, .75, YAHOO.util.Easing.easeIn); anim.animate(); } function generateCaptcha(){ var url ='/res/captcha.php?width=140&hight=20'; var AjaxObject = { handleSuccess:function(o){ // This member handles the success response // and passes the response object o to AjaxObject's // processResult member. this.processResult(o); }, handleFailure:function(o){ // Failure handler }, processResult:function(o){ xml = o.responseXML.documentElement ; captchaKey =xml.getElementsByTagName("key").item(0).firstChild.data; fileKey =xml.getElementsByTagName("file").item(0).firstChild.data; image = document.createElement("img"); image.src = "http://www.mync.com/images/captchas/"+fileKey+".jpg"; image.setAttribute("id","captcha"); createCookie('captcha',captchaKey,.5); div =document.getElementById("captcha_box"); div.innerHTML=""; }, startRequest:function() { YAHOO.util.Connect.asyncRequest('get',url, callback,null); } }; var callback = { success:AjaxObject.handleSuccess, failure:AjaxObject.handleFailure, scope: AjaxObject }; // Start the transaction. AjaxObject.startRequest(); } function removeCaptcha(){ document.getElementById("captcha_box").removeChild(document.getElementById("captcha")); } function submit_reg(){ key = readCookie('captcha'); if(document.getElementById("captcha_field").value == key){ if(FIC_checkForm(document.forms['register_member_form'])){ document.forms['register_member_form'].submit(); } }else{ alert("Please check the image and retype."); } } function fadeout(){ menu= function(type, args) { YAHOO.util.Dom.setStyle('slogan', 'display', "none"); YAHOO.util.Dom.setStyle('prehead', 'opacity', ".0"); YAHOO.util.Dom.setStyle('prehead', 'display', "block"); attributes3 = { opacity: { from: .0, to: 1}}; anim3 = new YAHOO.util.Anim('prehead', attributes3 , 1, YAHOO.util.Easing.easeOut); anim3.animate(); } attributes2 = { opacity: { from: 1, to: .0}}; anim2 = new YAHOO.util.Anim('slogan', attributes2 , 1, YAHOO.util.Easing.easeOut); anim2.onComplete.subscribe(menu); anim2.animate(); } YAHOO.util.Event.addListener("registration_btn", "click", show_registration); YAHOO.util.Event.addListener("registration_close_window", "click", hide_registration); YAHOO.util.Event.addListener("registration_login_btn", "click", show_login); YAHOO.util.Event.addListener("login_btn", "click", show_login); YAHOO.util.Event.addListener("login_close_window", "click", hide_login); YAHOO.util.Event.addListener("reg_submit", "click", submit_reg); YAHOO.util.Event.addListener("reg_submit", "click", submit_reg);