var class_def=new Array();
var error_log="";
function MM_findObj(n,d){
var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_showHideLayers(){
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i<(args.length-2);i+=3)
if((obj=MM_findObj(args[i]))!=null){
v=args[i+2];
if(obj.style){
obj=obj.style;
v=(v=='show')?'block':(v=='hide')?'none':v;}
obj.display=v;}}
function setCheckedValue(radioObj,newValue){
if(!radioObj)
return;
var radioLength=radioObj.length;
if(radioLength==undefined){
radioObj.checked=(radioObj.value==newValue.toString());
return;}
for(var i=0;i<radioLength;i++){
radioObj[i].checked=false;
if(radioObj[i].value==newValue.toString()){
radioObj[i].checked=true;}}}
function doPrepareSearch(v){
var a=v.split("|");
document.getElementById('custom_search_field').name=a[0];
if(document.getElementById('custom_search_field').value.match(/^\[[\w\s]+\]$/)){
document.getElementById('custom_search_field').value=a[1];}}
function DeleteFriend(id,confirmation){
if(confirm(confirmation)){
window.location="?page=account&area=friends&action=kill&kill_user_id="+id;}}
function kill(e){
if(e)
e.cancelBubble=true;
else
window.event.cancelBubble=true;}
function getCssRule(selector,id_){
selector=selector;
var cssRulesArray=Array();
var k=0;
if(!document.styleSheets)
return false;
if(document.styleSheets[id_]['cssRules'])
var cssRules='cssRules';
else
var cssRules='rules';
if(id_){
for(var R=0;R<document.styleSheets[id_][cssRules].length;R++){
selectorText=document.styleSheets[id_][cssRules][R].selectorText;
if(selectorText){
expression=new RegExp("\\."+selector+"\\b");
match_=selectorText.match(expression);
if(match_){
cssRulesArray[k]=document.styleSheets[id_][cssRules][R].style;
k++;}}}}
else{
for(i=0;i<document.styleSheets.length;i++){
for(var R=0;R<document.styleSheets[i][cssRules].length;R++){
selectorText=document.styleSheets[i][cssRules][R].selectorText;
if(selectorText){
expression=new RegExp("\\."+selector+"\\b");
match_=selectorText.match(expression);
if(match_){
cssRulesArray[k]=document.styleSheets[i][cssRules][R].style;
k++;}}}}}
return cssRulesArray;}
function setCssValue(selector,property,value,id_){
if(class_def[selector]){
var rulesArray=class_def[selector];}
else{
var rulesArray=getCssRule(selector,id_);
class_def[selector]=rulesArray;}
if(rulesArray){
for(var i=0;i<rulesArray.length;i++){
rulesArray[i][property]=value;}}}
function getCssValue(selector,property,id_){
error_log="";
if(class_def&&class_def[selector]){
var rulesArray=class_def[selector];}
else{
var rulesArray=getCssRule(selector,id_);
class_def[selector]=rulesArray;}
if(rulesArray){
for(i=0;i<rulesArray.length;i++){
if(rulesArray[i][property]){
return rulesArray[i][property];}}}
return null;}
function print_r(input,_indent){
var indent=(typeof(_indent)=='string')?_indent+'    ':'    ';
var paren_indent=(typeof(_indent)=='string')?_indent+'  ':'';
if(typeof(input)=='string')
var output="'"+input+"'\n";
else if(typeof(input)=='boolean')
var output=(input?'true':'false')+"\n";
else if(typeof(input)=='object'){
var output=((input.reverse)?'Array':'Object')+"\n"
output+=paren_indent+"(\n";
for(var i in input)
output+=indent+"["+i+"] => "+print_r(input[i],indent);
output+=paren_indent+")\n"}
return output}
function PushColorOnStack(color){
k=colors_stack.length;
for(i=1;i<k;i++){
if(document.getElementById("op_color_"+i))
document.getElementById("op_color_"+i).style.backgroundColor=colors_stack[i-1];}
for(i=k-1;i>0;i--)
colors_stack[i]=colors_stack[i-1];
colors_stack[0]=color;
if(document.getElementById("op_color_0"))
document.getElementById("op_color_0").style.backgroundColor=colors_stack[0];}
function EnterHexa(color){
if(!color)
return;
color=color.replace(/^\s+|\s+$/g,"");
var expression=/^\#([a-fA-F0-9]{1,3}|[a-fA-F0-9]{6})$/;
if(!color.match(expression))
alert(color+'This is not a valid hexa colour code')
else{
document.getElementById('colo').style.backgroundColor=color;
ManageChangeValue(color,'opcolor','op_color','backgroundColor',0,0,'op_color_');}}
function ReflectValuesFont(class_name,subselect){
fontsize=getCssValue(class_name,"fontSize",blog_ss_id);
fontweight=getCssValue(class_name,"fontWeight",blog_ss_id);
fontstyle=getCssValue(class_name,"fontStyle",blog_ss_id);
fontfamily=getCssValue(class_name,"fontFamily",blog_ss_id);
if(!fontfamily)
fontfamily=document.getElementById(subselect).style.fontFamily;
document.getElementById('size_').value=fontsize;
if(fontweight=='bold')
document.getElementById('bold_').checked=true;
else
document.getElementById('bold_').checked=false;
if(fontstyle=='italic')
document.getElementById('italic_').checked=true;
else
document.getElementById('italic_').checked=false;
fontfamily_r=document.getElementsByName('fontfamily');
var checked_=false;
for(i=1;i<fontfamily_r.length;i++)
if(fontfamily_r[i].value.toLowerCase()==fontfamily.toLowerCase()){
fontfamily_r[i].checked=true;
checked_=1;}
if(!checked_)
fontfamily_r[0].checked=true;}
function ReplaceInInputHidden(field,value_,elem){
expression=new RegExp(field+"\\s*\\:\\s*[^\\;]+\\;");
new_=elem.value.replace(expression,"");
elem.value=new_+field+":"+value_+";";}
function ReflectValuesColor(class_name,property1,property2,elem1,elem2,value_){
if(!value_)
value_=getCssValue(class_name,property2,blog_ss_id);
if(elem1)
elem1.style[property1]=value_;
if(elem2)
elem2.style[property1]=value_;
return value_;}
function ManageChangeValue(value_,select_box,subselect,subselect_property,use_subselect_property,inc,extra_subselect){
i=0;
do{
s=document.getElementById(select_box+i);
if(s&&s.getAttribute)
selected_=s.getAttribute("selected");
if(selected_&&(selected_=='true'||selected_==true||selected_=='selected')){
class_name=s.getAttribute("class_name");
property_name=s.getAttribute("property_name");
d=document.getElementById(subselect+i);
if(d){
if(inc){
value_=parseFloat(getCssValue(class_name,subselect_property,blog_ss_id));
inc=parseFloat(inc);
value_+=inc;
value_+="px";}
else{
if(!subselect_property)
subselect_property=property_name;
d.style[subselect_property]=value_;
if(extra_subselect){
e=document.getElementById(extra_subselect+i);
e.style[subselect_property]=value_;}}}
elem2=document.forms['template']['blog_css['+class_name+']'];
if(use_subselect_property&&subselect_property){
setCssValue(class_name,subselect_property,value_,blog_ss_id);
if(elem2)
ReplaceInInputHidden(subselect_property,value_,elem2);}
else{
setCssValue(class_name,property_name,value_,blog_ss_id);
if(elem2)
ReplaceInInputHidden(property_name,value_,elem2);}}
i++;}while(s&&(selected_!='true'&&selected_!=true&&selected_!='selected'))}
function GetColors(nr_cols){
var colors=new Array(
"#ffffdd","#ffffbb","#eebb77","#dd9955","#ff7722","#bb8833","#994411","#664422","#995511","#ff0000","#770000","#660000",
"#ccddff","#99ccff","#6699ff","#3366cc","#0077bb","#668899","#226688","#336699","#006688","#226688","#003366","#001133",
"#ccff99","#88ff00","#00ff88","#99aa55","#33aa33","#006666","#33bb33","#117744","#116644","#226622","#004433","#113333",
"#ffdddd","#ff77aa","#ff99aa","#cc4499","#991166","#880044","#770099","#6622bb","#6644bb","#775599","#331177","#440055",
"#ffffff","#eeeeee","#cccccc","#aaaaaa","#999999","#888877","#777777","#556666","#555544","#333333","#112222","#000000");
var total=colors.length;
html_="<table>";
for(i=0;i<total;i++){
k=i+1;
start_row=(k%nr_cols==1);
end_row=(k%nr_cols==0);
if(start_row)
html_+="<tr>";
html_+="    <td bgcolor='"+colors[i]+"' style='border: 1px solid #ccc' onclick='new_changes_to_blog=true; ManageChangeValue(\""+colors[i]+"\",\"opcolor\",\"op_color\",\"backgroundColor\",0,0,\"op_color_\"); WriteToHexaInput(\""+colors[i]+"\", \"hexa_dec_\",\"colo\"); //PushColorOnStack(\""+colors[i]+"\");  '>";
html_+="      <img src='/style/default/spacer.gif' style='width:12px; height:12px' />";
html_+="    </td>";
if(end_row)
html_+="</tr>";}
if(!end_row)
html_+="</tr>";
html_+="</table>";
return html_;}
function ManageOptionDiv(elem,event,select_box,class_name_hover,class_name_out,class_name_selected){
if(!class_name_selected)class_name_selected="option_div_selected";
if(!class_name_hover)class_name_selected="option_div_hover";
if(!class_name_out)class_name_selected="option_div";
switch(event){
case 'over':
if(elem&&elem.getAttribute)
selected_=elem.getAttribute("selected");
if(elem&&(!selected_||selected_=="false")){
elem.className=class_name_hover;}
break;
case 'click':{
i=0;
do{
s=document.getElementById(select_box+i);
if(s&&s.id!=elem.id){
s.className=class_name_out;
if(s.setAttribute){
s.setAttribute("selected",'false');
if(s.getAttribute('selected')=='selected')
s.removeAttribute('selected');}}
i++;}while(s);
elem.className=class_name_selected;
elem.setAttribute("selected",true);}
break;
default:
selected_=elem.getAttribute("selected");
if(elem&&(!selected_||selected_=="false"))
elem.className=class_name_out;}}
function ManageTab(tab11,tab21,class1,class_hl,selected_){
switch(selected_){
case 'tab11':
if(document.getElementById(tab11)){
document.getElementById(tab11+"_").style.display='';
document.getElementById(tab11).className=class_hl;}
if(document.getElementById(tab21)){
document.getElementById(tab21+"_").style.display='none';
document.getElementById(tab21).className=class1;}
break;
case 'tab21':
if(document.getElementById(tab11)){
document.getElementById(tab11+"_").style.display='none';
document.getElementById(tab11).className=class1;}
if(document.getElementById(tab21)){
document.getElementById(tab21+"_").style.display='';
document.getElementById(tab21).className=class_hl;}
break;}}
function SetStyleDisplay(elem,value_){
try{
elem.style.display=value_;}catch(e){}}
function ChangeClassName(elem,class_name){
try{
elem.className=class_name;}catch(e){}}
function ChangeInnerHtml(elem,text_){
try{
elem.innerHTML=text_;}catch(e){}}
function sendXMLForm(f,callbackFunc){
var x=$(f);
new Ajax.Request(x.action,{
method:x.method||'get',
parameters:x.serialize(),
onComplete:callbackFunc});}
function sendXMLGetRequest(url,callbackFunc){
var response=sendImmediateReq(url,"");
if(typeof(callbackFunc)=='function')
callbackFunc(response);}
var comment_confirmation_box_timeout;
function quoteManagementConfirm(transport){
var response=transport.responseText;
var responseSplit=response.split(':');
var code=responseSplit.shift();
response=responseSplit.join(':');
switch(code){
case 'OK':
document.getElementById('quotes_container').innerHTML=response;
try{
if(comment_confirmation_box_timeout)
clearTimeout(comment_confirmation_box_timeout);}catch(e){}
try{
comment_confirmation_box_timeout=setTimeout("document.getElementById('comment_confirmation_box').style.display='none'",12000);}catch(e){}
break;
case 'FAIL':
alert(response);
document.getElementById('comment_content').focus();
break;
default:
alert("Unable to send command to server (2)");}}
function getHtmlContent(editor,code_editor,return_){
tinyMCE.execInstanceCommand('mce_editor_'+editor,'mceFocus');
value_=tinyMCE.getContent();
if(return_)
return value_;
if(document.getElementById(code_editor))
document.getElementById(code_editor).value=value_;}
function setMceEditorHtml(newHTML,editor){
tinyMCE.execInstanceCommand('mce_editor_'+editor,'mceFocus');
tinyMCE.execCommand('mceSetContent',false,newHTML);}
function BlogPostSaveHTMLCode(){
var te0=document.getElementById('textarea_html_editor_0').value;
var te1=document.getElementById('textarea_html_editor_1').value;
try{
if(!te0.match(/<(p|br)\s*\/?>/))
te0=te0.replace(/([\r\n]+)/g,'<br>$1');
if(!te1.match(/<(p|br)\s*\/?>/))
te1=te1.replace(/([\r\n]+)/g,'<br>$1');}catch(e){}
setMceEditorHtml(te0,"0");
setMceEditorHtml(te1,"1");}
function ManageChangeEditor(action_){
if(action_=='compose'){
SetStyleDisplay(iframe_1,"none");
SetStyleDisplay(iframe_2,"none");
SetStyleDisplay(textarea_1,"block");
SetStyleDisplay(textarea_2,"block");
SetStyleDisplay(preview_content_,"none");
SetStyleDisplay(summary_desc_,"block");
ChangeClassName(compose_,"blog_edit_menu_hl");
ChangeClassName(edithtml_,"blog_edit_menu");
ChangeClassName(preview_,"blog_edit_menu");
tabs_blogs_posting['compose']="_hl";
tabs_blogs_posting['edithtml']="";
tabs_blogs_posting['preview']="";}
else if(action_=='edithtml'){
getHtmlContent('0',"textarea_html_editor_0");
getHtmlContent('1',"textarea_html_editor_1");
SetStyleDisplay(iframe_1,"block");
SetStyleDisplay(iframe_2,"block");
SetStyleDisplay(textarea_1,"none");
SetStyleDisplay(textarea_2,"none");
SetStyleDisplay(preview_content_,"none");
SetStyleDisplay(summary_desc_,"block");
ChangeClassName(compose_,"blog_edit_menu");
ChangeClassName(edithtml_,"blog_edit_menu_hl");
ChangeClassName(preview_,"blog_edit_menu");
tabs_blogs_posting['compose']="";
tabs_blogs_posting['edithtml']="_hl";
tabs_blogs_posting['preview']="";}
else if(action_=='preview'){
title_=document.add_create_post.blog_post_title.value;
summary_=getHtmlContent('0',"",true);
body_=getHtmlContent('1',"",true);
ChangeInnerHtml(preview_post_title_,title_);
ChangeInnerHtml(preview_post_summary_,summary_);
ChangeInnerHtml(preview_post_body_,body_);
SetStyleDisplay(iframe_1,"none");
SetStyleDisplay(iframe_2,"none");
SetStyleDisplay(textarea_1,"none");
SetStyleDisplay(textarea_2,"none");
SetStyleDisplay(summary_desc_,"none");
SetStyleDisplay(preview_content_,"block");
ChangeClassName(compose_,"blog_edit_menu");
ChangeClassName(edithtml_,"blog_edit_menu");
ChangeClassName(preview_,"blog_edit_menu_hl");
tabs_blogs_posting['compose']="";
tabs_blogs_posting['edithtml']="";
tabs_blogs_posting['preview']="_hl";}}
function ConvertRgbtoHexa(rgb_value,print_alert){
var match=rgb_value.match(/rgb\s*\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)/);
if(match){
hexa_code=from10toradix(match[1],16)+from10toradix(match[2],16)+from10toradix(match[3],16);
return hexa_code;}
else{
if(print_alert)
alert("This is not a valid rgb code");
else
return false;}}
function WriteToHexaInput(color,id_input,color_sample){
color=color.replace(/^\s+|\s+$/g,"");
var expression=/^\#([a-fA-F0-9]{1,3}|[a-fA-F0-9]{6})$/;
if(color.match(expression)){
document.getElementById(id_input).value=color.replace(/\#/,"").toUpperCase();
document.getElementById(color_sample).style.backgroundColor=color;}
else{
if(ConvertRgbtoHexa(color,false)!='NaN'){
document.getElementById(id_input).value=ConvertRgbtoHexa(color,false);
document.getElementById(color_sample).style.backgroundColor=color;}}}
function from10toradix(value,radix){
if(value==0)
return 0;
var retval='';
var ConvArray=new initArray(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F');
var intnum;
var tmpnum;
var i=0;
intnum=parseInt(value,10);
if(isNaN(intnum)){
retval='NaN';}else{
while(intnum>0.9){
i++;
tmpnum=intnum;
retval=ConvArray[tmpnum%radix]+retval;
intnum=Math.floor(tmpnum/radix);
if(i>100){
retval='NaN';
break;}}}
return retval;}
function initArray(){
this.length=initArray.arguments.length;
for(var i=0;i<this.length;i++)
this[i]=initArray.arguments[i];}
function DisplayAll(elem){
if(elem.parentNode.className.match(/expanded/)){
elem.parentNode.className=elem.parentNode.className.replace(/expanded/,'');}
else{
elem.parentNode.className=elem.parentNode.className+' expanded';}}
function getCookie(NameOfCookie){
if(document.cookie.length>0){
begin=document.cookie.indexOf(NameOfCookie+"=");
if(begin!=-1){
begin+=NameOfCookie.length+1;
end=document.cookie.indexOf(";",begin);
if(end==-1)end=document.cookie.length;
return unescape(document.cookie.substring(begin,end));}}
return null;}
function setCookie(NameOfCookie,value,expiredays){
if(expiredays!=null){
var ExpireDate=new Date();
ExpireDate.setTime(ExpireDate.getTime()+(expiredays*24*3600*1000));}
document.cookie=escape(NameOfCookie)+"="+escape(value)+((expiredays==null)?"":"; expires="+ExpireDate.toGMTString());}
function delCookie(NameOfCookie){
if(getCookie(NameOfCookie)){
document.cookie=NameOfCookie+"="+
"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function ManageSelectLabel(elem){
parent_=$(elem.parentNode);
new_folder_name_1=parent_.getElementsBySelector('[type="text"]');
new_folder_name_1=new_folder_name_1[0];
if(elem.value=='new')
new_folder_name_1.show();
else{
new_folder_name_1.hide();
new_folder_name_1.value='';}}
function setCheckboxes(the_form,the_field,do_check){
var elts=document.forms[the_form].elements[the_field];
var elts_cnt=(typeof(elts.length)!='undefined')?elts.length:0;
if(elts_cnt){
for(var i=0;i<elts_cnt;i++)
elts[i].checked=do_check;}
else
elts.checked=do_check;
return true;}
function SetHSign(day_id,month_id,h_sign_id){
day=$(day_id+'');
month=$(month_id+'');
h_sign=$(h_sign_id+'');
d=parseInt(day.value);
m=parseInt(month.value);
var h="";
if((d>0)&&(m>0)){
switch(m){
case 1:if(d>19)h="Aquarius";else h="Capricorn";break;
case 2:if(d>18)h="Pisces";else h="Aquarius";break;
case 3:if(d>20)h="Aries";else h="Pisces";break;
case 4:if(d>19)h="Taurus";else h="Aries";break;
case 5:if(d>20)h="Gemini";else h="Taurus";break;
case 6:if(d>21)h="Cancer";else h="Gemini";break;
case 7:if(d>22)h="Leo";else h="Cancer";break;
case 8:if(d>22)h="Virgo";else h="Leo";break;
case 9:if(d>22)h="Libra";else h="Virgo";break;
case 10:if(d>23)h="Scorpio";else h="Libra";break;
case 11:if(d>21)h="Sagittarius";else h="Scorpio";break;
case 12:if(d>21)h="Capricorn";else h="Sagittarius";break;}
h_sign.value=h;}
else
h_sign.value="";}
function HandleStateApearence(contry_index,state_header,state_body,state_usa_selector,state_canada_selector,zip_input,usa_index,canada_index,disable_selectors){
if(contry_index==usa_index){
if(state_header)
state_header.show();
if(state_body)
state_body.show();
state_usa_selector.value='';
if(disable_selectors)
state_usa_selector.disabled=false;
else
state_usa_selector.show();
state_canada_selector.value='';
if(disable_selectors)
state_canada_selector.disabled=true;
else
state_canada_selector.hide();
if(zip_input)
zip_input.disabled=false;}
else if(contry_index==canada_index){
if(state_header)
state_header.show();
if(state_body)
state_body.show();
state_usa_selector.value='';
if(disable_selectors)
state_usa_selector.disabled=true;
else
state_usa_selector.hide();
state_canada_selector.value='';
if(disable_selectors)
state_canada_selector.disabled=false;
else
state_canada_selector.show();
if(zip_input)
zip_input.disabled=true;}
else{
if(state_header)
state_header.hide();
if(state_body)
state_body.hide();
state_usa_selector.value='';
if(disable_selectors)
state_usa_selector.disabled=true;
else
state_usa_selector.hide();
state_canada_selector.value='';
if(disable_selectors)
state_canada_selector.disabled=true;
else
state_canada_selector.hide();
if(zip_input)
zip_input.disabled=true;}}
function HandleEthnicity(ethnicity_index,ethnicity_other_input,other_index){
ethnicity_other_input.value='';
if(ethnicity_index==other_index)
ethnicity_other_input.show();
else
ethnicity_other_input.hide();}
function UpdateParentMC(who,what){
var i;
var enumer;
enumer="";
for(i=0;i<who.options.length;i++)
if(who.options[i].selected)
enumer=enumer+","+who.options[i].value;
window.opener.document.getElementById(what).value=enumer.substr(1);}
function UpdateParent(who,what){
window.opener.document.forms['form'].elements[what].value=who.getAttribute("value");
window.close();}
function ClearOptions(OptionList,new_option_text){
for(x=OptionList.length;x>=0;x=x-1)
OptionList[x]=null;
if(new_option_text)
OptionList[0]=new Option(new_option_text,"");}
function Redo(){
menubar_=$('menubar');
container_box_=$('container_box');
alt_menubar_=$('alt_menubar');
if(menubar_){
dimensions_menubar=menubar_.getDimensions();
dimensions_container_box=container_box_.getDimensions();
if((dimensions_menubar.height+70)>dimensions_container_box.height)
container_box_.style.height=dimensions_menubar.height+70;
return;}
if(alt_menubar_){
dimensions_alt_menubar=alt_menubar_.getDimensions();
dimensions_container_box=container_box_.getDimensions();
if((dimensions_alt_menubar.height+70)>dimensions_container_box.height)
container_box_.style.height=dimensions_alt_menubar.height+70;
return;}}
function ScrollToElement(elem_id){
elem_q=$(""+elem_id);
elem_q.scrollTo();}
function moveTo(element,x,y){
element.style.left=x+"px";
element.style.top=y+"px";}
function moveNextToElement(elem1,elem2,offset_x,offset_y){
elem1_=$(elem1);
elem2_=$(elem2);
elem2_dimensions=elem2_.getDimensions();
elem2_offsets=Position.positionedOffset(elem2);
elem2_width=parseInt(elem2_dimensions['width']);
elem2_height=parseInt(elem2_dimensions['height']);
elem2_top=parseInt(elem2_offsets[1]);
elem2_left=parseInt(elem2_offsets[0]);
x=elem2_left+elem2_width+offset_x;
y=elem2_top+elem2_height+offset_y;
moveTo(elem1,x,y);}
function ShowCompleteCaptcha(elem,link,captcha_missing_error,captcha_incorrect_error,captcha_server_error,captchatText){
captcha_div_=$('captcha_div');
captcha_img_=$('captcha_img');
captcha_text_=$('captcha_text');
captcha_value_=$('captcha_value');
captcha_button_=$('captcha_button_register');
captcha_button_cancel_=$('captcha_button_cancel');
captcha_error_div_=$('captcha_error_div');
captcha_button_.disabled=captcha_button_cancel_.disabled=captcha_value_.disabled=false;
captcha_button_cancel_.onclick=function(){
captcha_text_.innerHTML='';
captcha_error_div_.innerHTML='';
captcha_error_div_.hide();
captcha_value_.value='';
captcha_div_.hide();}
moveNextToElement(captcha_div_,elem,-40,-10);
captcha_error_div_.hide();
captcha_text_.innerHTML=captchatText;
captcha_img_.src='/visualcode.php?r='+Math.random();
captcha_div_.show();
captcha_value_.value="";
captcha_value_.focus();
captcha_button_.onclick=function(){
if(!captcha_value_.value){
captcha_error_div_.innerHTML=captcha_missing_error+"<br><br>";
captcha_error_div_.show();
captcha_value_.focus();
return;}
captcha_button_.disabled=captcha_button_cancel_.disabled=captcha_value_.disabled=true;
new Ajax.Request('/?page=captcha&captcha_value='+captcha_value_.value,{
method:'post',
onSuccess:function(transport){
if(transport.responseText=='correct'){
captcha_div_.hide();
window.location=link;}
else{
captcha_button_.disabled=captcha_button_cancel_.disabled=captcha_value_.disabled=false;
captcha_value_.value="";
captcha_value_.focus();
captcha_img_.src='/visualcode.php?r='+Math.random();
captcha_error_div_.innerHTML=captcha_incorrect_error+"<br><br>";
captcha_error_div_.show();}},
onFailure:function(transport){
captcha_button_.disabled=captcha_button_cancel_.disabled=captcha_value_.disabled=false;
captcha_error_div_.innerHTML=captcha_server_error+"<br><br>";
captcha_error_div_.show();}});}}
AjaxExecuter=Class.create();
AjaxExecuter.prototype={
initialize:function(url){
this.options={};
this.options.method='get';
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
new Ajax.Request(url,this.options);},
onComplete:function(request){
data_response=request.responseText;
data_response.evalScripts();}};
function CheckInvitations(form_name,nr_min_checked,the_field,check_min_error,check_one_error){
var elts=document.forms[form_name].elements[the_field];
var elts_cnt=(typeof(elts.length)!='undefined')?elts.length:0;
var count_=0;
if(elts_cnt){
for(var i=0;i<elts_cnt;i++)
if(elts[i].checked)
count_++;}
else{
if(elts&&elts.checked)
count_++;}
if(elts_cnt>nr_min_checked&&count_<nr_min_checked){
alert(check_min_error);
return false;}
if(elts_cnt<nr_min_checked&&count_==0){
alert(check_one_error);
return false;}
if(count_>0)
document.forms[form_name].submit();}
function sendEmailVerificationRequest(){
try{
for(var i=0;i<arguments.length;i++)
$(arguments[i]).disabled=true;}catch(e){}
new Ajax.Updater('header','/',{
method:'post',
parameters:{page:'account',area:'access',action:'resend_validation'},
evalScripts:true,
insertion:Insertion.Bottom,
onSuccess:function(transport){
new Effect.Fade('validation_resend');
new Effect.Fade('validation_tooltip');},
onFailure:function(transport){
try{
for(var i=0;i<arguments.list;i++)
$(arguments[i]).disabled=false;}catch(e){}}});}
function startScroller(id,selector,delay){
function showNext(){
var elmts=elmt.getElementsByClassName(cssSelector);
if(currentChild>0){
new Effect.Fade(elmts[0],{fps:10});
new Effect.SlideUp(elmts[0],{
duration:1.2,
fps:10,
afterFinish:function(){
elmt.appendChild(elmt.removeChild(elmts[0]));}});
new Effect.Appear(elmts[1],{fps:10});}else{
currentChild++;
new Effect.Appear(elmts[0],{fps:10});}
if(isRunning)
resumeExecuter();}
function pauseExecuter(){
if(timer)
window.clearTimeout(timer);
isRunning=0;}
function resumeExecuter(){
isRunning=1;
timer=window.setTimeout(showNext,runDelay);}
var elmt=$(id);
var cssSelector=selector;
var lovelyChildren=elmt.getElementsByClassName(cssSelector);
var currentChild=0;
var timer=null;
var isRunning=0;
var runDelay=delay>1500?delay:1500;
if(lovelyChildren.length>0){
showNext();
resumeExecuter();}
elmt.onmouseover=pauseExecuter;
elmt.onmouseout=resumeExecuter;}
function showAddQuotesBox(what){
new Effect.Fade(what);
new Effect.SlideDown('quotes_add',{
afterFinish:function(){
window.setTimeout('$(\'comment_content\').focus()',10);}});}
