function showaccounts(record) {
var locator="?record="+record;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content-box").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","access_results.php"+locator,true);
xmlhttp.send();
}

function updatemm(record) {
var locator="?mmcode="+record;

xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("comments-photo-column").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","mmpics.php"+locator,true);
xmlhttp.send();

/* xmlhttp2=new XMLHttpRequest();
xmlhttp2.onreadystatechange=function()
  {
  if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
    {
    document.getElementById("comments-video-column").innerHTML=xmlhttp2.responseText;
    }
  }
xmlhttp2.open("POST","mmvideos.php"+locator,true);
xmlhttp2.send(); */
}

function updatevideos(record) {
var locator="?mmcode="+record;

xmlhttp2=new XMLHttpRequest();
xmlhttp2.onreadystatechange=function()
  {
  if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
    {
    document.getElementById("comments-video-column").innerHTML=xmlhttp2.responseText;
    }
  }
xmlhttp2.open("POST","mmvideos.php"+locator,true);
xmlhttp2.send();
}

function getlist(group){
var locator="?group="+group;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("memberlist-box").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","membership-list.php"+locator,true);
xmlhttp.send();
}



function validateForm()
{
var f1=document.getElementById('fname').value;
var f2=document.getElementById('lname').value;
var f3=document.getElementById('referral').value;
var f4=document.getElementById('address1').value;
var f5=document.getElementById('orgcity').value;
var f6=document.getElementById('orgstate').value;
var f7=document.getElementById('orgpostcode').value;
var f8=document.getElementById('orgcountry').value;
var f9=document.getElementById('orgmail1').value;
var f10=document.getElementById('org_type').value;

var atpos=f9.indexOf("@");
var dotpos=f9.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=f9.length)
  {
  alert("Please enter a valid primary e-mail address.");
  return false;
  }
else if (
	f1=="" ||
	f2=="" ||
	f3=="" ||
	f4=="" || 
	f5=="" ||
	f6=="" ||
	f7=="" ||
	f8=="" ||
	f10==""
	)
  {
  alert("One or more required fields is blank.");
  return false;
  }
else 
  {
  document.forms["newmemberform"].submit();
  return true;
  }
}



function fadeout() {
	$('#profile-container').fadeOut('slow');
	$('#container-overlay').fadeIn('slow');
}

function fadeout2() {
	$('#list-container').fadeOut('slow');
	$('#container-overlay').fadeIn('slow');
}

function fadein() {
	$('#profile-container').fadeIn('slow');
	$('#container-overlay').fadeOut('slow');
}

function fadein2() {
	$('#list-container').fadeIn('slow');
	$('#container-overlay').fadeOut('slow');
}


function fillbox(record) {
var locator="?record="+record;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("databox").innerHTML=xmlhttp.responseText;
    document.getElementById("databox").style.display="block";
    var fadeElement = new Spry.Effect.Fade("databox", {duration:500, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST","profile-typea.php"+locator,true);
xmlhttp.send();
}

function closebox(){
	var finalclose = 'document.getElementById("databox").style.display="none"';
	var fadeElement = new Spry.Effect.Fade("databox", {duration:500, from:100, to:0, toggle:false});
    fadeElement.start();
	window.setTimeout(finalclose,500);
}

function playvid(record){
var locator="?record="+record;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("playerbox").innerHTML=xmlhttp.responseText;
    document.getElementById("playerbox").style.display="block";
    fadeout();
    var fadeElement = new Spry.Effect.Fade("playerbox", {duration:200, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST","playvideo.php"+locator,true);
xmlhttp.send();
}

function closevideo(){
$('#playerbox').fadeOut('slow');
fadein();
}

function closepic(){
$('#photobox').fadeOut('slow');
$('#profile-container').fadeIn('slow');
}

function showpic(record){
var locator="?record="+record;
$('#profile-container').fadeOut('slow');
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("photobox").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","../showphoto.php"+locator,true);
xmlhttp.send();
$('#photobox').fadeIn('slow');
}

function mmshowpic(record){
var locator="?record="+record;
$('#list-container').fadeOut('slow');
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("photobox").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","../mmshowphoto.php"+locator,true);
xmlhttp.send();
$('#photobox').fadeIn('slow');
}

function closepic2(){
$('#photobox').fadeOut('slow');
$('#list-container').fadeIn('slow');
}


function pagepop(content){
var getpage=content+".html";
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("pagebox").innerHTML=xmlhttp.responseText;
    document.getElementById("pagebox").style.display="block";
    }
  }
xmlhttp.open("POST",getpage,true);
xmlhttp.send();
$('#pagebox').fadeIn('slow');

}


function closepagepop(){
$('#agebox').fadeOut('slow');
}



function confirmdelete(record){

var locator="?record="+record;

xmlhttp=new XMLHttpRequest();

xmlhttp.onreadystatechange=function()

  {

  if (xmlhttp.readyState==4 && xmlhttp.status==200)

    {

    document.getElementById("editbox").innerHTML=xmlhttp.responseText;

    document.getElementById("editbox").style.display="block";

    var fadeElement = new Spry.Effect.Fade("editbox", {duration:200, from:0, to:100, toggle:false});

    fadeElement.start();

    }

  }

xmlhttp.open("POST","deleterecord.html"+locator,true);

xmlhttp.send();

}



function closeeditbox(){

	var finalclose = 'document.getElementById("editbox").style.display="none"';

	var fadeElement = new Spry.Effect.Fade("editbox", {duration:200, from:100, to:0, toggle:false});

    fadeElement.start();

	window.setTimeout(finalclose,200);

}


function deletelink(linkid){
var locator="?record="+linkid;
var r=confirm("Are you sure you want to delete this link?");
if (r==true)
{
  window.document.location.href = 'deletelink.php'+locator;
}
adminpage('linkadmin');
}

function deletevid(linkid){
var locator="?record="+linkid;
var r=confirm("Are you sure you want to delete this video?");
if (r==true)
{
  window.document.location.href = 'video_remover.php'+locator;
}
adminpage('video_delete');
}

function deletepic(linkid){
var locator="?record="+linkid;
var r=confirm("Are you sure you want to delete this photo?");
if (r==true)
{
  window.document.location.href = 'photo_remover.php'+locator;
}
adminpage('photo_delete');
}

function editlink(linkid){
var locator="?record="+linkid;
window.document.location.href = 'editlinks.php'+locator;
adminpage('linkadmin');
}

function adminpage(item){
var locator=item+".php";
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("adminbox").innerHTML=xmlhttp.responseText;
    document.getElementById("adminbox").style.display="block";
    var fadeElement = new Spry.Effect.Fade("adminbox", {duration:500, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST",locator,true);
xmlhttp.send();
}

function closeadminpage(){
	var finalclose = 'document.getElementById("adminbox").style.display="none"';
	var fadeElement = new Spry.Effect.Fade("adminbox", {duration:200, from:100, to:0, toggle:false});
    fadeElement.start();
	window.setTimeout(finalclose,200);
}

function editpage(item){
var locator=item+".php";
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("editbox").innerHTML=xmlhttp.responseText;
    document.getElementById("editbox").style.display="block";
    var fadeElement = new Spry.Effect.Fade("editbox", {duration:500, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST",locator,true);
xmlhttp.send();
}

function closeeditpage(){
	var finalclose = 'document.getElementById("editbox").style.display="none"';
	var fadeElement = new Spry.Effect.Fade("editbox", {duration:200, from:100, to:0, toggle:false});
    fadeElement.start();
	window.setTimeout(finalclose,200);
}

function getpage(name)
{
  var page=name+".php";
  window.document.location.href = page;
}

function upgrade(type)
{
  var page="membership-upgrade2.php?type=" + type;
  window.document.location.href = page;
}

function newmember(type)
{
  var page="membership-new1.php?type=" + type;
  window.document.location.href = page;
}

function showprofile(record)
{
  var locator="?record="+record;
  window.document.location.href = "public-profile-page.php"+locator,true;
}

function adminprofile(record)
{
  var locator="?record="+record;
  window.document.location.href = "cfprofile.php"+locator,true;
}

function showhiddenprofile(record)
{
  var locator="?record="+record;
  window.document.location.href = "hidden-profile-page.php"+locator,true;
}

function showdssprofile()
{
  window.document.location.href = "dss-profile-page.php",true;
}

function floatbox(record,e){
var rec=record;
var locator='?record='+record;
var l=0;
var t=0;
var posx=0;
var posx=0;


jQuery(document).ready(function(){

   $(document).mousemove(function(e){}); 

})

/* posx=e.pageX-50;

posy=e.pageY-30; */
posx=2;
posy=2;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("hoverfloat").innerHTML=xmlhttp.responseText;
    document.getElementById("hoverfloat").style.display="block";
    var fadeElement = new Spry.Effect.Fade("hoverfloat", {duration:100, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST","floatpopup2.php"+locator,true);
off=$("#hoverfloat").width();
    l=posx + 'px';
	t=posy + 'px';
    document.getElementById("hoverfloat").style.left=l;
    document.getElementById("hoverfloat").style.top=t;
xmlhttp.send();
}

function closefloatbox(){
	var finalclose = 'document.getElementById("hoverfloat").style.display="none"';
	var fadeElement = new Spry.Effect.Fade("hoverfloat", {duration:100, from:100, to:0, toggle:false});
    fadeElement.start();
	window.setTimeout(finalclose,100);
}

function showlist(record){
var locator="?record="+record;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content-box").innerHTML=xmlhttp.responseText;
    document.getElementById("content-box").style.display="block";
/*    var fadeElement = new Spry.Effect.Fade("content-box", {duration:500, from:0, to:100, toggle:false});
    fadeElement.start(); */
    }
  }
xmlhttp.open("POST","search_results.php"+locator,true);
xmlhttp.send();
}

function playvid2(record){
var locator="?record="+record;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("playerbox").innerHTML=xmlhttp.responseText;
    document.getElementById("playerbox").style.display="block";
    var fadeElement = new Spry.Effect.Fade("playerbox", {duration:200, from:0, to:100, toggle:false});
    fadeElement.start();
    }
  }
xmlhttp.open("POST","playvideo2.php"+locator,true);
xmlhttp.send();
}

function closevideo2(){
	var finalclose = 'document.getElementById("playerbox").style.display="none"';
	var fadeElement = new Spry.Effect.Fade("playerbox", {duration:200, from:100, to:0, toggle:false});
    fadeElement.start();
	window.setTimeout(finalclose,200);
}


