function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

function getImage(what) {
  var w = 600;
  var h = 750;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open('/images/' + what,'',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function getWindow(what, w, h) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='status=yes,resizable=yes,scrollbars=yes,height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open(what,'PLATFORM',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function getW(what, w, h) {

  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',scrollbars=yes';
  win=window.open(what,'',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function launchframe(which, type, connection, media) {
      newwin = window.open("media_frame.aspx?movie=" + which + "&type_=" + type + "&connection=" + connection + "&media=" + media, "view","fullscreen=no, scrollbars=no");
}

var win= null;
function launchHelp(){
  var w = 800;
  var h = 625;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open("helppage.swf","helper",settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

/*function getVideo(which) {
  var w = 400;
  var h = 300;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open('/2005/previewFLV.aspx?which=' + which,'FLV',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}*/

function getVideo(which,w, h) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  //win=window.open('/admin/previewFLV.aspx?which=' + which,'FLV',settings + ",fullscreen=no, scrollbars=yes,resizable=1");
  win=window.open('/admin/previewFLV.swf?file=' + which,'FLV',settings + ",fullscreen=no, scrollbars=yes,resizable=1");
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function getVideo2(which) {
  var w = 500;
  var h = 450;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open('media.aspx?url=' + which,'Sundance_Media',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function confirmDelete(varURL)
{
    if (confirm("Are you sure you want to delete this Listing?")) {
        window.location.href = varURL;
        return true;
    } else {
    window.location.reload();
    }

}

function getProject(which) {
  var w = 800;
  var h = 600;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
  win=window.open(which,'SUNDANCE_ONLINE_FILM_FESTIVAL',settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function Screen (){
    //if (MediaPlayer.playState == 3) {
        document.MediaPlayer.DisplaySize=3;
        //}
}
function realFullScreen () {
    document.realOne.SetFullScreen();
}

function ShutMeDown () {
    MediaPlayer.controls.stop();
}

 function doTopNav() {
    var navTag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="630" height="225" id="admin_nav" align="middle">'
    + '<param name="allowScriptAccess" value="sameDomain" />'
    + '<param name="movie" value="/admin/admin_nav.swf" />'
    + '<param name="quality" value="high" />'
    + '<param name="wmode" value="transparent" />'
    + '<param name="bgcolor" value="#ffffff" />'
    + '<embed src="/admin/admin_nav.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="630" height="225" name="admin_nav" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
    document.write(navTag);
 }

function go() {

    document.forms[0].submit();
    /*box = document.forms[0].filter;
    destination = box.options[box.selectedIndex].value;
    if (destination) location.href = destination; */
}

function adjustAffl() {
    //var affl = document.forms[0].affiliationtype;
    //var affltype = affl.options[affl.selectedIndex].value;
    var affltype = document.getElementById( "affiliationtype" ).value;
    if (affltype == "email") {
        document.getElementById( "affiliation" ).value = "PLATFORM Newsletter";
        document.getElementById( "affiliation" ).blur();
    } else if (affltype == "volunteer" || affltype == "staff" || affltype == "passholder" || affltype == "jury") {
        document.getElementById( "affiliation" ).value = "PLATFORM FESTIVAL";
        document.getElementById( "affiliation" ).blur();
    } else {
        document.getElementById( "affiliation" ).value = "";
        document.getElementById( "affiliation" ).focus();
    }
}

function confirmDelete(varURL) {
    if (confirm("Are you sure you want to delete this Listing?")) {
        window.location.href = varURL;
        return true;
    } else {
    window.location.reload();
    }

}

function confirmDeleteAffl(varURL) {
    if (confirm("Are you sure you want to delete this Affiliation?")) {
        window.location.href = varURL;
        return true;
    } else {
    window.location.reload();
    }

}

function confirmLock(varURL) {
    if (confirm("Are you sure you want to LOCK this record?")) {
        window.location.href = varURL;
        return true;
    } else {
    window.location.reload();
    }

}

function confirmLockALL(varURL) {
    if (confirm("Are you sure you want to LOCK ALL?")) {
        window.location.href = varURL;
        return true;
    } else {
    window.location.reload();
    }

}

function  drawFLASH(which, vars, color, w, h) {
    var watchTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'
    + 'id="game" width="' + w + '" height="' + h + '">'
    + '<param name="movie" value="' + which + '"></param>'
    + '<param name="quality" value="high"></param>'
    + '<param name="bgcolor" value="' + color + '"></param>'
    + '<param name="flashvars" value="' + vars + '"></param>'
    + '<embed src="' + which + '" quality="high" bgcolor="' + color + '"  width="' + w + '" height="' + h + '" flashvars="' + vars + '" type='
    + '"application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
    document.write(watchTag);
}

function  drawTrnspFLASH(which, vars, color, w, h, id) {
    var Tag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="' + id + '" align="middle">'
    + '<param name="allowScriptAccess" value="sameDomain" />'
    + '<param name="flashvars" value="' + vars + '"></param>'
    + '<param name="movie" value="' + which + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="' + which + '" quality="high" wmode="transparent" bgcolor="' + color + '" width="' + w + '" height="' + h + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain"  flashvars="' + vars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
    + '</object>';
    document.write(Tag);
}


function doDetectionWindow(which, vars, color, w, h) {
    // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
    var hasProductInstall = DetectFlashVer(6, 0, 65);

    // Version check based upon the values entered above in "Globals"
    var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

    // Location visited after installation is complete if installation is required
    var MMredirectURL = window.location;

    // Stored value of document title used by the installation process to close the window that started the installation process
    // This is necessary to remove browser windows that will still be utilizing the older version of the player after installation is complete
    // DO NOT MODIFY THE FOLLOWING TWO LINES
    document.title = document.title.slice(0, 47) + " - Welcome.";
    var MMdoctitle = document.title;

    // Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
    if ( hasProductInstall && !hasReqestedVersion ) {
        alert("Attempting install of upgrade ... ");
        var productInstallOETags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
        + 'width="235" height="510"'
        + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
        + '<param name="movie" value="playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=ActiveX&MMdoctitle='+MMdoctitle+'" />'
        + '<param name="quality" value="high" /><param name="bgcolor" value="#' + color + '" />'
        + '<embed src="playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=PlugIn" quality="high" bgcolor="#' + color + '" '
        + 'width="' + w + '" height="' + h + '" name="detectiontest" aligh="middle"'
        + 'play="true"'
        + 'loop="false"'
        + 'quality="high"'
        + 'allowScriptAccess="sameDomain"'
        + 'type="application/x-shockwave-flash"'
        + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
        + '<\/embed>'
        + '<\/object>';
        document.write(productInstallOETags);   // embed the Flash Product Installation SWF
    } else if (hasReqestedVersion) {  // if we've detected an acceptable version
        //alert("Curent version is installed ... ");
        var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
        + 'width="' + w + '" height="' + h + '"'
        + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
        + '<param name="movie" value="' + which + '" /><param name="quality" value="high" /><param name="bgcolor" value="#' + color + '" />'
        + '<param name="flashvars" value="' + vars + '"></param>'
        + '<embed src="' + which + '" quality="high" bgcolor="#' + color + '" '
        + 'width="' + w + '" height="' + h + '" name="player" aligh="middle"'
        + 'play="true"'
        + 'loop="false"'
        + 'quality="high" flashvars="' + vars + '"'
        + 'allowScriptAccess="sameDomain"'
        + 'type="application/x-shockwave-flash"'
        + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
        + '<\/embed>'
        + '<\/object>';
        document.write(oeTags);   // embed the Flash Content SWF when all tests are passed
      } else {  // flash is too old or we can't detect the plugin
        var alternateContent = 'Alternate HTML content should be placed here.'
        + 'This content requires the Macromedia Flash Player.'
        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
        document.write(alternateContent);  // insert non-flash content
      }

  }

function go()   {
    //box = document.forms[0].artist;
    //destination = box.options[box.selectedIndex].value;
    //if (destination) location.href = destination;
    document.selectpost.submit();
}


    function VerifySave(){
        if( confirm( "Save now?" ) ){
            document.post.submit();
        }
    }


     function VerifyDelete(){
        if( confirm( "Delete this Post?" ) ){
            document.deleteMe.submit();
        }
    }

     function New(){
        location.href = "admin.php";
    }
