function cropOpen() {
imgSrc = document.getElementById('logo').src;
window.open( "upload_crop.php?thumbdim=100&limg=new.jpg&imgsrc="+imgSrc, "myWindow",
"status = 1, height = 600, width = 600, resizable = 0" )
}

function submitNewClub(){
    document.getElementById('imgsrc').value = document.getElementById('logo').src;
    document.getElementById('newclub').submit();
        
}



function viewProfile(formCount,memberId){
    document.getElementById('approvalForm'+formCount).action = "member?name="+memberId;
    document.getElementById('approvalForm'+formCount).submit();
}


function viewBalletStatus(formCount,activityId){
    //window.open( "viewactivitystatus?aid="+activityId, "myWindow",
        //"status = 1, height = 600, width = 600, resizable = 0" );
    document.getElementById('approvalForm'+formCount).action = "viewactivitystatus?aid="+activityId;
    document.getElementById('approvalForm'+formCount).submit();
}

function approveActivity(){
    //alert('hello');
    document.getElementById('approvalForm').action = "../handler/approveactivity";
    document.getElementById('approvalForm').submit();
   //window.close();
}

function acceptBallet(formCount,approvalid){
    document.getElementById('approvalForm'+formCount).action = "../handler/acceptballet?aid="+approvalid;
    document.getElementById('approvalForm'+formCount).submit();
}

function doTest(){
       document.getElementById('myForm').action = "member?name=cccccc";
       document.getElementById('myForm').submit();
}



function doAccept(formCount){
    document.getElementById('approvalForm'+formCount).action = "../handler/acceptinbord"
    document.getElementById('approvalForm'+formCount).submit();
}
function cropAavtarOpen(){
    imgSrc = document.getElementById('logo').src;
    window.open( "upload_crop.php?thumbdim=50&limg=new.jpg&imgsrc="+imgSrc, "myWindow",
    "status = 1, height = 600, width = 600, resizable = 0" )
}


function viewBoardRequestStatus(rStatus,cName,message){

    window.open("requeststatus?status=" +rStatus+"&cname="+cName+"&message="+message,"","status = 1, height = 200, width = 600");
    //window.open( "signup.php", "myWindow",
    //"status = 1, height = 600, width = 600, resizable = 0" )
}

function viewBalletRequestStatus(rStatus,rSubject){

    window.open("requeststatus?status=" +rStatus+"&message=5006&subject="+rSubject,"","status = 1, height = 200, width = 600");
    //window.open( "signup.php", "myWindow",
    //"status = 1, height = 600, width = 600, resizable = 0" )
}

function viewDiscussionRequestStatus(rStatus,rTopic){

    window.open("requeststatus?status=" +rStatus+"&message=5007&subject="+rTopic,"","status = 1, height = 200, width = 600");
}

function bLogoOpen(){
    imgSrc = document.getElementById('logo').src;
    window.open( "upload_crop.php?thumbdim=250&limg=new.jpg&imgsrc="+imgSrc, "myWindow",
    "status = 1, height = 800, width = 800, resizable = 1, SCROLLING =yes")
}

function submitNewBallet(){
    document.getElementById('imgsrc').value = document.getElementById('logo').src;
    document.getElementById('newballet').submit();

}



function submitSignup(){
    document.getElementById('imgsrc').value = document.getElementById('logo').src;
    document.getElementById('signup').submit();

}

function signIn(){
    w  = 600;
    h = 300;
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    var targetWin = window.open ("signin", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}


function submitSignin(){
     document.getElementById('signinForm').submit();
}

function signInFromIndex(){
    w  = 600;
    h = 400;
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    var targetWin = window.open ("view/signin", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

var TimeToFade = 1000.0;
function fade(eid)
{
  var element = document.getElementById(eid);
  if(element == null)
    return;

  if(element.FadeState == null)
  {
    if(element.style.opacity == null
        || element.style.opacity == ''
        || element.style.opacity == '1')
    {
      element.FadeState = 2;
    }
    else
    {
      element.FadeState = -2;
    }
  }

  if(element.FadeState == 1 || element.FadeState == -1)
  {
    element.FadeState = element.FadeState == 1 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
  }
  else
  {
    element.FadeState = element.FadeState == 2 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade;
    setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33);
  }
}
function  animateFade(lastTick, eid)
{
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;

  var element = document.getElementById(eid);

  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = '
        + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    return;
  }

  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';

  setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
}


