function get_page_size()
{var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;}
function get_page_scroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
arrayPageScroll=new Array('',yScroll)
return arrayPageScroll;}
function grayscale(image,bPlaceImage)
{var myCanvas=document.createElement("canvas");var myCanvasContext=myCanvas.getContext("2d");var imgWidth=image.width;var imgHeight=image.height;myCanvas.width=imgWidth;myCanvas.height=imgHeight;myCanvasContext.drawImage(image,0,0);var imageData=myCanvasContext.getImageData(0,0,imgWidth,imgHeight);for(j=0;j<imageData.height;i++)
{for(i=0;i<imageData.width;j++)
{var index=(i*4)*imageData.width+(j*4);var red=imageData.data[index];var green=imageData.data[index+1];var blue=imageData.data[index+2];var alpha=imageData.data[index+3];var average=(red+green+blue)/3;imageData.data[index]=average;imageData.data[index+1]=average;imageData.data[index+2]=average;imageData.data[index+3]=alpha;}}
if(bPlaceImage)
{var myDiv=document.createElement("div");myDiv.appendChild(myCanvas);image.parentNode.appendChild(myCanvas);}
return myCanvas.toDataURL();}
function set_opacity(obj,value){obj.style.opacity=value/10;obj.style.filter='alpha(opacity='+value*10+')';}
Array.prototype.in_array=function(p_val){for(var i=0,l=this.length;i<l;i++){if(this[i]==p_val){return true;}}
return false;}
Array.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');}
function get_args()
{var args=new Object();var query=location.search.substring(1);var pairs=query.split("&");for(var i=0;i<pairs.length;i++)
{var pos=pairs[i].indexOf('=');if(pos==-1)continue;var argname=pairs[i].substring(0,pos);var value=pairs[i].substring(pos+1);args[argname]=unescape(value);}
return args;}
function in_array(needle,haystack)
{for(var i in haystack)
{if(needle==haystack[i])return true;}
return false;}
String.prototype.trim=function()
{return this.replace(/^\s+|\s+$/,'');}
String.prototype.is_empty=function()
{if(this.trim()=='')return true;}
String.prototype.ucfirst=function()
{return this.substr(0,1).toUpperCase()+this.substr(1,this.length);}
String.prototype.strip_tags=function()
{return this.replace(/<&#91;^>&#93;*>/g,'');}
stripslashes=function(str){return(str+'').replace(/\\(.?)/g,function(s,n1){switch(n1){case'\\':return'\\';case'0':return'\0';case'':return'';default:return n1;}});}
String.prototype.str_replace=function(search,replace,count){var i=0,j=0,temp='',repl='',sl=0,fl=0,f=[].concat(search),r=[].concat(replace),s=this,ra=r instanceof Array,sa=s instanceof Array;s=[].concat(s);if(count){this.window[count]=0;}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
for(j=0,fl=f.length;j<fl;j++){temp=s[i]+'';repl=ra?(r[j]!==undefined?r[j]:''):r[0];s[i]=(temp).split(f[j]).join(repl);if(count&&s[i]!==temp){this.window[count]+=(temp.length-s[i].length)/f[j].length;}}}
return sa?s:s[0];}
substr=function(f_string,f_start,f_length){f_string+='';if(f_start<0){f_start+=f_string.length;}
if(f_length==undefined){f_length=f_string.length;}else if(f_length<0){f_length+=f_string.length;}else{f_length+=f_start;}
if(f_length<f_start){f_length=f_start;}
return f_string.substring(f_start,f_length);}
font_size_tofit=function(element,max)
{var fontSize=max;var ourText=element.childNodes[1];var maxHeight=element.getHeight();var maxWidth=element.getWidth();var textHeight;var textWidth;do
{ourText.style.fontSize=fontSize+'px';textHeight=ourText.offsetHeight;textWidth=ourText.getWidth();fontSize=fontSize-1;}
while((textHeight>maxHeight||textWidth>maxWidth)&&fontSize>3);}
var data_class=Class.create({get:function(varname)
{},set:function(varname,value,global)
{if(global)
{global='&global=1';}
else
{var global='';}
new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=data.set&var='+varname+'&value='+value+global,onComplete:function(response)
{return true;}});}});var data=new data_class();
var dir='';var location_store=new Array();var uri_split=new Array();var Global=Class.create({disable_apis:new Array(),uri:new Array(),args:new Object(),last_active:0,initialize:function()
{this.args=get_args();document.observe('mousemove',function()
{global.last_active=global.now();});},now:function()
{return parseInt(new Date().getTime().toString().substring(0,10));},set_uri:function(string)
{uri_split=string.split(',');},update_status:function()
{var status_obj=$('status_field');var status=status_obj.value;if(status==''||status=='What are you up to...?')
{user.alert('Please enter a status before updating.');return;}
$('status_load').style.display='block';$('status_count').style.display='none';$('status_field').disabled=true;$('status_field').className='';new Ajax.Request(dir+'/scripts/php/actions.php',{parameters:'action=api.update_status&status='+escape(status)+'&disable='+this.disable_apis.join(','),onComplete:function(response)
{if(uri_split[0]=='dashboard')
{var range=document.createRange();range.selectNode(document.body);var parsedHTML=range.createContextualFragment(response.feed.template);var feed=document.createElement('li');feed.style.display='none';feed.appendChild(parsedHTML);$('status_load').style.display='none';$('status_count').style.display='block';$('status_count').innerHTML='140';$('status_field').disabled=false;$('status_field').value='What are you up to...?';$('feeds').insertBefore(feed,$('feeds').firstChild);new Effect.BlindDown(feed);new Effect.Pulsate(feed,{pulses:5,duration:2.5});}},onError:function(response)
{$('status_load').style.display='none';$('status_count').style.display='block';$('status_count').innerHTML='140';$('status_field').disabled=false;$('status_field').value='What are you up to...?';user.alert('We were unable to update some or all of your networks. They may just be down, but the issue has been reported so we suggest that you try again later.<br />Sorry for any inconvenience caused.');}});},toggle_api:function(which,default_set)
{var new_list=new Array();var there=false;for(var i=0;i<this.disable_apis.length;i++)
{if(this.disable_apis[i]!=which)
{new_list[new_list.length]=this.disable_apis[i];}
else
{there=true;}}
if(!there)
{new_list[new_list.length]=which;$('api_icon_'+which).className='network '+which+' disabled';}
else
{$('api_icon_'+which).className='network '+which+' enabled';}
this.disable_apis=new_list;if(default_set==null)
{data.set('status_disable.'+which,((there)?0:1));}},toggle_status_updater:function(btn_obj)
{if($('you').style.display=='none')
{Effect.BlindDown('you');btn_obj.innerHTML='Hide Status Updater';global.set_session('hide_status_updater','0');}
else
{Effect.BlindUp('you');btn_obj.innerHTML='Show Status Updater';global.set_session('hide_status_updater','1');}},search_location:function(buttonObj)
{var fieldObj=buttonObj.parentNode.parentNode.childNodes[1];$('search_results').style.display='none';$('loading_search').style.display='block';$('search_results').innerHTML='';new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=location.search&q='+fieldObj.value,onComplete:function(response)
{response.results=response.response;if(response.results.length)
{for(var i=0;i<response.results.length;i++)
{var li=document.createElement('li');var title=document.createElement('div');title.innerHTML=response.results[i].title;li.appendChild(title);var address=document.createElement('span');address.innerHTML=response.results[i].streetAddress;li.appendChild(address);var set=document.createElement('a');set.className='buttonslim';set.setAttribute('href','#');set.setAttribute('onclick','global.set_location(\''+response.results[i].title+' ('+response.results[i].streetAddress+')\', \''+response.results[i].lat+'\', \''+response.results[i].lng+'\'); return false;');var set_text=document.createElement('span');set_text.innerHTML='Set Location';set.appendChild(set_text);li.appendChild(set);var clear=document.createElement('div');clear.className='clear';li.appendChild(clear);$('search_results').appendChild(li);}}
else
{}
$('search_results').style.display='block';$('loading_search').style.display='none';popup.reposition();}});},set_location:function(string,lat,long)
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=location.set&location='+escape(string)+'&lat='+lat+'&long='+long,onComplete:function(response)
{if(uri_split[0]=='user')
{}
else
{$('you_location').innerHTML=string;popup.close();user.alert('Your location has successfully been updated.');}}});},set_search_type:function(type,headerelem,headerinputclass)
{document.forms['search_header'].elements['search[type]'].value=type;if(uri_split[0]=='search')document.forms['search_page'].elements['search[type]'].value=type;if(headerinputclass!=undefined||headerinputclass!=false)
{document.forms['search_header'].elements['search[query]'].className=headerinputclass;}
else
{document.forms['search_header'].elements['search[query]'].className='';}
if(headerelem!=false)
{var headertypes=headerelem.parentNode.parentNode;for(var i=0;i<headertypes.childNodes.length;i++)
{headertypes.childNodes[i].className='';}
headerelem.parentNode.className='current';}
if(uri_split[0]=='search')
{switch(type)
{case'updates':if(uri_split[0]=='search')document.forms['search_page'].elements['search[query]'].value='Search Updates';break;case'people':if(uri_split[0]=='search')document.forms['search_page'].elements['search[query]'].value='Search People';break;case'places':if(uri_split[0]=='search')document.forms['search_page'].elements['search[query]'].value='Search Locations';break;case'discussions':if(uri_split[0]=='search')document.forms['search_page'].elements['search[query]'].value='Search Discussions';break;case'photos':if(uri_split[0]=='search')document.forms['search_page'].elements['search[query]'].value='Search Photos';break;}}
if(uri_split[0]=='search')
{for(var i=0;i<$('search_page').childNodes[1].childNodes[1].childNodes[1].childNodes.length;i++)
{if($('search_page').childNodes[1].childNodes[1].childNodes[1].childNodes[i].tagName=='A')
{$('search_page').childNodes[1].childNodes[1].childNodes[1].childNodes[i].className=(type==$('search_page').childNodes[1].childNodes[1].childNodes[1].childNodes[i].getAttribute('id').replace('search_type_',''))?'active':'';}}}},update_status_counter:function(field,counter)
{var limit=140;counter=$(counter);counter.innerHTML=limit-field.value.length;counter.className='counter';if((limit-field.value.length)<=50)
{counter.className='counter low';}
if((limit-field.value.length)<=0)
{counter.className='counter empty';}},set_session:function(name,value)
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=data.set_session&name='+name+'&value='+escape(value)});},});var global=new Global();global.last_active=global.now();
var popup_class=Class.create({initialize:function(file)
{},show:function(file,params)
{new Ajax.Request(dir+'/content/popups/'+file+'.php',{method:'post',parameters:params,onComplete:function(response)
{if(response)
{var body=document.getElementsByTagName('body')[0];var container=document.createElement('div');container.setAttribute('id','popup');container.className='popup-container';var content=document.createElement('div');content.className='popup-content';content.innerHTML=response;container.insertBefore(content,container.firstChild);var mask=document.createElement('div');mask.setAttribute('id','popup-mask');mask.className='popup-mask';body.insertBefore(mask,body.firstChild);body.insertBefore(container,body.firstChild);var size=get_page_size();var scroll=get_page_scroll();content.style.top=(size[3]/2)-(content.offsetHeight/2)+'px';content.style.left=(size[0]/2)-(content.offsetWidth/2)+'px';mask.style.height=size[1]+'px';return false;}}});return false;},close:function()
{$('popup').style.display='none';$('popup-mask').style.display='none';document.getElementsByTagName('body')[0].removeChild($('popup'));document.getElementsByTagName('body')[0].removeChild($('popup-mask'));},reposition:function()
{var size=get_page_size();var scroll=get_page_scroll();$('popup').childNodes[0].style.top=(scroll[1]+((size[3]-$('popup').childNodes[0].offsetHeight)/2)+'px');$('popup').childNodes[0].style.left=(((size[0]-$('popup').childNodes[0].offsetWidth)/2)+'px');}});var popup=new popup_class();
var switch_class=Class.create({initialize:function(){},set_on:function(which){alert(which);var switchObj=which.parentElement.parentElement;alert('1');switchObj.childNodes[1].className='on current';switchObj.childNodes[3].className='off';switchObj.childNodes[1].innerHTML='On';var link=document.createElement('a');link.setAttribute('href','#');link.setAttribute('onclick','switch_class.set_off(this); return false;');link.innerHTML='Off';switchObj.childNodes[3].appendChild(link);},set_off:function(which){var switchObj=which.parentElement.parentElement;switchObj.childNodes[3].className='off current';switchObj.childNodes[1].className='on';switchObj.childNodes[3].innerHTML='Off';var link=document.createElement('a');link.setAttribute('href','#');link.setAttribute('onclick','switch_class.set_on(this); return false;');link.innerHTML='On';switchObj.childNodes[1].appendChild(link);}});var switch_class=new switch_class();
var user_class=Class.create({initialize:function()
{},alert:function(message)
{popup.show('user_alert',{message:message});},confirm:function(message)
{return confirm(message);}});var user=new user_class();
var class_api=Class.create({initialize:function(){},post_comment:function(which,postid,buttonObj)
{var fieldObj=buttonObj.parentNode.parentNode.childNodes[0];buttonObj.disabled=true;fieldObj.disabled=true;new Ajax.Request(dir+'/scripts/php/actions.php',{parameters:'action=api.post_comment&which='+which+'&postid='+postid+'&comment='+fieldObj.value,onComplete:function(response)
{var comment=document.createElement('li');var comment_photo=document.createElement('div');comment_photo.className='photo';var comment_photo_img=document.createElement('img');comment_photo_img.setAttribute('src',response.user.photo);comment_photo.appendChild(comment_photo_img);comment.appendChild(comment_photo);var comment_user=document.createElement('div');comment_user.className='user';var comment_user_link=document.createElement('a');comment_user_link.setAttribute('href',response.user.profile);comment_user_link.setAttribute('target','_blank');comment_user_link.innerHTML=response.user.name;comment_user.appendChild(comment_user_link);comment.appendChild(comment_user);var comment_time=document.createElement('div');comment_time.className='time';comment_time.innerHTML=response.comment.time;comment.appendChild(comment_time);var comment_text=document.createElement('div');comment_text.className='text';comment_text.innerHTML=response.comment.text;comment.appendChild(comment_text);var comment_clear=document.createElement('div');comment_clear.className='clear';comment.appendChild(comment_clear);$('cl_'+postid).appendChild(comment);fieldObj.value='Write another comment...';fieldObj.disabled=false;buttonObj.disabled=false;fieldObj.select();}});},load_comments:function(which,postid)
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=api.load_comments&which='+which+'&postid='+postid,onComplete:function(response)
{$('cl_'+postid).innerHTML='';for(var i=0;i<response.comments.length;i++)
{var comment=document.createElement('li');var comment_photo=document.createElement('div');comment_photo.className='photo';var comment_photo_img=document.createElement('img');comment_photo_img.setAttribute('src',response.comments[i].user.photo);comment_photo.appendChild(comment_photo_img);comment.appendChild(comment_photo);var comment_user=document.createElement('div');comment_user.className='user';var comment_user_link=document.createElement('a');comment_user_link.setAttribute('href',response.comments[i].user.profile);comment_user_link.setAttribute('target','_blank');comment_user_link.innerHTML=response.comments[i].user.name;comment_user.appendChild(comment_user_link);comment.appendChild(comment_user);var comment_time=document.createElement('div');comment_time.className='time';comment_time.innerHTML=response.comments[i].time;comment.appendChild(comment_time);var comment_text=document.createElement('div');comment_text.className='text';comment_text.innerHTML=response.comments[i].text;comment.appendChild(comment_text);var comment_clear=document.createElement('div');comment_clear.className='clear';comment.appendChild(comment_clear);$('cl_'+postid).appendChild(comment);}}});}});var api=new class_api();
var icontip=Class.create({initialize:function(text,element)
{var tipstr=text.toLocaleLowerCase().replace(' ','_');if($('tip_'+tipstr))return;var tip=document.createElement('div');tip.setAttribute('id','tip_'+tipstr);tip.className='icontip';tip.style.display='none';var row=document.createElement('div');row.className='row';var row_left=document.createElement('div');row_left.className='left';row.appendChild(row_left);var middle=document.createElement('div');middle.className='text';middle.innerHTML=text;row.appendChild(middle);var row_right=document.createElement('div');row_right.className='right';row.appendChild(row_right);tip.appendChild(row);var arrow=document.createElement('div');arrow.className='arrow';tip.appendChild(arrow);document.getElementsByTagName('body')[0].insertBefore(tip,document.getElementsByTagName('body')[0].firstChild);tip.clonePosition(element,{setWidth:false,setHeight:false});tip.style.left=tip.style.left.replace('px','')-(tip.getWidth()/4)+'px';var overtip=false;tip.observe('mouseover',function()
{overtip=true;});tip.observe('mouseout',function()
{overtip=false;});element.observe('mouseout',function()
{if(overtip)return;new Effect.Move(tip,{duration:0.8,x:0,y:15,mode:'relative'});new Effect.Fade(tip,{duration:0.8,afterFinish:function(){if($('tip_'+tipstr)===false)return;document.getElementsByTagName('body')[0].removeChild(tip);}});});new Effect.Move(tip,{duration:0.8,x:0,y:-15,mode:'relative'});new Effect.Appear(tip,{duration:0.8});}});
var Animation=Class.create({initialize:function(element,frames,height,speed,hide_on_stop)
{this._element=(typeof element=='string')?$(element):element;this._frames=frames;this._height=height;this._hide_on_stop=hide_on_stop;this._speed=(speed)?speed:0.1;this._count=0;this._interval=null;this._count=0;},start:function()
{if(this._interval)return;this._interval=setInterval(this.update_position.bind(this),this._speed);this._element.style.display='block';},stop:function()
{clearInterval(this._interval);this._interval=null;if(this._hide_on_stop)this._element.style.display='none';},update_position:function()
{this._element.style.backgroundPosition='0 -'+(this._height*this._count)+'px';if(this._count==this._frames)
{this._count=0;return;}
this._count++;}});
var errors=0;var inited=false;var username_empty=false;var password_check_empty=false;var error_store={};fix_username=function(fieldObj)
{fieldObj.value=fieldObj.value.replace(' ','_');fieldObj.value=fieldObj.value.replace(/[^a-zA-Z0-9_-]+/g,'');}
check_dob_empty=function(fieldObj)
{var form=document.forms['register_form'];var dob_day=form.elements['register[profile][dob][day]'];var dob_month=form.elements['register[profile][dob][month]'];var dob_year=form.elements['register[profile][dob][year]'];if(dob_day.options[dob_day.selectedIndex].value.is_empty()||dob_month.options[dob_month.selectedIndex].value.is_empty()||dob_year.options[dob_year.selectedIndex].value.is_empty())
{fieldObj.parentNode.parentNode.childNodes[7].innerHTML=fieldObj.parentNode.parentNode.childNodes[3].innerHTML+' was left empty.';fieldObj.parentNode.parentNode.childNodes[7].style.display='block';}
else
{fieldObj.parentNode.parentNode.childNodes[7].style.display='none';}}
check_empty=function(event,fieldObj)
{if(event.keyCode==9)return;if(fieldObj.value.is_empty())
{fieldObj.className='error';fieldObj.parentNode.parentNode.childNodes[7].innerHTML=fieldObj.parentNode.parentNode.childNodes[3].innerHTML+' was left empty.';fieldObj.parentNode.parentNode.childNodes[7].style.display='block';if(fieldObj.getAttribute('name')=='register[profile][username]')
{username_empty=true;}
if(fieldObj.getAttribute('name')=='register[user][password_check]')
{password_check_empty=true;}
error_store[fieldObj.getAttribute('name')]=true;}
else
{fieldObj.className='';fieldObj.parentNode.parentNode.childNodes[7].style.display='none';if(fieldObj.getAttribute('name')=='register[profile][username]')
{username_empty=false;}
if(fieldObj.getAttribute('name')=='register[user][password_check]')
{password_check_empty=false;}
error_store[fieldObj.getAttribute('name')]=false;}}
check_username=function(fieldObj)
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=register.check_username&username='+fieldObj.value,onComplete:function(response)
{if(response==1)
{fieldObj.className='error';fieldObj.parentNode.parentNode.childNodes[7].innerHTML='The '+fieldObj.parentNode.parentNode.childNodes[3].innerHTML+'  chosen already exists.';fieldObj.parentNode.parentNode.childNodes[7].style.display='block';}
else
{if(!error_store[fieldObj.getAttribute('name')])
{fieldObj.className='';fieldObj.parentNode.parentNode.childNodes[7].style.display='none';}}}});}
check_email=function(fieldObj)
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=register.check_email&email='+fieldObj.value,onComplete:function(response)
{if(response==1)
{fieldObj.className='error';fieldObj.parentNode.parentNode.childNodes[7].innerHTML='The '+fieldObj.parentNode.parentNode.childNodes[3].innerHTML+'  chosen already exists.';fieldObj.parentNode.parentNode.childNodes[7].style.display='block';}
else
{if(!error_store[fieldObj.getAttribute('name')])
{fieldObj.className='';fieldObj.parentNode.parentNode.childNodes[7].style.display='none';}}}});}
passwords_match=function(fieldObj)
{var password=document.forms['register_form'].elements['register[user][password]'];var password_check=document.forms['register_form'].elements['register[user][password_check]'];if(password.value!=password_check.value&&password_check.value.replace(' ','')!='')
{fieldObj.className='error';fieldObj.parentNode.parentNode.childNodes[7].style.display='block';fieldObj.parentNode.parentNode.childNodes[7].innerHTML='The passwords entered don\'t match.';}
else
{if(!error_store[fieldObj.getAttribute('name')])
{fieldObj.className=(password_check_empty)?'error':'';fieldObj.parentNode.parentNode.childNodes[7].style.display='none';}}}
is_errors=function()
{var form=document.forms['register_form'];var first_name=form.elements['register[profile][first_name]'];var second_name=form.elements['register[profile][second_name]'];var gender=form.elements['register[profile][gender]'];var username=form.elements['register[profile][username]'];var dob_day=form.elements['register[profile][dob][day]'];var dob_month=form.elements['register[profile][dob][month]'];var dob_year=form.elements['register[profile][dob][year]'];var email=form.elements['register[user][email]'];var password=form.elements['register[user][password]'];var password_check=form.elements['register[user][password_check]'];var is_error=false;if(first_name.value.is_empty())
{check_empty({},first_name);is_error=true;}
if(second_name.value.is_empty())
{check_empty({},second_name);is_error=true;}
if(gender.options[gender.selectedIndex].value.is_empty())
{check_empty({},gender);is_error=true;}
if(username.value.is_empty())
{check_empty({},username);is_error=true;}
if(dob_day.options[dob_day.selectedIndex].value.is_empty()||dob_month.options[dob_month.selectedIndex].value.is_empty()||dob_year.options[dob_year.selectedIndex].value.is_empty())
{check_dob_empty(dob_day);is_error=true;}
if(email.value.is_empty())
{check_empty({},email);is_error=true;}
if(password.value.is_empty())
{check_empty({},password);is_error=true;}
if(password_check.value.is_empty())
{check_empty({},password_check);is_error=true;}
return is_error;}
facebook_connect=function()
{FB_RequireFeatures(['XFBML'],function()
{FB.Facebook.init('13f87e0e103d4f199f56f64596e94e6e','http://www.kazle.com/includes/api/facebook/xd_receiver.htm');FB.Connect.requireSession(function()
{new Ajax.Request(dir+'/scripts/php/actions.php',{method:'post',parameters:'action=register.facebook_connect&userid='+FB.Connect.get_loggedInUser()+'&session_key='+encodeURIComponent(FB.Facebook.apiClient.get_session().session_key),onSuccess:function(response)
{}});});});}
var Tooltip=Class.create({initialize:function(element,content,options)
{element=$(element);if(options==undefined)options={direction:'top'};var box=document.createElement('div');box.setAttribute('id','tooltip_'+element.getAttribute('id'));box.className='tooltip';box.style.position='absolute';var box_arrow=document.createElement('div');box_arrow.className='arrow '+options.direction;box.appendChild(box_arrow);var box_close=document.createElement('a');box_close.className='close';box_close.setAttribute('href','#');box_close.setAttribute('onclick','return false;');box_close.onmouseup=function()
{data.set('tooltip_mark.'+this.parentNode.getAttribute('id').replace('tooltip_',''),true);new Effect.Fade(this.parentNode);}
box.appendChild(box_close);var box_content=document.createElement('span');box_content.innerHTML=content;box.appendChild(box_content);switch(options.direction)
{case'top':box.style.top=(element.offsetTop+element.offsetHeight+21)+'px';box.style.left=(element.offsetLeft-(element.offsetWidth/4))+'px';break;case'left':break;case'right':break;case'bottom':break;}
document.getElementsByTagName('body')[0].appendChild(box);},});