
var ProfilePrototype={submitForm:function(id,form,varFunction)
{var div=$(id);if(div&&form)
{var i;var params=[];for(i in form)
{if(i.substr(0,5)=='data[')
{params[i]=form[i].value;}}
div.innerHTML='<center><img src="/img/spinner-large.gif" /></center>';new Ajax.Request(form.action,{method:form.method,parameters:params,asynchronous:true,onSuccess:function(transport)
{div.update(transport.responseText);if(varFunction){varFunction.f(transport)}},onFailure:function()
{alert('you fail');}});form.action='javascript://';}
return false;},updateElements:function(x,i)
{if(!i){i=0;}
var id=x[i];var f=x[i+1];return typeof f!='function'?new YAHOO.plugin.Dispatcher.fetch(id,f,(i<x.length-2?{onLoad:function(){return ProfilePrototype.updateElements(x,i+2)}}:undefined)):(new f({id:id,onLoad:i<x.length-2?function(){return ProfilePrototype.updateElements(x,i+2)}:function(){return undefined}}));},updateDispatcher:function(config,url)
{return new YAHOO.plugin.Dispatcher.fetch(config.id,url,{onLoad:config.onLoad});},setTabCount:function(tabViewObject,count,countZero)
{count=Math.round(count);if(countZero==undefined){countZero=true;}
if(tabViewObject instanceof Object)
{tabViewObject.set('label',tabViewObject.get('label').replace(/\s*\(.*?\)\s*$/,'')+(!countZero&&count||countZero?' ('+String(count)+')':''));}
return tabViewObject;},tp:{},help:function(currentId,file)
{var options;var content;if(file instanceof Object)
{options=file;}
else
{options={};}
options.showdelay='0';options.hidedelay='0';options.zIndex='2100000000';options.context=currentId;options.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.3}
var success=function(transport)
{if(transport)
{options.text=transport.responseText;}
var el='tooltip_'+currentId;ProfilePrototype.tp[currentId]=new YAHOO.widget.Tooltip
(el,options);var hide=function(){ProfilePrototype.tp[currentId].hide();}
YAHOO.util.Event.addListener(currentId,"mousedown",hide);}
if(file instanceof Object)
{success()
return;}
new Ajax.Request("/files/help/"+file+'.htm',{method:'get',onSuccess:success,onFailure:function(){}});},helppanel:function(elementID,title,text,size)
{if(!(ProfilePrototype.help_panel instanceof Array))
{ProfilePrototype.help_panel=[];}
YAHOO.util.Event.onDOMReady(function(elementID,title,text,size){return function(e)
{var i;ProfilePrototype.help_panel[i=ProfilePrototype.help_panel.length]=new YAHOO.widget.Panel("waitbox",{width:typeof size=='object'?size[0]+'px':"500px",height:typeof size=='object'?size[1]+'px':"250px",fixedcenter:true,constraintoviewport:true,underlay:"shadow",close:true,modal:false,visible:false,draggable:true,underlay:'matte',zindex:1000000});var px=typeof size=='object'?(size[1]-32)+'px':'208px';ProfilePrototype.help_panel[i].setHeader(title);ProfilePrototype.help_panel[i].setBody('<div style="vertical-align:middle;text-align:justify;height:'+px+';overflow:auto;"><div style="padding-right:15px;padding-left:10px;">'+text+'</div>');ProfilePrototype.help_panel[i].render(document.body);$(elementID).onclick=function(i){return function()
{var j;for(j=0;j<ProfilePrototype.help_panel.length;j++)
{ProfilePrototype.help_panel[j].hide();}
ProfilePrototype.help_panel[i].show();return false;}}(i);}}(elementID,title,text,size));},formImages:function(o,element)
{if(typeof o!='object'||!o)
{throw("You need an Object argument in multiImages() function");}
var $flashvars='type='+o.type+'&num='+o.num;if(!o.width)
{o.width=526;}
if(!o.height)
{o.height=190;}
if(o.input instanceof Array)
{o.images=document.getElementById(o.input[0]).value.split(/\s+/);if(o.input[1]&&typeof o['default']=='undefined')
{o['default']=document.getElementById(o.input[1]).value;}
window.assign_images=ProfilePrototype.assignImages(o.input[0],o.input[1]);}
else if(typeof o.input=='string')
{o.images=document.getElementById(o.input).value.split(/\s+/);window.assign_images=ProfilePrototype.assignImages(o.input);}
if(o['default'])
{$flashvars+='&default='+escape(o['default']);}
if(o.num)
{$flashvars+='&num='+escape(o.num);}
if(o.titles)
{$flashvars+='&titles='+escape(o.titles.join(','));}
if(o.images instanceof Array)
{$flashvars+='&nodes='+escape(o.images.join(' '));}
if(o.unique)
{$flashvars+='&unique='+escape(o.unique);}
if(o.name)
{$flashvars+='&name='+escape(o.name);}
if(o.description)
{$flashvars+='&desc='+escape(o.description);}
if(document.cookie)
{var $=document.cookie.match(new RegExp('MAKATTO'+'='+'(\\w+)'));if($?$[1]:false)
{$flashvars+='&s='+escape($[1]);}}
var $o='<embed id="upoader'+(o.unique?o.unique:'')+'" '+'width="'+o.width+'" height="'+o.height+'" '+'align="middle" type="application/x-shockwave-flash" wmode="opaque" '+'flashvars="'+$flashvars+'" salign="" allowscriptaccess="sameDomain" allowfullscreen="false" menu="true" name="Storefront" bgcolor="#ffffff" devicefont="false" scale="showall" loop="true" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="/files/flash/uploader.swf"/>';if(!element)
{return $o;}
if(typeof element=='string')
{element=document.getElementById(element);}
return element.innerHTML=$o;},assignImages:function(form_element_id,form_element_default_id)
{return function(o)
{var $form=null;var $form_default=null;if(o.unique)
{$form=document.getElementById(form_element_id[o.unique]);if(form_element_default_id)
{$form_default=document.getElementById(form_element_default_id[o.unique]);}}
else
{$form=document.getElementById(form_element_id);if(form_element_default_id)
{$form_default=document.getElementById(form_element_default_id);}}
if($form)
{$form.value=o.nodes?o.nodes.join(' '):'';}
if($form_default)
{$form_default.value=o['default']?o['default']:'';}
return true;};},yuiPost:function(callback,formEl,url,callFirst)
{var data=Form.serialize(formEl);if(callFirst)
{callFirst();}
var request=YAHOO.util.Connect.asyncRequest('POST',url,callback,data);},mouseoverth:function(o)
{if(!Element.hasClassName(o,'selected'))
{Element.addClassName(o,'selected1');}},mouseoutth:function(o)
{if(Element.hasClassName(o,'selected1'))
{Element.removeClassName(o,'selected1');}},mouseclickth:function(o)
{var s=Element.siblings(Element.up(o));var a;var i;Element.addClassName(o,'selectedsave: 1');Element.removeClassName(o,'selected1');for(i=0;i<s.length;i++)
{a=s[i].getElementsByTagName('A')[0];Element.removeClassName(a,'selected');Element.removeClassName(a,'selected1');}},videoTutorialObject:{},videoTutorial:function(o)
{var options,w,h;var created=false;if(!o)
{o=ProfilePrototype.videoTutorialObject;}
else
{ProfilePrototype.videoTutorialObject=o;}
if(!ProfilePrototype.tutorial)
{created=true;options={width:(w=(10+(o.scale?o.scale:1)*704))+"px",height:(h=(396*(o.scale?o.scale:1)+(o.save?15:0)+30))+"px",fixedcenter:typeof o.fixedcenter=='undefined'?true:o.fixedcenter,constraintoviewport:true,underlay:"shadow",close:true,modal:o.modal?true:false,visible:false,draggable:true,underlay:'matte',zindex:10000};if(typeof o.fixedcenter!='undefined'&&!o.fixedcenter)
{options.x=(YAHOO.util.Dom.getViewportWidth()-w)/2;options.y=(YAHOO.util.Dom.getViewportWidth()-h)/2;}
ProfilePrototype.tutorial=new YAHOO.widget.Panel("video_tutorial",options);}
var $embed='',$box='';if(o.hash)
{$embed='<embed src="http://www.youtube.com/v/'+o.hash+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+(o.scale?o.scale*704:704)+'" height="'+(o.scale?o.scale*396:396)+'"></embed>';}
if(o.save)
{$box='<form style="text-align:center"><input type="checkbox" id="video_tutorial_checkbox" '+(o.checked?'checked="checked"':'')+'/><label for="video_tutorial_checkbox"> '+(o.noshowtext?o.noshowtext:'Do not show this video tutorial again.')+'</label></form>';}
if(o.title)
{ProfilePrototype.tutorial.setHeader(o.title);}
ProfilePrototype.tutorial.setBody($embed+$box);ProfilePrototype.tutorial.render(created?document.body:undefined);var domready=function()
{var el=document.getElementById('video_tutorial_checkbox');var close=document.getElementsByClassName('container-close')[0];close.onclick=function(e){if(ProfilePrototype.videoTutorialObject.onhide){ProfilePrototype.videoTutorialObject.onhide();}ProfilePrototype.tutorial.hide();}
el.onclick=function(e){ProfilePrototype.videoTutorialObject.checked=el.checked;ProfilePrototype.saveVideoTutorialState();}}
YAHOO.util.Event.onDOMReady(domready);if(o.show&&!o.checked)
{if(o.onshow)
{o.onshow();}
ProfilePrototype.tutorial.show();}},showVideoTutorial:function()
{var o=ProfilePrototype.videoTutorialObject;if(ProfilePrototype.tutorial&&ProfilePrototype.videoTutorialObject)
{if(o.onshow)
{o.onshow();}
ProfilePrototype.tutorial.show();}},saveVideoTutorialState:function(o)
{var o=ProfilePrototype.videoTutorialObject;var request;if(o&&o.save&&o.hash)
{request=YAHOO.util.Connect.asyncRequest('POST','/tips_users/setTip',{success:function(e)
{if(e.responseText)
{alert(e.responseText);}}},"tip="+o.save+"&show="+(o.checked?0:1));}}};var worthlessFlashMessageEl=document.getElementById('flashMessage');var worthlessFlashMessage;var worthlessFlashMessageTime;function worthlessFlashMessageGone()
{worthlessFlashMessageEl.onmouseover=null;worthlessFlashMessage.attributes.opacity={to:0};worthlessFlashMessage.animate();setTimeout("worthlessFlashMessageEl.style.display= 'none' ;worthlessFlashMessageEl.style.visibility = 'hidden' ;",1000);}
if(worthlessFlashMessageEl)
{worthlessFlashMessage=new YAHOO.util.Anim(worthlessFlashMessageEl);worthlessFlashMessage.attributes.opacity={from:0,to:1};worthlessFlashMessage.duration=1.0;worthlessFlashMessage.method=YAHOO.util.Easing.easeOut;worthlessFlashMessage.animate();worthlessFlashMessageEl.onmouseover=worthlessFlashMessageGone;setTimeout('worthlessFlashMessage.attributes.opacity = { to: 0.5 }; worthlessFlashMessage.animate()',5000);}
function ElementFX()
{var self=this;this.time=null;this.ids=null;this.effect=function()
{var i;if(self.ids instanceof Object)
{for(i in self.ids)
{if(document.getElementById(i))
{new Effect[self.ids[i]](i,{duration:5+Math.random(),pulses:5});}}}
delete self.ids;self.ids=null;self.time=null;}
this.add=function(id,fx,t)
{if(self.time)
{clearTimeout(self.time);self.time=null;}
if(!self.ids)
{self.ids={};}
self.ids[id]=fx?fx:'Pulsate';setTimeout(self.effect,typeof t=='undefined'||t===null?t:0);}}
var elementfx=new ElementFX();function fillUpBody()
{var el=$('main');var h=el.offsetHeight;var h0=$('pageFooter').offsetHeight;var y=YAHOO.util.Dom.getY(el);var h1=document.viewport.getHeight()-y-h0;el.style.minHeight=h1+'px';}