function loadContent(act,id){ document.getElementById('frameContent').src='content.php?act='+act+'&id='+id;}
function verifyName(showMessageIfOK)
{ xajax_verifyUserNameAlreadyExists(xajax.getFormValues("UserForm"),showMessageIfOK); return false;}
function verifyForgotPasswordForm()
{ xajax_forgotPassword(xajax.getFormValues("ForgotForm")); return false;}
function verifyInfo()
{ xajax_verifyUserInfo(xajax.getFormValues("UserForm")); if (document.UserForm.allow.value != 1) { return false;}
return true;}
function CheckPersonalAdUpload() { 
 xajax_checkPersonalAdUpload(xajax.getFormValues("add_personal_ad_form")); return false;
}
function changeProfileStatus(id, status) { xajax_changeProfileStatus(id, status); return true;}
function changeRateProfile(id, can_rate) { xajax_changeRateProfile(id, can_rate); return true;}
function mypopup() { mywindow = window.open("forgot.php","mywindow","location=0,status=0,scrollbars=0,width=300,height=280"); mywindow.moveTo(200,200);}
function check_form(){ if (!document.loginform.username.value) { document.getElementById('div_username').style.display = 'block'; return false;}else{document.getElementById('div_username').style.display = 'none';}
if (!document.loginform.password.value) {document.getElementById('div_password').style.display = 'block'; return false;}else{document.getElementById('div_password').style.display = 'none';}
return true;}
function check_contact_form(frm) { var prefix0 = 'get_'; var input_array = new Array('email','subject','message'); var error_array = new Array('Email','Subject','Message'); for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' cannot be empty '); frm.elements[source].focus(); return false;}
}
adresse = frm.get_email.value; var place = adresse.indexOf("@",1); var point = adresse.indexOf(".",place+1); if ((place > -1)&&(adresse.length >2)&&(point > 1)) { } else { alert('Please enter valid Email Address'); frm.get_email.focus(); return false;}
return true;}
function confirm_del_account(reply) { if(reply) { location.href = "myaccount.php?act=delete_account"; return true;}
return false;}
function verify(ver, userId){ if(ver){ setCookie('page_come_from', location.href); location.href = 'myaccount.php?act=block_user&id='+userId; return true;}else{ }
return false;}
function showCommentForm() { el_form = document.getElementById('comment_form'); el_link = document.getElementById('comment_form_link'); el_form_display = el_form.style.display; el_link_display = el_link.style.display; el_form.style.display = el_link_display; el_link.style.display = el_form_display;}
function check_comment_form(frm) { if (!frm.get_comment.value) { alert("You must enter a comment!"); return false;} else { return true;}
}
function clear_field(field) { field.value = "";}
function copy_clipboard(text2copy) { if (window.clipboardData) { window.clipboardData.setData("Text",text2copy);} else { var flashcopier = 'flashcopier'; if(!document.getElementById(flashcopier)) { var divholder = document.createElement('div'); divholder.id = flashcopier; document.body.appendChild(divholder);}
document.getElementById(flashcopier).innerHTML = ''; var divinfo = new SWFObject('_clipboard.swf', 'copy_contents', '0', '0', '4'); divinfo.addVariable('clipboard', escape(text2copy)); divinfo.write(flashcopier);}
}
function process_div(num) { name = "div"+num; div = document.getElementById(name); if (div.style.display == "block") { div.style.display = "none"; setCookie("show"+num,"");} else { div.style.display = "block"; setCookie("show"+num,"1");}
}
function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "")
if ((name + "=" + escape(value)).length <= 4000)
document.cookie = curCookie
else
if (confirm("Cookie will be deleted!"))
document.cookie = curCookie
}
function getCookie(name) { var prefix = name + "="
var cookieStartIndex = document.cookie.indexOf(prefix)
if (cookieStartIndex == -1)
return null
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
if (cookieEndIndex == -1)
cookieEndIndex = document.cookie.length
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
function show_story_long(id, flag) { name_small = "story_small_"+id; name_long = "story_long_"+id; div_small = document.getElementById(name_small); div_long = document.getElementById(name_long); if (flag == '1') { div_small.style.display = "none"; div_long.style.display = "block";} else { div_long.style.display = "none"; div_small.style.display = "block";}
}
function postComment(id){ if (document.layer1_form.get_comment.value == "") return false; comment = document.layer1_form.get_comment.value; xajax_post_comment(comment, id); xajax_print_item_comments('1',id); return false;}
function postProfileComment(ref_account, ref_profile){ if (document.layer1_form.get_comment.value == "") return false; comment = document.layer1_form.get_comment.value; setCookie('nwComment', comment); setCookie('nwProfile', ref_profile); xajax_post_comment(); xajax_print_profile_comments('1',ref_account); return false;}
function replyPersonalAd(id, ref_user){ if (document.layer1_form.get_message.value == "") return false; message = document.layer1_form.get_message.value; ad_title = document.layer1_form.get_ad_title.value; arr = new Array; arr = [{'message':message,'title':ad_title,'id':id, 'ref_user':ref_user}]; xajax_replyAd(arr); return false;}
function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}
function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
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_swapImage() { var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function top_nav_select(el, img) { el.style.backgroundImage = "url(" + img + ")"; return false;}
function showImage(file_path) { document.getElementById('main_image').src = file_path; return false;}
function showInvite() {
   var res;
   res = hs.htmlExpand(document.getElementById('invite_show'), 
    { contentId: 'highslide-html-invite', 
      objectWidth: 100, 
      objectHeight: 30
    } );
   return false;
}

function hideInvite() {
   return hs.close(document.getElementById('invite_hide'));
}

function saveOrderDB(ai) {
  var elem = document.getElementById('pic-spread');
  var a = document.getElementsByTagName('LI');
  var qStr = '';
  j = 0;
  for (var i=0; i < a.length; i++)
  {
    if (a[i].id) {
       qStr += friend_position_start + (j+1)+','+a[i].id+'|';
       j++;
    }
  }
  location.href = 'myaccount.php?act=save_friends_order&q='+qStr+'&ref_owner='+ai;
}
