Readystate for OS X?

Does any one know of any program out there that is the equivalent of readystate for windows, that would work with OS X. readystate is if you think back to being in school where the admin has the computer to completely reset it self to its original state when you reboot it any thing that was changed like the dock or a app trashed or files moved is reset back the way it was originally.
I work for a mac reseller and I basically am the IT guy for the mac department (not officially I sell them too but the real IT guy doesn't do anything as far as the floor models so...) I want to be able to have a single state for every floor model i have that will revert back to its original state at the end of the night (we get customers that trash apps like iphoto and media that is on them a lot. IUt gets really annoying when you want to demo some thing and its not there cus some one trashed it. Now i have tried the Guest Account, that how ever only resets the home folder it wont reset the dock or any settings that are changed. If i do a simple finder option that makes it so i can't demo what the dock does and mess around with it. I want the system to be flexible but go back the way it should be at the end of the night.
Any help would be greatly appreciated.

matajuro wrote:
Does any one know of any program out there that is the equivalent of readystate for windows, that would work with OS X. readystate is if you think back to being in school where the admin has the computer to completely reset it self to its original state when you reboot it any thing that was changed like the dock or a app trashed or files moved is reset back the way it was originally.
I work for a mac reseller and I basically am the IT guy for the mac department (not officially I sell them too but the real IT guy doesn't do anything as far as the floor models so...) I want to be able to have a single state for every floor model i have that will revert back to its original state at the end of the night (we get customers that trash apps like iphoto and media that is on them a lot. IUt gets really annoying when you want to demo some thing and its not there cus some one trashed it. Now i have tried the Guest Account, that how ever only resets the home folder it wont reset the dock or any settings that are changed.
No, guest account resets everything, including the dock. when you log out of a guest account the guest account home directory gets erased. all dock modifications are stored in the home directory so they get erased along with it.
Guest account is exactly what you are looking for.

Similar Messages

  • Very poor implementation of XMLHttpRequest streaming with Safari for Window

    I hope this post reaches Apple engineers. This is critical for us to resolve this. I am a member of the developer network, so if using incident support is necessary, it can be used. Do not hesitate to contact me with any questions. I have implemented a test to compare XMLHttpRequest streaming performance for different browsers. Safari for Windows 5.0.3 had the worst results compared to Chrome and Firefox. Furthermore, I think this problem was introduced after Safari 3. The test consists of a server pushing messages of about 350 bytes to the browser at a rate of about 300/s. Once server pushes 10,000 messages, it closes the connection and browser opens new one repeating the cycle. There were several problems associated with Safari: 1) Safari could not process much more then 300 messages/s, that is quite low. Chrome had no problem processing 1,000. If, for example, 500 m/s was used, Safari would quickly allocate hundreds of meg of memory and crash. 2) Safari starts with about 64MEG of memory allocated. Once the test page is opened, memory quickly climes to 150MEG and as test progresses to >400MEG. Once the connection closes, it drops to 150MEG again. Chrome's memory did not fluctuate at all staying at 32MEG for the same test. 3) CPU was steadily claiming as test progressed and then dropped as connection was reset, creating CPU spikes. It reached about 50% CPU before connection was closed. Chrome's CPU stayed at about 2% all the time. This is the code: Server. Should be run with the latest Java Tomcat 7. Configure Tomcat to use Http11NioProtocol: package test; import java.io.IOException; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.catalina.comet.CometEvent; import org.apache.catalina.comet.CometProcessor; @SuppressWarnings("serial") public class WebFrameworkServletXHRReconnects extends HttpServlet implements CometProcessor { @Override public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); HttpServletResponse response = event.getHttpServletResponse(); if (event.getEventType() == CometEvent.EventType.BEGIN) { System.out.println("Begin for session: " + request.getSession(true).getId() + " " + response.getWriter()); response.setHeader("pragma", "no-cache,no-store"); response.setHeader("cache-control", "no-cache,no-store,max-age=0,max-stale=0"); event.setTimeout(Integer.MAX_VALUE); PrintWriter out = response.getWriter(); SimpleDateFormat formatter = new SimpleDateFormat("mm:ss: "); for (int i = 0; i < 10000; i++) { out.print("{\"messageType\":8448,\"requestId\":"0",\"eventType\":1,\"symbolId\" :[\"BAC.EA\",0],\"fields\":[{\"header\":"0",\"type\":6,\"data\":[3993,2]},{\"hea der\":"55",\"type\":6,\"data\":[1185,2]},{\"header\":54,\"type\":6,\"data\":[321 8,2]},{\"header\":"5",\"type\":6,\"data\":[6617,2]},{\"header\":52,\"type\":4,\" data\":[15]},{\"header\":"12",\"type\":6,\"data\":[1700,2]}]}"); out.flush(); if (i % 10 == 0) { try { //Thread.sleep(60); Thread.sleep(30); } catch (InterruptedException e) { } } if (i % 100 == 0) { System.out.println(formatter.format(new Date()) + i); } } out.close(); event.close(); } else if (event.getEventType() == CometEvent.EventType.ERROR) { event.close(); } else if (event.getEventType() == CometEvent.EventType.END) { event.close(); } } } client: <script type="text/javascript" src="log4js.js">
    </script>
    <script type="text/javascript">
    var api;
    var log = new Log(Log.DEBUG, Log.popupLogger);
    var byteoffset;
    var perocessedMessages;
    function connect() {
    perocessedMessages = 0;
    byteoffset = 0;
    id = 0;
    api = new XMLHttpRequest;
    api.onreadystatechange = onreadystatechange;
    api.onerror = onerror;
    log.debug('connect');
    api.open("GET", "http://localhost/Test/Controller", true);
    api.send("");
    function onreadystatechange() {
    switch (api.readyState) {
    case 3:
    change();
    break;
    case 4:
    disconnect();
    break;
    function change() {
    connected = true;
    var buffer = api.responseText;
    var newdata = buffer.substring(byteoffset);
    byteoffset = buffer.length;
    while (1) {
    var x = newdata.indexOf("<activ>");
    if (x != -1) {
    y = newdata.indexOf("</activ>", x);
    if (y != -1) {
    processMessage(newdata.substring((x + 7), y));
    newdata = newdata.substring(y + 8);
    else {
    break;
    else {
    break;
    byteoffset = buffer.length - newdata.length;
    function processMessage(msg) {
    var objJson = eval('(' + msg + ')');
    perocessedMessages++;
    //if (perocessedMessages % 100 == 0) {
    // log.debug('' + perocessedMessages);
    function disconnect() {
    log.debug('disconnect');
    connect();
    function onerror() {
    log.debug('onerror');
    </script>

    I hope this post reaches Apple engineers. This is critical for us to resolve this. I am a member of the developer network, so if using incident support is necessary, it can be used.
    We're a user-to-user forum, ilyag. So it'd be better for you to use the Apple Bug Reporter if you want to ensure someone from Apple sees your post:
    http://developer.apple.com/bugreporter/

  • Help required for using ajax in netweaver

    Hi..
    Can i Use Ajax for my netweaver applications?? If yes, then how?? Any pointers regarding that will be adequately rewarded points..
    Thanks

    For pure JavaScript enabled AJAX application, no problem. You just write the application as usual and send XMLHttpRequest with parameters to server, then update the web page with your JavaScript code;
    I can show you some sample code here:
    <script type="text/javascript">
            function createXMLHttpRequest() {
                 var xmlHttp;
                if (window.ActiveXObject) {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                else if (window.XMLHttpRequest) {
                        xmlHttp = new XMLHttpRequest();
                return xmlHttp;
            function onclick_changeModelHouse(id) {
                var xmlHttp = createXMLHttpRequest();
                xmlHttp.onreadystatechange = function(){
                     if(xmlHttp.readyState == 4) {
                          if(xmlHttp.status == 200) {
                               // here you get your page component with id or any you like,
                                    // then update it with data returned from the request you sent;
                                   // Here I update one image url path;
                                  var img = document.getElementById("houseModel");
                                   // suppose you return the image file name;
                         img.innerHTML="<img src='images/" + xmlHttp.responseText +  "'>";
                xmlHttp.open("GET", "http://myserver:8080/myApp//AjaxImageService?model="+id, true);
                xmlHttp.send(null);
    </Script>
    For some button in your page you add javascript code like
    onClick="onclick_changeModelHouse(id)"
    somthing.
    You need develop servlet to response your request, and usually you need pass back your data in XML format, here I just use plain text for easy understanding.

  • Startup shell script help for newbie?

    New to UNIX (linux)... need the bash shell script commands for my r.c local file to start my services when server boots.
    I got my ds, dps and admin server in their respective /opt directories. I need the shell commands to have these start. Of course I can start them manually but when I try a line like this in a script, it doesnt work:
    ./var/opt/sun/directory-server/slapd-dsserver/start-dsserver
    Some path problem or dot thing?

    There are a few other things you may want to consider, such as what the default browser is, are tabs being used, is the page loaded yet, etc, but Safari has a do javascript command in it's scripting dictionary. The following script will open a new document and run your specified javascript, or you can go to their NPR Program Stream Page and download a playlist that will run directly from iTunes.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 335px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set my_script to "NPR.Player.openPlayer(2, 0, '03-21-2008', NPR.Player.Action.PLAY_NOW, NPR.Player.Type.PROGRAM, NPR.Player.Mode.LIVE)"
    tell application "Safari"
    activate
    set the URL of the front document to "http://www.npr.org/"
    if my page_loaded(20) is false then error numner - 128 -- page not loaded in time
    do JavaScript my_script in document 1
    end tell
    on page_loaded(timeout_value) -- from http://www.apple.com/applescript/archive/safari/jscript.01.html
    delay 2
    repeat with i from 1 to the timeout_value
    tell application "Safari"
    if (do JavaScript "document.readyState" in document 1) is "complete" then
    return true
    else if i is the timeout_value then
    return false
    else
    delay 1
    end if
    end tell
    end repeat
    return false
    end page_loaded
    </pre>

  • Ajax:callback function not called for every readystatechange of the request

    Author: khk Posts: 2 Registered: 2/17/06
    Feb 17, 2006 11:04 PM
    Hi
    I am working with an ajax program.
    In that i have defined a callback funtion
    but that function is not being called for every readystatechange of the request object for the first request .
    but it is working fine from the second request.
    function find(start,number){
    var nameField=document.getElementById("text1").value;
    var starting=start;
    var total=number;
    if(form1.criteria[0].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("exact")+"&param4="+escape(starting)+"&param5="+escape(number));
    else if(form1.criteria[2].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("prefix")+"&param4="+escape(starting)+"&param5="+escape(number));
    http.onreadystatechange = callback2;
    http.send(null);
    function callback2(){
    if (http.readyState == 4) {//request state
    if(http.status==200){
    var message=http.responseXML;
    alert(http.responseText);
    Parse2(message);
    }else{
    alert("response is not completed");
    }else{
    alert("request state is :-"+http.readyState);
    }

    Triple post.
    You have been answered here: http://forum.java.sun.com/thread.jspa?threadID=709676

  • Set desktop wallpaper based on screen resolution for both WinXP and Win7

    I'm hoping someone can answer this for me. I would like to be able to set the desktop wallpaper based on the current screen resolution when a user logs in. I've made several .BMP files for varying resolutions with our corporation logo. But, say
    if a wallpaper for a resolution of 1024x768 on a 4:3 monitor is set, then that monitor is replaced with a 16:10 monitor with a resolution of 1280x800 or 1600x900, the wallpaper looks stretched out and ugly. The only way to change it is manually on
    each computer, but most end users (students) would not have permissions to do so.
    I thought this question would have been asked before, but after many, many searches, I've only come across one reference that copies the background from a network share to a location on the local computer, which I found
    here. In my case, the file will already be on the local computer, but I am not sure how to force the system to change the wallpaper based on the current screen resolution. I'm sure it is possible and maybe I am overlooking something very simple. I
    was also thinking that this would either happen only once on first login or maybe based on user authentication (which group the user belongs to) so that teachers are still able to change their wallpaper, but students would not be able to.
    If it helps, I will be deploying the image using MDT 2010 Update 1. The same base image will be used on multiple machine types (HP desktop sand laptops and Lenovo desktops) which could have one of 6-7 different monitor types connected. I'd also like
    this to happen on the local machine instead of GPO or logon script as there is already a lot happening there.
    I would need to be able to do this for both Windows XP Pro and Windows 7 Ent x64. The XP machines will mostly have 4:3 monitors, but there are exceptions.
    Maybe what I am asking isn't entirely possible or possible at all. I, unfortunately, am in the extremely early stages of learning Microsoft Scripting (VBScript and PowerShell) to use with MDT 2010, so I know next to nothing when it comes to these scripting
    processes, but am willing to try and learn.
    Any help anyone can suggest, I would be extremely grateful.

    I almost abandoned this because I thought it was going to interfere with using BGInfo. But, as it turns out, I was able to incorporate the running of BGInfo into a script that I
    created. And, once I saw what 16:10 Aspect Ratio background looked like on a 16:9 Aspect Ratio screen, I was not satisfied.
    I happened to use the first script that MkShffr posted from geekshangout.com, but then I added more items to it. I also created three high-res wallpaper backgrounds as suggested
    by pagerwho.
    My script is based on the Aspect Ratio of the current resolution. Since most, if not all, systems will get the resolution set during deployment, this was easy to calculate.
    And by forcing the output of the Aspect Ratio to two decimal places, I just used a Case statement to select which aspect ratio to choose from and apply the wallpaper assigned to it. I thought about using If Then statements, but I think the Case statement
    is much cleaner.
    And, because BGInfo wants to change the Picture Position to "Tile" instead of "Fit" that I manually set it to in my image, I added two reg key change lines per Case. BGInfo still
    changes the Picture Position to "Tile", but for whatever reason, this works. I tested this by using a laptop with a 16:9 Aspect Ratio screen. In my image, I manually set a 16:10 wallpaper because that will be the primary Aspect Ratio used in our corporation,
    however we are getting more 16:9 Aspect Ratio laptops and from what HP is saying, everything will be standardizing on this Aspect Ratio.
    I made sure the Screen profile that I saved in my image was loaded which includes the 16:10 wallpaper. I then placed this script in the “C:\ProgramData\Wallpaper_Change”
    directory that I created in the image. I then added a registry value in HKLM\System\Microsoft\Windows\CurrentVersion\Run and created a String Value. I did this so that it would run at log in, but I didn't want it to show in the Startup Folder in the All Programs
    Menu. It takes less than a second to run, but it seems to work well. I tested it several time to see if there were any anomalies, but it seemed to work great each time. I have yet to test it with a computer that is on the domain with a regular user account,
    which I will be doing in the next day or two.
    In the mean time, if someone want to try it out and see if it works from thier use, here is the code. I did comment out the wscript.echos, but left them in to use for troubleshooting
    in the future.
    -Mike
    ==============================
    Option Explicit
    Dim array_ScreenRes, screenRes_X, screenRes_Y, oIE, width, height, aspect_ratio
    Dim decpos, wallpaper1, wallpaper2, wallpaper3, oShell
    array_ScreenRes = GetScreenResolution
    screenRes_X = array_ScreenRes(0)
    screenRes_Y = array_ScreenRes(1)
    wallpaper1="C:\Windows\Web\Wallpaper\TSC\Win 7 - 2560 x 1440 (16-9)TSC.bmp"
    wallpaper2="C:\Windows\Web\Wallpaper\TSC\Win 7 - 2560 x 1600 (16-10)TSC.bmp"
    wallpaper3="C:\Windows\Web\Wallpaper\TSC\Win 7 - 2560 x 1920 (4-3)TSC.bmp"
    Set oShell = CreateObject("Wscript.Shell")
    'wscript.echo "Resolution is " & screenRes_X & "x" & screenRes_Y
    aspect_ratio = screenRes_X/screenRes_Y
    decpos=instr(aspect_ratio,".")+2
    aspect_ratio=left(aspect_ratio,decpos)
    'wscript.echo "Aspect Ratio is " & aspect_ratio
    Select Case aspect_ratio
    Case "1.77"
     oShell.RegWrite("HKCU\Control Panel\Desktop\Wallpaper"), wallpaper1
     oShell.RegWrite("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource"), wallpaper1
     oShell.RegWrite("HKCU\Control Panel\Desktop\TileWallpaper"), "0"
     oShell.RegWrite("HKCU\Control Panel\Desktop\WallpaperStyle"), "6"
    Case "1.6"
     oShell.RegWrite("HKCU\Control Panel\Desktop\Wallpaper"), wallpaper2
     oShell.RegWrite("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource"), wallpaper2
     oShell.RegWrite("HKCU\Control Panel\Desktop\TileWallpaper"), "0"
     oShell.RegWrite("HKCU\Control Panel\Desktop\WallpaperStyle"), "6"
    Case "1.33"
     oShell.RegWrite("HKCU\Control Panel\Desktop\Wallpaper"), wallpaper3
     oShell.RegWrite("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource"), wallpaper3
     oShell.RegWrite("HKCU\Control Panel\Desktop\TileWallpaper"), "0"
     oShell.RegWrite("HKCU\Control Panel\Desktop\WallpaperStyle"), "6"
    End Select
    oShell.Run "%windir%\System32\RUNDLL32.exe user32.dll,UpdatePerUserSystemParameters", 1, True
    oShell.Run "C:\ProgramData\BGInfo\BGInfo.exe C:\ProgramData\BGInfo\TSC.bgi /timer:0"
    Function GetScreenResolution()
     Set oIE = CreateObject("InternetExplorer.Application")
     With oIE
        .Navigate("about:blank")
        Do Until .readyState = 4: wscript.sleep 100: Loop
        width = .document.ParentWindow.screen.width
        height = .document.ParentWindow.screen.height
     End With
     oIE.Quit
     GetScreenResolution = array(width,height)
    End Function

  • Hi all send me the implementation idea for the post

    Hello all
    Iam developing an application which takes a video file as an input.and all the functionality is to be carried by ajax.
    The request will go to struts and there it generate thumbnails of that particular video in a folder on a server.
    And my task is to display the images exactly in the page where i have uploaded a video.Suppose iam uploaded a video on a Login.jsp file and i have to show all the thumbnails on the same page.
    Plz anyone can help me.
    I would appreciate u if u do so.........
    Thanks in advance

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <script type="text/javascript">
    var xmlHttp;
    function createXmlHttpRequest()
         //For IE
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         //otherthan IE
    else if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
    //Next is the function that sets up the communication with the server.
    function startRequest()
    // alert("pppppp");
    xmlHttp=createXmlHttpRequest();
    //alert("k");
    var video=document.getElementById("video").value;
    xmlHttp.open("POST","CheckAvailability.do",true);
    xmlHttp.onreadystatechange=handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    // xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
    xmlHttp.send("video="+video);
    //This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
    function handleStateChange()
    var message=" ";
    if(xmlHttp.readyState==4)
    if(xmlHttp.status==200)
    document.thumbs.results.value=video;
    else
    alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
    </script>
    </HEAD>
    <BODY>
    <center>
    <form name="thumbs" method="post" enctype="multipart/form-data" action=" ">
    Userid <input type="file" name="video" id="video" onChange="startRequest();"/>
    <br>
    <br>
    <input type="text" id="results"/>
    </form>
    </BODY>
    </HTML>
    This is my images.jsp page through which i can upload a video file for which i have to get the thumbnails.
    Iam making an ajax call and forwarding the request to this struts.
    package actions;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import java.sql.*;
    import java.util.*;
    import com.oreilly.servlet.MultipartRequest;
    public class CheckAvailability extends Action {
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException {
              /*String targetId = request.getParameter("video1");
              System.out.println("targetId " + targetId);
              PrintWriter out = response.getWriter();
              out.println("Meera");
              String uploadDirName="";
              String encodedDirName="";
              uploadDirName = getServlet().getServletContext().getRealPath("/");
              System.out.println("uploadDirName"+uploadDirName);*/
              /*Connection con;
              Statement stmt;
              ResultSet rs;
              String xmlString=null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
         con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","cmsws","system");
                   stmt=con.createStatement();
                   rs=stmt.executeQuery("select * from employee where empno=");
                        if(rs.next()){
                        xmlString=rs.getString(2)+","+rs.getInt(3);
                        else
                             xmlString ="0,0,0";
              catch(Exception e1){
                   e1.printStackTrace();
              String inputvideo=request.getParameter("video");
              System.out.println("inputvideo is "+inputvideo);
    //The below commented lines produce thumbnails for the uploaded input video.
    //But the thing is that iam not receiving the response at Login.jsp page can u plz help me.
         /*     String contextPath = "";
              String contextPath1 = "";
              String uploadFile = "";
              String[] index = null;
              try {
                   contextPath1 = request.getContextPath();
                   System.out.println(contextPath1 );
                   uploadDirName = getServlet().getServletContext().getRealPath(
                             "/upload"); //$NON-NLS-1$
                   System.out.println("upload" + uploadDirName);
                   encodedDirName = getServlet().getServletContext().getRealPath(
                             "/encoder"); //$NON-NLS-1$
                   System.out.println("encodedDirName" + encodedDirName);
                   contextPath = getServlet().getServletContext().getRealPath("/");
                   System.out.println("multipart request");
                   MultipartRequest multi = new MultipartRequest(request,
                             uploadDirName, 100 * 1024 * 1024, "ISO-8859-1"); //$NON-NLS-1$
                   Enumeration params = multi.getParameterNames();
                   while (params.hasMoreElements()) {
                        String name = (String) params.nextElement();
                        System.out.println("name" + name);
                        index = multi.getParameterValues(name);
                   Enumeration files = multi.getFileNames();
                   while (files.hasMoreElements()) {
                        String name = (String) files.nextElement();
                        File f = multi.getFile(name);
                        if (f != null) {
                             uploadFile = f.toString();
                             System.out.println("uploaded file name" + uploadFile);
                   String[] str = new String[] { contextPath + "/ffmpeg", "-r", "1",
                             "-i", uploadFile, "-r", "0.1", "-ss", "00:00:05", "-y", "-s",
                             "120x80", contextPath + "/gen_images/test%3d.jpg" };
                   ProcessBuilder pb = new ProcessBuilder(str);
                   pb.redirectErrorStream(true);
                   Process p = pb.start();
                   InputStream is = p.getInputStream();
                   InputStreamReader isr = new InputStreamReader(is);
                   BufferedReader br = new BufferedReader(isr);
                   String ss = br.readLine();
                   while (ss != null) {
                        // System.out.println(ss);
                        ss = br.readLine();
                        pb.redirectErrorStream(true);
                   File folder = new File(contextPath + "/gen_images/");
                   File[] listOfFiles = folder.listFiles();
                   List imageList = new ArrayList();
                   int noofimages=listOfFiles.length;
                   System.out.println("noofimages is "+noofimages);
                   for (int i = 0; i < listOfFiles.length; i++) {
                        if (listOfFiles.isFile()) {
                             String fileAbsolutePath = contextPath1 + "/gen_images/"
                                       + listOfFiles[i].getName();
                             System.out.println(fileAbsolutePath);
                             imageList.add(fileAbsolutePath);
                        } else if (listOfFiles[i].isDirectory()) {
                             System.out.println("Directory " + listOfFiles[i].getName());
                   request.setAttribute("imageList", imageList);
              } catch (Exception e) {
                   e.printStackTrace();
    response.setContentType("text/xml");
    response.setHeader("Cache-Control","no-cache");
    PrintWriter out=response.getWriter();
              if (inputvideo != null)
                   //response.getWriter().write("<valid>true</valid>");
                   //response.getWriter().write(inputvideo);
                   //response.getWriter().println("<valid>true12</valid>");
                   //response.setCharacterEncoding("UTF-8");
                   //System.out.println("zeera");
                   //System.out.println("zeera1");
                   //response.getWriter().write("imageList");
                   //response.getWriter().write("You have successfully made Ajax Call:");
                   request.setAttribute("inputvideo",inputvideo);
                   //out.println(inputvideo);
              } else {
                   //response.setContentType("text/xml");
                   //response.setHeader("Cache-Control", "no-cache");
                   //response.getWriter().write("imageList");
                   //response.getWriter().write("<valid>false</valid>");
                   //response.getWriter().write("<valid1>true1</valid1>");
                   out.println(inputvideo+"meera");
              return mapping.findForward("thumbscreated");

  • Tagging panelAccordion content for web analytics

    We have a panelAccordion component which contains a few showDetailItem components. At a time, only the data against the "*disclosed*" showDetailItem is available in the source(final html rendered). When a showDetail item is disclosed, the new content gets retrieved by the component dynamically using some inbuilt ajax calls . At the same time, the content associated with the showDetail item that gets automatically hidden (undisclosed) gets wiped out from the source (as seen in firebug). The requirement is to track (for web analytics) any "link click" from within such content. The approach adopted by us consists of searching for links when the DOM has loaded successfully (readystate) and adding an additional click attribute which would invoke our custom javascript methods responsible for tracking. But as the entire content under the panelAccordion does not come up in the source at any instant, this approach has been rendered useless.
    Is there any way to invoke a method when such a showDetailItem has been rendered asynchronously? I am able to capture the link which triggers the "_disclosure_" event. But this does not help as the updated content is yet to be rendered at this instant.

    Look at this:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ff/48f039e50a4e4ce10000000a114084/frameset.htm
    Hope it helps.
    Regards

  • AJAX Help needed for an AJAX noob

    Hey there,
    I'm starting to experiment with AJAX for simple form
    validation but am having great difficulty in getting the following
    working.
    I'm trying to get it to count the length of a field, and
    respond back to an id'd span. It works if I hard code the span id
    into the JS file, but not if I try and implement a variable to have
    the span id passed into.
    I have attached the code. If someone could take a look and
    point out where I'm going wrong, that would be greatly appreciated.
    Cheers in advance,
    Brad

    > In the mean time, if anyone can point out why passing
    the span id to the
    > stateChanged function causes the xmlHttp.readyState to
    always stay at 0,
    > that
    > would be very useful!
    You can't pass an argument to a callback function like that.
    You can create
    your own callback function and set it up inside a calling
    function so that
    the argument is not lost:
    var xmlHttp
    function processRemote(callback, str) {
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) {
    alert ('Browser does not support HTTP Request');
    return;
    var url='/includes/ajax/ajax_validate.asp';
    url=url+"?val="+str;
    url=url+"&sid="+Math.random();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange=function() {
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    var temp = new Array();
    temp.push(xmlHttp.responseText);
    callback.apply(callback,temp);
    xmlHttp.send(null);
    function GetXmlHttpObject() {
    var objXMLHttp=null;
    if (window.XMLHttpRequest) {
    objXMLHttp=new XMLHttpRequest();
    else if (window.ActiveXObject) {
    objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
    return objXMLHttp;
    function checkElement(str, spanid) {
    if (str.length==0) {
    document.getElementById(spanid).innerHTML="";
    return;
    var callback = function(str) {
    document.getElementById(spanid).innerHTML=str;
    var result = processRemote(callback, str);
    That should work.
    Tom Muck
    co-author Dreamweaver MX 2004: The Complete Reference
    http://www.tom-muck.com/
    Cartweaver Development Team
    http://www.cartweaver.com
    Extending Knowledge Daily
    http://www.communitymx.com/

  • Spinning/loading image for ajax call

    Hi,
    Is there any way to display a spinning/loading image (the usual one that you see on many Ajax Websites) before getting the result in the following ajax call?
    Thanks.
    Andy
    <script type="text/javascript">
    function getUserList() {
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getUsers',0);
    ajaxRequest.add('P2_LAST_NAME',html_GetElement('P2_LAST_NAME').value);
    ajaxRequest.add('P2_FIRST_NAME',html_GetElement('P2_FIRST_NAME').value);
    ajaxResult = ajaxRequest.get();
    if (ajaxResult)
    {html_GetElement('UserListDiv').innerHTML = ajaxResult}
    else
    {html_GetElement('UserListDiv').innerHTML = 'null'}
    ajaxRequest = null;
    </script>

    the CPU time is on the DB/application server site.
    here are the codes (on page 40):
    1.) page HTML header:
    <script language="JavaScript" type="text/javascript">
    <!--
    function f_TestOnDemand(){
         var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=40processlong',0);
    get.add('P40_TEMP_ITEM',html_GetElement('P40_TEST').value)
         get.GetAsync(f_AsyncReturn);
         get = null;
    function f_AsyncReturn(){
              if(p.readyState == 1){
                   html_GetElement('P40_TEXT_DROP').value = '';
                   html_ShowElement('AjaxLoading');
              }else if(p.readyState == 2){
              }else if(p.readyState == 3){
              }else if(p.readyState == 4){
                   html_GetElement('P40_TEXT_DROP').value = p.responseText;
         html_HideElement('AjaxLoading');
              }else{return false;}
    //-->
    </script>
    2.) on apge footer text:
    <div id="AjaxLoading" style="display:none;">..Loading..
    <img src="#IMAGE_PREFIX#/processing3.gif" /></div>
    3.) onDemand process:
    declare
    l_counter number;
    l_o_name varchar2(2000);
    begin
    htp.prn('<body>'||chr(10));
    for i in 1..5000 loop
    htp.prn('<payload id="test'||i||'">'||i||':'||v('P40_TEMP_ITEM')||'</payload>'||chr(10));
    end loop;
    htp.prn('</body>');
    end;
    4.) a html region is created with three items : p40_temp_item, p40_test, and p40_text_drop. a SEND button created in the region with URL target "javascript:f_TestOnDemand();"
    so the content from P40_TEST does go to P40_TEXT_DROP (with process wrapped info) and the "loading..." is gone also, if I input the text in the P40_TEST field and click "Send" again, it still works, but I can not move to other pages under the same tab set, and at this moment, the CPU is go very higher by the process.
    I can not see any leak around these code. it should go back to normal after "Send".
    Thank you.
    Jim

  • Ajax for Flash in IE problem

    Currently I'm doing a project that requires to deploy ajax
    with a Flash object. I use the fscommand for Flash to communicate
    with javascript in order to do the Ajax.
    I create a flash file name ask.fla. In the file I make a
    button and add the script for it like this:
    on(press)
    fscommand ("send_var", 1);
    I have read in the manual of Flash how to make flash
    communicate with javascript, and I have configure the publish
    setting of HTML file to run "Flash with FSCommand" .
    I have another 2 files namely: ask.php and ask_get.php.
    The content of the ask.php file is:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>ask</title>
    </head>
    <body bgcolor="#ffffff"
    onload="makeRequest('ask_get.php','?test=10');">
    <script language="JavaScript">
    <!--
    var isInternetExplorer =
    navigator.appName.indexOf("Microsoft") != -1;
    // Handle all the FSCommand messages in a Flash movie.
    function ask_DoFSCommand(command, args) {
    var askObj = isInternetExplorer ? document.all.ask :
    document.ask;
    alert("HELLO");
    var http_request = false;
    function makeRequest(url, parameters) {
    http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
    http_request.overrideMimeType('text/html');
    } else if (window.ActiveXObject) { // IE
    try {
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    http_request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {}
    if (!http_request) {
    alert('Cannot create XMLHTTP instance');
    return false;
    http_request.onreadystatechange = alertContents;
    http_request.open('GET', url + parameters, true);
    http_request.send(null);
    function alertContents() {
    if (http_request.readyState == 4) {
    if (http_request.status == 200) {
    result = http_request.responseText;
    document.getElementById('myspan').innerHTML = result ;
    } else {
    alert('There was a problem with the request.');
    if (navigator.appName &&
    navigator.appName.indexOf("Microsoft") != -1 &&
    navigator.userAgent.indexOf("Windows") != -1 &&
    navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<script language=\"VBScript\"\>\n');
    document.write('On Error Resume Next\n');
    document.write('Sub ask_FSCommand(ByVal command, ByVal
    args)\n');
    document.write(' Call ask_DoFSCommand(command, args)\n');
    document.write('End Sub\n');
    document.write('</script\>\n');
    //-->
    </script>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <div name="myspan" id="myspan"></div>
    </body>
    </html>
    The content of the ask_get.php is:
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
    id="ask" width="462" height="410" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="ask.swf" /><param
    name="quality" value="high" /><param name="bgcolor"
    value="#ffffff" /><embed src="ask.swf" quality="high"
    bgcolor="#ffffff" width="462" height="410" swLiveConnect=true
    id="ask" name="ask" align="middle" allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>
    The purpose of the two file is that when the file ask.php is
    called, the code in the even <body onload> will call the
    makeRequest function, which replate the <div name="myspan"
    id="myspan"> with the code in the file ask_get.php, so that the
    flash object is embed indirectly in the file.(but it will be shown,
    and some how I use it to make the ajax for the page).
    When I run the file ask.php in my webserver in Mozilla
    FireFox, it run well, the flash file can call the javascript
    function, but when I run the file ask.php in IE, the flash file can
    not do anything, it can not call the javascript function.
    You can check this by running the file ask.php in both
    FireFox and IE in your webserver (IIS or Apache).
    If the code to embed the swf object in php file is written
    directly in the very php file the swf object can contact with
    javascript very well and correctly
    , as you can test it by running the file ask1.php in both IE
    and FireFox in your webserver (IIS or Apache) , when you click the
    button, it will show you the message "HELLO" which is call from a
    javascript function.
    Here is the code of the file ask1.php, which embed the flash
    object directly in the php file and it works well in both FireFox
    and IE:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>ask</title>
    </head>
    <body bgcolor="#ffffff"
    onload="makeRequest('ask_get.php','?test=10');">
    <script language="JavaScript">
    <!--
    var isInternetExplorer =
    navigator.appName.indexOf("Microsoft") != -1;
    function ask_DoFSCommand(command, args) {
    var askObj = isInternetExplorer ? document.all.ask :
    document.ask;
    alert("HELLO");
    if (navigator.appName &&
    navigator.appName.indexOf("Microsoft") != -1 &&
    navigator.userAgent.indexOf("Windows") != -1 &&
    navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<script language=\"VBScript\"\>\n');
    document.write('On Error Resume Next\n');
    document.write('Sub ask_FSCommand(ByVal command, ByVal
    args)\n');
    document.write(' Call ask_DoFSCommand(command, args)\n');
    document.write('End Sub\n');
    document.write('</script\>\n');
    //-->
    </script>
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
    id="ask" width="462" height="410" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="ask.swf" /><param
    name="quality" value="high" /><param name="bgcolor"
    value="#ffffff" /><embed src="ask.swf" quality="high"
    bgcolor="#ffffff" width="462" height="410" swLiveConnect=true
    id="ask" name="ask" align="middle" allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>
    </body>
    </html>
    The problem is when I call an object by replacing the <div
    id=...> with the code for the flash object from the ask_get.php
    file, only FireFox can call the javascript but IE does not.
    So anyone who know the reason why, please tell me. Thank you
    very much.

    Be sure your HTML wrapper is embedding the flash object correctly in IE. In all other browsers it can be embedded as an object of a specific type. IE has always required a separate install of an activeX with a certain CLSID.
    Look up SWFObject and use that to embed your SWF to be sure that it's being embedded properly for each browser, or use the HTML generated by flash and make sure your publish settings that you have "FSCommand" selected in the drop-down so flash can talk to the browser.

  • Return values for WebEngine's ExecuteScript function?

    Hey guys and gals,
    I'm trying to write some code to load a webpage and get some values from the POST header, but unfortunately I'm having trouble with the basics.
    I can't get the executeScript function to return a JSObject! I'm having no luck finding what the executeScript function decides to return based on input. Every time I run the Java code, executeScript returns me the value of the POSTresponses variable as a String. Or it return
    Any suggestions of what could be happening?
    Error message:
    "java.lang.ClassCastException: java.lang.String cannot be cast to netscape.javascript.JSObject"
    Portion of Java file:
    public void changed(ObservableValue ov, State oldState, State newState) {
           Document document;
                                JSObject returnObject;
                                if(newState == State.SUCCEEDED) {
                                    document = webEngine.getDocument();
                                    if(document != null) {
                                        returnObject = (JSObject)webEngine.executeScript(receivedPostJs);
    Entire Javascript file:
    function getPostResponses() {
        var requestHandler = new XMLHttpRequest();
        var POSTresponses;
        if (requestHandler.readyState == 0) {
            POSTresponses = "Nada";
        } else if (requestHandler.readyState == 1) {
            POSTresponses = "Still nuthin";
        } else if (requestHandler.readyState == 2) {
            POSTresponses = requestHandler.getAllResponseHeaders();

    HI,
    I think one good approach could be generate a table API to perform the tasks that you want (insertion, select, update, delete) and put all of these procedures in a package. Each procedure has a return code (0 if succesful for example or the SQLCODE) and a message of the result of the operation ('Success' or the SQLERRM).
    Regards,

  • Dashcode Widget for 'URL'

    In Dashcode [latest version of xCode] I have created a widget which when 'Run' in Dashcode opens the Webpage. When dragged into iBooks Author as a URL Widget and tested in iBooks Author it will open the Webpage when loaded onto the 'First Generation' iPad in Preview mode and you tap on the Icon/Image a grey screen opens and top left the 'X' to close and nothing else happens.
    This is the code for the event handler in the Widget.
    function myClickHandler(event)
    // Values you provide
    var websiteURL = "http://en.wikipedia.com/wiki/Air_New_Zealand"; // replace with the website URL to show
    // Show website code
    widget.openURL(websiteURL);
    If required I can post all the code however I thought that would not be necessary given that the above is the only changes I have made.
    Help is always appreciated.. Ant

    Thanks for that information but I have not been able to progress my issue. Perhaps you could send me a working example of the dashcode and I test it to see if it works on my iPad - iBooks Author. It would then be a simple process for me to change the URL [http://] at least it will determine where the point of failure is..... my address is [email protected]..
    And these are a copy of the code:
    This file was generated by Dashcode. 
    You may edit this file to customize your widget or web page
    according to the license.txt file included in the project.
    // Function: load()
    // Called by HTML body element's onload event when the widget is ready to start
    function load()
        dashcode.setupParts();
    // Function: remove()
    // Called when the widget has been removed from the Dashboard
    function remove()
        // Stop any timers to prevent CPU usage
        // Remove any preferences as needed
        // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey("your-key"));
    // Function: hide()
    // Called when the widget has been hidden
    function hide()
        // Stop any timers to prevent CPU usage
    // Function: show()
    // Called when the widget has been shown
    function show()
        // Restart any timers that were stopped on hide
    // Function: sync()
    // Called when the widget has been synchronized with .Mac
    function sync()
        // Retrieve any preference values that you need to be synchronized here
        // Use this for an instance key's value:
        // instancePreferenceValue = widget.preferenceForKey(null, dashcode.createInstancePreferenceKey("your-key"));
        // Or this for global key's value:
        // globalPreferenceValue = widget.preferenceForKey(null, "your-key");
    // Function: showBack(event)
    // Called when the info button is clicked to show the back of the widget
    // event: onClick event from the info button
    function showBack(event)
    //    var front = document.getElementById("front");
    //    var back = document.getElementById("back");
    //    if (window.widget) {
    //        widget.prepareForTransition("ToBack");
    //    front.style.display = "none";
    //    back.style.display = "block";
    //    if (window.widget) {
    //        setTimeout('widget.performTransition();', 0);
    // Function: showFront(event)
    // Called when the done button is clicked from the back of the widget
    // event: onClick event from the done button
    function showFront(event)
        var front = document.getElementById("front");
        var back = document.getElementById("back");
        if (window.widget) {
            widget.prepareForTransition("ToFront");
        front.style.display="block";
        back.style.display="none";
        if (window.widget) {
            setTimeout('widget.performTransition();', 0);
    if (window.widget) {
        widget.onremove = remove;
        widget.onhide = hide;
        widget.onshow = show;
        widget.onsync = sync;
    function myClickHandler(event)
      // Values you provide
    var websiteURL = "http://en.wikipedia.com/wiki/Air_New_Zealand";          // replace with the website URL to show
    // Show website code
    widget.openURL(websiteURL);
    And
    This file was generated by Dashcode and is covered by the
    license.txt included in the project.  You may edit this file,
    however it is recommended to first turn off the Dashcode
    code generator otherwise the changes will be lost.
    var dashcodePartSupport = { "imageBgParts": {} };
    if(!window.dashcode){dashcode=new Object()}dashcode.setupParts=function(){if(dashcode.setupParts.called){return }dashcode.setupParts.called=true;var H=[];if(window.dashcodeDataSources&&!dashcode.inDesign){for(var C in dashcodeDataSources){var E=dashcodeDataSources[C];var A=dashcode.setupDataSource(C,E);if(A){A.registerWithName(C)}}}for(var C in dashcodePartSpecs){dashcode.preProcessBindings(dashcodePartSpecs[C])}if(!DC.Sup port.BorderImage){var G=dashcodePartSupport.imageBgParts;for(var B in G){var D=G[B];Element.set3PiecesBorderImage(document.getElementById(B),D[0],D[1],D[2]) }}for(var C in dashcodePartSpecs){var E=dashcodePartSpecs[C];var F=dashcode.setupPart(C,E.creationFunction,E.view,E);if(F&&F.finishLoading){H[H. length]=F}}for(var I=0;I<H.length;I++){H[I].finishLoading()}};dashcode.setupPart=function(elementO rId,creationFunction,viewClass,specDict,relativeController){var object=null;var createFunc=window[creationFunction];var node=elementOrId;if(elementOrId.nodeType!=1){node=document.getElementById(eleme ntOrId)}if(!node){return null}if(createFunc){object=createFunc(node,specDict)}else{var viewClass=null;object=DC.View.fromNode(node);if(object){return object}if(specDict.view){viewClass=eval(specDict.view)}if(dashcode.inDesign){da shcode.preProcessBindings(specDict)}if(!viewClass){viewClass=DC.View.viewClassFo rNode(node,specDict.hasBindings)||DC.View}object=new (viewClass)(node,relativeController,specDict.propertyValues,specDict);node.obje ct=object}return object};dashcode.setupDataSource=function(identifier,specDict){var dsClass=null;var dataSource=null;try{dsClass=specDict.Class?eval(specDict.Class):null}catch(e){} if(!dsClass){console.error("Couldn't create data source "+identifier+". Invalid class specified.");return null}var propertyValues=specDict.propertyValues;dataSource=new dsClass(propertyValues);return dataSource};dashcode.getDataSource=function(A){return DC.dataModel.valueForKey(A)};dashcode.preProcessBindings=function(A){if(A&&A.pr opertyValues&&!A.hasBindings){for(p in A.propertyValues){if(-1!==p.search(/Binding$/)){A.hasBindings=true;if(dashcode. inDesign){delete A.propertyValues[p]}else{break}}}}};if(window.addEventListener){window.addEvent Listener("load",dashcode.setupParts,false)}else{if(window.attachEvent){window.at tachEvent("load",dashcode.setupParts)}}dashcode.getLocalizedString=function(A){t ry{A=localizedStrings[A]||A}catch(B){}return A};dashcode.createInstancePreferenceKey=function(A){return widget.identifier+"-"+A};dashcode.getElementHeight=function(B){var A=B.offsetHeight;if(!A||A==0){A=dashcode.getElementSize(B).height}return A};dashcode.getElementWidth=function(B){var A=B.offsetWidth;if(!A||A==0){A=dashcode.getElementSize(B).width}return A};dashcode.getElementSize=function(B){var A=dashcode.getElementSizesWithAncestor([B],B);return A[0]};dashcode.getElementSizesWithAncestor=function(A,F){if(A.length<1){return[ ]}var B=new Array();var C=A[0].offsetWidth;if(!C||C==0){var G=F;while(G&&(G!=document)){var I=Element.getStyles(G,"display");var H=(I)?I:G.style.display;if((I&&H=="none")||(!I&&H!="block")){B.push({node:G,dis play:G.style.display});G.style.display="block"}G=G.parentNode}}var J=new Array();for(var E=0;E<A.length;E++){J.push({width:A[E].offsetWidth,height:A[E].offsetHeight})}f or(var E=0;E<B.length;E++){var D=B[E].node;D.style.display=B[E].display;if(D.getAttribute("style")==""){D.remo veAttribute("style")}}return J};dashcode.getElementDocumentOffset=function(B){var C=B.offsetParent;var D={x:B.offsetLeft,y:B.offsetTop};if(C){var A=dashcode.getElementDocumentOffset(C);D.x+=A.x;D.y+=A.y}return D};dashcode.pointInElement=function(A,E,D){var C=dashcode.getElementSize(D);var B=dashcode.getElementDocumentOffset(D);if(A>=B.x){if(A>B.x+C.width){return false}if(E>=B.y){if(E>B.y+C.height){return false}}else{return false}}else{return false}return true};dashcode.cloneTemplateElement=function(B,A,C){return DC.View.cloneViewsForTreeNode(B,C,null)};dashcode.processClonedTemplateElement= function(D,C,B,F,E,A){console.error("dashcode.processClonedTemplateElement is no longer available.")};var setupParts=dashcode.setupParts;var getLocalizedString=dashcode.getLocalizedString;var createInstancePreferenceKey=dashcode.createInstancePreferenceKey;var getElementHeight=dashcode.getElementHeight;var getElementWidth=dashcode.getElementWidth;var getElementSize=dashcode.getElementSize;if(!("querySelector" in document)){document.write('<script apple-no-regeneration="yes" type="text/javascript" src="../Parts/core/external/sizzle_c.js"><\/script>')};if("undefined"!==typeof (DC)){throw new Error("Library module (DC) already defined")}var DC={version:"@VERSION@",revision:"@REVISION@",generateUid:(function(){var A=0;return function(){return ++A}})()};DC.Browser={IE:!!(window.attachEvent&&!window.opera)&&(function(){var B=/MSIE (\d+)/;var A=B.exec(navigator.userAgent);return A&&parseInt(A[1],10)})(),Safari:navigator.userAgent.indexOf("AppleWebKit/")>-1, Safari2:(function(){var A=/AppleWebKit\/(\d+(?:\.\d+)?)/;var B=A.exec(navigator.userAgent);return(B&&parseInt(B[1],10)<420)})(),Mozilla:navi gator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,Mo bileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)};DC.Support={Pro perties:("__defineGetter__" in Object.prototype),QuerySelector:("querySelector" in document),Touches:!!document.createTouch,CSS3ColorModel:false,CSSTransitions:fa lse,BorderImage:(function(){var A=document.createElement("div").style;A.cssText="-webkit-border-image: inherit; -moz-border-image: inherit;";return(A.WebkitBorderImage=="inherit")||(A.MozBorderImage=="inherit") })()};if(DC.Support.Properties){DC.Support.__defineGetter__("CSS3ColorModel",fun ction(){delete this.CSS3ColorModel;var B=document.createElement("span");try{B.style.backgroundColor="rgba(100,100,100, 0.5)";return this.CSS3ColorModel=(B.style.length===1)}catch(A){}return(this.CSS3ColorModel=f alse)});DC.Support.__defineGetter__("CSSTransitions",function(){delete this.CSSTransitions;var B=document.createElement("span");try{B.style.setProperty("-webkit-transition-du ration","1ms","");return this.CSSTransitions=(B.style.length===1)}catch(A){}return(this.CSSTransitions=f alse)})}DC.typeOf=function(B){if(null===B){return"null"}var A=typeof (B);if("object"!==A&&"function"!==A){return A}return Object.prototype.toString.call(B).slice(8,-1).toLowerCase()};DC.compareValues=f unction(F,D){var C=DC.typeOf(F);if(C!==DC.typeOf(D)){var A=String(F);var E=String(D);return A.localeCompare(E)}switch(C){case"null":return 0;case"boolean":case"number":var B=(F-D);if(0===B){return B}return(B<0?-1:1);case"regexp":case"function":break;case"string":case"array":c ase"object":if(F.localeCompare){return F.localeCompare(D)}if(F.compare){return F.compare(D)}break;case"undefined":return true;default:throw new TypeError("Unknown type for comparison: "+C)}return String(F).localeCompare(String(D))};DC.defineError=function(B){function A(C){this.message=C;this.name=B}A.prototype=new Error;A.prototype.constructor=A;A.prototype.name=B;return A};var InvalidArgumentError=DC.defineError("InvalidArgumentError");if("undefined"==typ eof (window.console)){window.console={}}if("undefined"==typeof (window.console.log)){window.console.log=function(){}}if("undefined"==typeof (window.console.error)){window.console.error=function(){}};if("undefined"!==typ eof (window.Prototype)){(function(){var A=["indexOf","lastIndexOf","forEach","filter","map","some","every","reduce","re duceRight"];for(var B=0;B<A.length;++B){delete Array.prototype[A[B]]}})()}Array.prototype.distinct=function(){var B=this.length;var A=new Array(B);var C;var E;var D=0;for(C=0;C<B;++C){E=this[C];if(-1==A.indexOf(E)){A[D++]=E}}A.length=D;return A};Array.prototype.compare=function(B){var D=this.length-B.length;if(0!==D){return D}var E;var A;var C;for(E=0,A=this.length;E<A;++E){C=DC.compareValues(this[E],B[E]);if(0!==C){ret urn C}}return 0};Array.from=function(A,B){return Array.prototype.slice.call(A,B||0)};if(!Array.prototype.reduce){Array.prototype .reduce=function(B){var A=this.length;if(typeof B!="function"){throw new TypeError()}if(0===A&&1===arguments.length){throw new TypeError()}var C=0;if(arguments.length>=2){var D=arguments[1]}else{do{if(C in this){D=this[C++];break}if(++C>=A){throw new TypeError()}}while(true)}for(;C<A;C++){if(C in this){D=B.call(null,D,this[C],C,this)}}return D}}if(!Array.prototype.reduceRight){Array.prototype.reduceRight=function(B){var A=this.length;if(typeof B!="function"){throw new TypeError()}if(0===A&&1===arguments.length){throw new TypeError()}var C=A-1;if(arguments.length>=2){var D=arguments[1]}else{do{if(C in this){D=this[C--];break}if(--C<0){throw new TypeError()}}while(true)}for(;C>=0;C--){if(C in this){D=B.call(null,D,this[C],C,this)}}return D}}if(!Array.indexOf){Array.indexOf=function(C,B,A){return Array.prototype.indexOf.call(C,B,A)}}if(!Array.lastIndexOf){Array.lastIndexOf=f unction(C,B,A){return Array.prototype.lastIndexOf.call(C,B,A)}}if(!Array.forEach){Array.forEach=funct ion(C,A,B){return Array.prototype.forEach.call(C,A,B)}}if(!Array.filter){Array.filter=function(C, A,B){return Array.prototype.filter.call(C,A,B)}}if(!Array.map){Array.map=function(C,A,B){re turn Array.prototype.map.call(C,A,B)}}if(!Array.some){Array.some=function(C,A,B){ret urn Array.prototype.some.call(C,A,B)}}if(!Array.every){Array.every=function(C,A,B){ return Array.prototype.every.call(C,A,B)}}if(!Array.reduce){Array.reduce=function(B,A) {if(arguments.length>2){return Array.prototype.reduce.apply(B,A,arguments[2])}else{return Array.prototype.reduce.apply(B,A)}}}if(!Array.reduceRight){Array.reduceRight=fu nction(B,A){if(arguments.length>2){return Array.prototype.reduceRight.apply(B,A,arguments[2])}else{return Array.prototype.reduceRight.apply(B,A)}}};function Set(){var D=this;if(D.constructor!==Set){D=new Set()}var B=arguments;if(1==B.length&&B[0] instanceof Array){B=B[0]}var C;var A=B.length;for(C=0;C<A;++C){D[B[C]]=true}return D}Set.union=function(C,B){var A=Object.clone(C);if(!B){return A}var D;for(D in B){A[D]=true}return A};Set.intersect=function(C,B){var A=new Set();var D;for(D in C){if(D in B){A[D]=true}}return A};Set.add=function(B,A){B[A]=true;return B};Set.remove=function(B,A){delete B[A];return B};Set.toArray=function(C){var B;var A=[];for(B in C){A.push(B)}return A};Set.forEach=function(E,C,B){var D;var A=0;for(D in E){C.call(B,D,A++)}};Set.join=function(D,B){var C;var A=[];for(C in D){A.push(C)}return A.join(B||"")};var $S=Set;var Class=(function(){function D(I,L){var J;if(!I&&!L){return I}if(!I){J=function(){return L.apply(this,arguments)}}else{var K=/this\.base/.test(I);if(!K&&!L){return I}if(!K){J=function(){L.call(this);return I.apply(this,arguments)}}else{J=function(){var N=this.base;this.base=L||function(){};var M=I.apply(this,arguments);this.base=N;return M}}}J.valueOf=function(){return I};J.toString=function(){return String(I)};return J}function G(I,J){var K=I.prototype.__factory__.apply(I,J);if("function"!==typeof (K)){throw new Error("Factory function doesn't return a function")}K.__factoryFn__=true;return K}function F(K){if(K.__createFactoryObjects){K.__createFactoryObjects();return }var J;var I;for(J in K.__factories__){I=K[J];if(!I.__factoryFn__){continue}K[J]=I.call(K)}}function C(I,K){if(I&&!(I instanceof Function)){throw new Error("Invalid constructor")}if(K&&!(K instanceof Function)){throw new Error("Invalid superclass")}K=K?K.valueOf():null;I=D(I,K);var J;if(I){J=function(){if(!(this instanceof J)){return G(J,arguments)}this.__uid=this.__uid||DC.generateUid();var L=I.apply(this,arguments);if(L){return L}F(this);if(this.__postConstruct instanceof Function){this.__postConstruct()}return this}}else{J=function(){if(!(this instanceof J)){return G(J,arguments)}this.__uid=this.__uid||DC.generateUid();F(this);if(this.__postCo nstruct instanceof Function){this.__postConstruct()}return this}}J.valueOf=function(){return I};J.toString=function(){return String(I||J)};return J}function B(J){function I(){}I.prototype=J.prototype;return new I()}function E(L,J,K){if(!L||!/this\.base/.test(L)){return L}function I(){var N=this.base;this.base=K[J]||function(){};var M=L.apply(this,arguments);this.base=N;return M}I.valueOf=function(){return L};I.toString=function(){return String(L)};return I}function H(J,I,K,L){if(K instanceof Function&&L){var M=K.valueOf();K=E(K,I,L);K.name=I;if(M.__factoryFn__){J.__factories__[I]=K}}J[I ]=K;return K}function A(J){var I;for(I=J.superclass;I;I=I.superclass){if("__subclassCreated__" in I){I.__subclassCreated__(J)}}}return{create:function(L,J){var I;var K={};switch(arguments.length){case 0:throw new TypeError("Missing superclass and declaration arguments");case 1:J=L;L=undefined;break;default:K=B(L);break}if("function"==typeof (J)){J=J();if(!J){throw new Error("Class declaration function did not return a prototype")}}if(J.hasOwnProperty("constructor")){I=J.constructor;delete J.constructor}I=C(I,L);I.prototype=K;I.prototype.constructor=I;I.superclass=L;i f(L){K.__factories__=Object.clone(L.prototype.__factories__)}else{K.__factories_ _={}}I.__class_id__=DC.generateUid();K.__class_id__=DC.generateUid();this.extend (I,J);A(I);return I},findPropertyName:function(L,I){var J;for(var K in L){J=L[K];if(J===I||("function"===typeof (J)&&J.valueOf()===I)){return K}}return null},extend:(function(){if(DC.Support.Properties){return function(I,J){var N=I.prototype;var P=I.superclass&&I.superclass.prototype;var K;for(var O in J){var M=J.__lookupGetter__(O);var L=J.__lookupSetter__(O);if(M||L){M&&N.__defineGetter__(O,M);L&&N.__defineSetter __(O,L)}else{H(N,O,J[O],P)}}return I}}else{return function(I,J){var K=I.prototype;var M=I.superclass&&I.superclass.prototype;for(var L in J){H(K,L,J[L],M)}}}})()}})();if(!Function.prototype.bind){Function.prototype.bi nd=function(C){var A=this;if(!arguments.length){return A}if(1==arguments.length){return function(){return A.apply(C,arguments)}}var B=Array.from(arguments,1);return function(){return A.apply(C,B.concat(Array.from(arguments)))}}}if(!Function.prototype.bindAsEvent Listener){Function.prototype.bindAsEventListener=function(C){var A=this;if(1==arguments.length){return function(D){return A.call(C,D||window.event)}}var B=Array.from(arguments);B.shift();return function(D){return A.apply(C,[D||window.event].concat(B))}}}if(!Function.prototype.delay){Function .prototype.delay=function(D){var B=this;D=D||10;if(arguments.length<2){function A(){B()}return window.setTimeout(A,D)}var C=Array.from(arguments,1);function E(){B.apply(B,C)}return window.setTimeout(E,D)}}if(!Function.prototype.bindAndDelay){Function.prototype .bindAndDelay=function(F,D){var B=this;F=F||B;D=D||10;if(arguments.length<3){function A(){B.call(F)}return window.setTimeout(A,D)}var C=Array.from(arguments,2);function E(){B.apply(F,C)}return window.setTimeout(E,D)}}Function.prototype.sync=function(){var B=arguments.length?this.bind.apply(this,arguments):this;var A={};var C=false;B.stop=function(){C=true};B.waitFor=function(D){A[D]=true;return function(){A[D]=false;for(var E in A){if(A[E]){return }}if(C){return }B()}};return B};Object.clone=function(B){var A=(function(){});A.prototype=B;return new A()};Object.applyDefaults=function(C,B){C=C||{};if(!B){return C}for(var A in B){if(A in C){continue}C[A]=B[A]}return C};Object.extend=function(C,A){C=C||{};for(var B in A){C[B]=A[B]}return C};Object.merge=function(C,A){var B={};var D;for(D in C){B[D]=C[D]}for(D in A){if(D in B){continue}B[D]=A[D]}return B};(function(){var B=Set("file","submit","image","reset","button");var D={};function E(I,H,J){var G=I[H];var F=DC.typeOf(G);if("string"===F){I[H]=[G,J]}else{if("array"===F){G.push(J)}else{ I[H]=J}}}function C(H){var F=H.name;var G=(H.type||"").toLowerCase();if(H.disabled||G in B){return }if("radio"===G||"checkbox"===G){if(H.checked){E(this,F,H.value)}}else{if(H.mul tiple){function I(J){if(J.selected){E(this,F,J.value)}}this[F]=[];Array.forEach(H.options,I,thi s)}else{E(this,F,H.value);if("image"===G){E(this,F+".x",0);E(this,F+".y",0)}}}}O bject.fromForm=function(G){var F={};Array.forEach(G.elements,C,F);return F};function A(H){H=H.split("=");if(1===H.length){return }var F=decodeURIComponent(H[0].trim());var G=decodeURIComponent(H[1].trim())||null;E(this,F,G)}Object.fromQueryString=func tion(G){if("?"==G.charAt(0)){G=G.slice(1)}G=G.split(/\s*&\s*/);var F={};G.forEach(A,F);return F};Object.toQueryString=function(K){if(!K){return""}var H;var J;var F;var G=[];function I(M){if(null!==M&&"undefined"!==typeof (M)){M=encodeURIComponent(M)}var L=M+"";if(L.length){G.push(H+"="+L)}else{G.push(H)}}for(H in K){J=K[H];F=DC.typeOf(J);if("function"===F||J===D[H]){continue}H=encodeURICompo nent(H);if("array"===F){J.forEach(I)}else{I(J)}}return G.join("&")}})();RegExp.escape=function(A){return A.replace(RegExp._escapeRegex,"\\$1")};RegExp.specialCharacters=["/",".","*","+ ","?","|","(",")","[","]","{","}","\\"];RegExp._escapeRegex=new RegExp("(\\"+RegExp.specialCharacters.join("|\\")+")","g");DC.strings={"marker. input.multipleValues":"Multiple Values","marker.input.placeholder":"","marker.input.noSelection":"No Selection","marker.text.multipleValues":"Multiple Values","marker.text.placeholder":"","marker.text.noSelection":"No Selection","error.no_description":"An unspecified error occurred.","error.invalid_value":"This value is not valid.","error.invalid_number":"This value is not a valid number."};DC.localisedString=function(A){return{toString:function(){if(A in DC.strings){return DC.strings[A]}console.log("Localisation missing string for key: "+A);return A}}};var _=DC.localisedString;DC.Error=Class.create({constructor:function(A){Object.exte nd(this,A)},description:_("error.no_description"),recoverySuggestion:null});DC.K eyInfo=Class.create({constructor:function(D,B){var A=DC.KVO.getPropertyMethodsForKeyOnObject(B,D);this.__uid=[B,DC.generateUid()]. join("_");this.reader=A.getter;this.mutator=A.mutator;this.validator=A.validator ;this.key=B;this.mutable=((this.mutator||!this.reader)?true:false);if(!this.read er&&!this.mutator){this.mutable=true}this.changeCount=0;var C=A.value;if(!C){return }var E=DC.typeOf(C);if(E in DC.KVO.typesOfKeyValuesToIgnore||!C._addParentLink){return }C._addParentLink(D,this)},get:function(B){if(this.reader){return this.reader.call(B)}var A;if(this.key in B){A=B[this.key]}else{A=null}if(A&&A._addParentLink){A._addParentLink(B,this)}r eturn A},set:function(B,A){if(this.mutator){this.mutator.call(B,A)}else{B.willChangeV alueForKey(this.key,this);B[this.key]=A;B.didChangeValueForKey(this.key,this)}}, validate:function(B,A){if(!this.validator){return A}return this.validator.call(B,A)},unlinkParentLink:function(){if(!this.parentLink){retu rn }this.parentLink.observer=null;this.parentLink.callback=null;this.parentLink=nu ll}});DC.ChangeType={setting:0,insertion:1,deletion:2,replacement:3};DC.ChangeNo tification=Class.create({constructor:function(D,A,E,C,B){this.object=D;this.chan geType=A;this.newValue=E;this.oldValue=C;this.indexes=B;this.objectKeyPath=[]},t oString:function(){var A="[ChangeNotification changeType: ";switch(this.changeType){case DC.ChangeType.setting:A+="setting";break;case DC.ChangeType.insertion:A+="insertion";break;case DC.ChangeType.deletion:A+="deletion";break;case DC.ChangeType.replacement:A+="replacement";break;default:A+="<<unknown>>";break }A+=" newValue="+this.newValue+" oldValue="+this.oldValue+(this.indexes?" indexes="+this.indexes.join(", "):"")+"]";return A}});DC.ObserverEntry=Class.create({constructor:function(A,C,B){this.observer=A ;this.callback=C;this.context=B},observeChangeForKeyPath:function(A,B){if(!this. callback||!this.observer||-1!==A.objectKeyPath.indexOf(this.observer)){return }this.callback.call(this.observer,A,B,this.context)}});DC.KVO=Class.create({con structor:function(){},__factory__:function(){var B=Array.from(arguments);var A=this;function C(){}return function(){C.prototype=A.prototype;var D=new C();A.prototype.constructor.apply(D,B);return D}},setValueForKeyPath:function(C,D){if(!D||0===D.length){throw new InvalidArgumentError("keyPath may not be empty")}if("string"==typeof (D)){D=D.split(".")}var B=D[0];if(1==D.length){this.setValueForKey(C,B);return }if("@"==B.charAt(0)){return }var A=this.valueForKey(B);if(!A){return }A.setValueForKeyPath(C,D.slice(1))},setValueForKey:function(B,A){if(!A||0===A. length){throw new InvalidArgumentError("key may not be empty")}var C=this.infoForKey(A);if(!C||!C.mutable){return }C.set(this,B)},valueForKeyPath:function(E){if(!E||0===E.length){throw new InvalidArgumentError("keyPath may not be empty")}if("string"==typeof (E)){E=E.split(".")}var D=E[0];if(1==E.length){return this.valueForKey(D)}if("@"==D.charAt(0)){var B=D.substr(1);var A=this.valueForKeyPath(E.slice(1));return DC.ArrayOperator[B](A)}var C=this.valueForKey(D);if("undefined"===typeof (C)||null===C){return undefined}return C.valueForKeyPath(E.slice(1))},valueForKey:function(A){if(!A||0===A.length){thr ow new InvalidArgumentError("the key is empty")}var B=this.infoForKey(A);if(!B){return null}return B.get(this)},validateValueForKeyPath:function(C,D){if(!D||0===D.length){throw new InvalidArgumentError("keyPath may not be empty")}if("string"==typeof (D)){D=D.split(".")}var B=D[0];if(1==D.length){return this.validateValueForKey(C,B)}var A=this.valueForKey(B);if("undefined"===typeof (A)||null===A){return C}return A.validateValueForKeyPath(C,D.slice(1))},validateValueForKey:function(B,A){if(! A||!A.length){throw new InvalidArgumentError("missing key")}var C=this.infoForKey(A);return C.validate(this,B)},observeChildObjectChangeForKeyPath:function(D,C,A){if(DC.KV O.kAllPropertiesKey!=C){C=A+"."+C}else{C=A}var B=Object.clone(D);B.object=this;this.notifyObserversOfChangeForKeyPath(B,C)},in foForKeyPath:function(D){if(!D||0===D.length){throw new InvalidArgumentError("keyPath is empty")}if("string"==typeof (D)){D=D.split(".")}var B=D[0];if(1==D.length){return this.infoForKey(B)}else{if("@"==B.charAt(0)){var C=new DC.KeyInfo(null,null);C.mutable=false;return C}else{var A=this.valueForKey(B);if(!A){return undefined}if(!A.infoForKeyPath){return undefined}return A.infoForKeyPath(D.slice(1))}}},infoForKey:function(A){var B;if(!this.__keys){this.__keys={}}if(DC.KVO.kAllPropertiesKey==A){return null}B=this.__keys[A];if(B){return B}B=new DC.KeyInfo(this,A);this.__keys[A]=B;return B},setKeysTriggerChangeNotificationsForDependentKey:function(D,C){if(!D||!D.len gth){throw new InvalidArgumentError("keys array is not valid")}if(!C){throw new InvalidArgumentError("dependentKey can not be null")}if(-1!==C.indexOf(".")){throw new InvalidArgumentError("dependentKey may not be a key path")}var B;var F;var A;var E;if("string"===typeof (D)){D=[D]}if(!this.__dependentKeys){this.__dependentKeys={}}for(A=0;A<D.length ;++A){B=D[A];if(!B){throw new InvalidArgumentError("key at index "+A+" was null")}if(!(B in this.__dependentKeys)){this.__dependentKeys[B]=[]}DC.KVO.getPropertyMethodsForK eyOnObject(B,this);E=this.__dependentKeys[B];if(-1==E.indexOf(C)){E.push(C)}}},m utableKeys:function(){var D=[];var B;var A;var C;if("__mutableKeys" in this&&this.__mutableKeys.concat){return this.__mutableKeys}var E=Set.union(DC.KVO.keysToIgnore,this.__keysToIgnore);for(B in this){if(B in E||"__"===B.substr(0,2)){continue}A=this[B];if("function"!==typeof (A)){D.push(B);continue}if(1!==A.length||"set"!==B.substr(0,3)){continue}C=B.ch arAt(3);if(C!==C.toUpperCase()){continue}B=C.toLowerCase()+B.substr(4);if(-1===D .indexOf(B)){D.push(B)}}return D},initialiseKeyValueObserving:function(){this.__uid=this.__uid||DC.generateUid ();this.__observers={}},_addParentLink:function(D,E,C){if(!this.hasOwnProperty(" __observers")){this.initialiseKeyValueObserving()}var B=this.__observers[DC.KVO.kAllPropertiesKey];if(!B){B=this.__observers[DC.KVO.k AllPropertiesKey]={}}C=C||E.__uid;if(C in B){return }var A=new DC.ObserverEntry(D,D.observeChildObjectChangeForKeyPath,E?E.key:"");B[C]=A;if(! E){return }E.unlinkParentLink();E.parentLink=A},_removeParentLink:function(C,D,B){if(!thi s.__observers){return }var A=this.__observers[DC.KVO.kAllPropertiesKey];if(!A){A=this.__observers[DC.KVO.k AllPropertiesKey]={}}B=B||D.__uid;if(D&&D.parentLink===A[B]){D.unlinkParentLink( )}delete A[B]},addObserverForKeyPath:function(A,E,D,B){if(!D||0===D.length){throw new InvalidArgumentError("keyPath is empty")}if(!A){throw new InvalidArgumentError("Observer may not be null")}if(!E){E=A.observeChangeForKeyPath}if("string"===typeof (E)){E=A[E]}if(!E){throw new InvalidArgumentError("Missing callback method")}if(!this.hasOwnProperty("__observers")){this.initialiseKeyValueObservi ng()}if(!this.__observers[D]){this.infoForKeyPath(D);this.__observers[D]=[]}var C=new DC.ObserverEntry(A,E,B);this.__observers[D].push(C)},removeObserverForKeyPath:f unction(C,F){if(!F||0===F.length){throw new InvalidArgumentError("keyPath may not be empty")}if(!C){throw new InvalidArgumentError("Observer may not be null")}if(!this.__observers||!this.__observers[F]){return }var E=this.__observers[F];var B=-1;var D;var A=E.length;for(B=0;B<A;++B){D=E[B];if(D.observer==C){E.splice(B,1);return }}},willChangeValueForKey:function(A,C){if(!A){throw new InvalidArgumentError("key may not be null")}C=(C instanceof DC.KeyInfo)?C:this.infoForKey(A);if(!C){return }if(1!==++C.changeCount){return }var B=(this.__dependentKeys&&this.__dependentKeys[A]);if(B){B.forEach(this.willChan geValueForKey,this)}C.previousValue=C.get(this)},forceChangeNotificationForKey:f unction(A,B){if(!A){throw new InvalidArgumentError("key may not be null")}B=(B instanceof DC.KeyInfo)?B:this.infoForKey(A);if(!B){return }if(0!==B.changeCount){return }B.changeCount=1;this.didChangeValueForKey(A,B)},didChangeValueForKey:function( B,F){if(!B){throw new InvalidArgumentError("key may not be null")}F=(F instanceof DC.KeyInfo)?F:this.infoForKey(B);if(!F){return }if(0!==--F.changeCount){return }var C=F.get(this);var A=F.previousValue;F.previousValue=null;if(C!==A){var E=new DC.ChangeNotification(this,DC.ChangeType.setting,C,A);this.notifyObserversOfCha ngeForKeyPath(E,B);if(A&&A._removeParentLink){A._removeParentLink(this,F)}if(C&& C._addParentLink){C._addParentLink(this,F)}}var D=(this.__dependentKeys&&this.__dependentKeys[B]);if(D){D.forEach(this.didChang eValueForKey,this)}},notifyObserversOfChangeForKeyPath:function(J,L){if(!L){thro w new InvalidArgumentError("keyPath may not be null")}if(!this.__observers){return }var G;var F;var H;F=this.__observers[DC.KVO.kAllPropertiesKey];if(F){var E=Object.clone(J);var A=J.objectKeyPath.length;J.objectKeyPath.push(this);for(G in F){var B=F[G];B.observeChangeForKeyPath(E,L)}J.objectKeyPath.length=A}if(DC.KVO.kAllPr opertiesKey==L){return }F=this.__observers[L];if(F&&F.length){H=F.length;for(G=0;G<H;++G){F[G].observe ChangeForKeyPath(J,L)}}var D=L+".";var I=D.length;var K;var M;var P;var O;var C;var N=!(null===J.oldValue||"undefined"===typeof (J.oldValue));for(M in this.__observers){if(M.substr(0,I)!=D){continue}F=this.__observers[M];if(!F||!F .length){continue}K=M.substr(I);O=J.oldValue;if(O&&O.valueForKeyPath){O=O.valueF orKeyPath(K)}else{O=null}C=J.newValue;if(C&&C.valueForKeyPath){C=C.valueForKeyPa th(K)}else{C=null}if(N&&O===C){continue}P=new DC.ChangeNotification(J.object,J.changeType,C,O,J.indexes);H=F.length;for(G=0;G <H;++G){F[G].observeChangeForKeyPath(P,M)}}}});DC.KVO.kAllPropertiesKey="*";DC.K VO.keysToIgnore=$S("__keys","__observers","__keysToIgnore","__dependentKeys","__ mutableKeys","__factories__");DC.KVO.typesOfKeyValuesToIgnore=$S("string","numbe r","boolean","date","regexp","function");DC.KVO.getPropertyMethodsForKeyOnObject =(function(){function B(H,F){F=F||"__kvo_prop_"+H;var G={getter:function(){var I=null;if(F in this){I=this[F]}var J=this.__keys?this.__keys[H]:null;if(!J){return I}if(I&&I._addParentLink){I._addParentLink(this,J)}else{J.unlinkParentLink()}re turn I},mutator:function(I){this.willChangeValueForKey(H);if("undefined"===typeof (I)){I=null}this[F]=I;this.didChangeValueForKey(H);return I}};G.mutator.__key=H;G.getter.__key=H;return G}function C(H,G){function F(J){this.willChangeValueForKey(G);var I=H.call(this,J);this.didChangeValueForKey(G);return I}F.__key=G;F.valueOf=function(){return H};F.toString=function(){return String(H)};return F}function D(F,H){function G(){var I=F.call(this);var J=this.__keys?this.__keys[H]:null;if(!J){return I}if(I&&I._addParentLink){I._addParentLink(this,J)}else{J.unlinkParentLink()}re turn I}G.__key=H;G.valueOf=function(){return F};G.toString=function(){return String(F)};return G}function E(T,K){var M=K.constructor.prototype;var J=(M==K);var L=(M!=Object.prototype&&M!=DC.KVO.prototype)?M:K;var U=T.titleCase();var P="get"+U;var Q="set"+U;var I="validate"+U;var O;var H;var S;var F=K[I];var N=("undefined"!==typeof (O=K.__lookupGetter__(T))&&"undefined"!==typeof (H=K.__lookupSetter__(T)));if(!N){P=(P in K)?P:T;O=K[P];H=K[Q]}if("function"!==typeof (O)){var R="__kvo_prop_"+T;var G=B(T,R);if(T in K){S=K[R]=("undefined"==typeof (O)?null:O);delete K[T]}O=G.getter;H=G.mutator;N=true}else{if(O&&!J){S=O.valueOf().call(K)}if(O&&T !==O.__key){O=D(O,T)}if(H&&T!==H.__key){H=C(H,T)}}if(N){L.__defineGetter__(T,O); L.__defineSetter__(T,H)}else{if(O){if(K.hasOwnProperty(P)){K[P]=O}else{L[P]=O}}i f(H){if(K.hasOwnProperty(Q)){K[Q]=H}else{L[Q]=H}}}return{getter:O,mutator:H,vali dator:F,value:S}}function A(Q,J){var L=J.constructor.prototype;var I=(L==J);var K=(L!=Object.prototype&&L!=DC.KVO.prototype)?L:J;var R=Q.titleCase();var O="set"+R;var N="get"+R;var H="validate"+R;N=(N in J)?N:Q;var M=J[N];var G=J[O];var F=J[H];var P;if("function"!==typeof (M)){if(Q in J){P=M}M=null;G=null}else{if(M&&!I){P=M.valueOf().call(J)}if(M&&Q!==M.__key){M= D(M,Q)}if(G&&Q!==G.__key){G=C(G,Q)}}if(M){if(J.hasOwnProperty(N)){J[N]=M}else{K[ N]=M}}if(G){if(J.hasOwnProperty(O)){J[O]=G}else{K[O]=G}}return{getter:M,mutator: G,validator:F,value:P}}if(DC.Support.Properties){return E}else{return A}})();DC.KVO.adapt=function(B){if(!B){throw new InvalidArgumentError("Can't adapt a null object")}var A;for(A in DC.KVO.prototype){if(A in B){continue}B[A]=DC.KVO.prototype[A]}if("keyDependencies" in B&&!("__dependentKeys" in B)){var C=B.keyDependencies;for(A in C){B.setKeysTriggerChangeNotificationsForDependentKey(C[A],A)}}return B};DC.KVO.adaptTree=function(C){DC.KVO.adapt(C);var B;var A;for(B in C){if(B in DC.KVO.keysToIgnore){continue}A=C[B];if(!A){continue}if(DC.typeOf(A) in DC.KVO.typesOfKeyValuesToIgnore){continue}DC.KVO.adaptTree(A)}return C};DC.KVO.__subclassCreated__=function(A){var D=A.superclass.prototype;var B=A.prototype;if(D.keyDependencies===B.keyDependencies){return }var E=B.keyDependencies||{};for(var C in E){B.setKeysTriggerChangeNotificationsForDependentKey(E[C],C)}};DC.Bindable=Cla ss.create(DC.KVO,{constructor:function(A){this.bindings={};this.__parameters=A;t his.__context=DC.dataModel},__createFactoryObjects:function(){var A=DC.dataModel;var C=this.__context;DC.dataModel=this.__context=this;var D;var B;for(D in this.__factories__){B=this[D];if(!B.__factoryFn__){continue}this[D]=B.call(this )}DC.dataModel=A;this.__context=C},exposedBindings:[],defaultPlaceholders:{},aut omaticallySetupBindings:true,__relativeSource:null,defaultPlaceholderForMarkerWi thBinding:function(B,C){var A=this.defaultPlaceholders[C];if(!A){return null}return A[B]||null},__createObserverMethod:function(B,C){function A(E){if(DC.ChangeType.setting!==E.changeType){throw new InvalidArgumentError('Received invalid change type for synthesized binding observer (name="'+B+'" keyPath="'+C+'")')}var D=E.newValue;this.setValueForKey(E.newValue,B)}return A},bindNameToKeyPath:function(B,G,A){var D;var F;var E={};if(!this.bindings){this.bindings={}}D=this["observe"+B.titleCase()+"Change "]||this.__createObserverMethod(B,G);if(this.bindings[B]){this.bindings[B].unbin d()}var C=this.__context;if("object"===typeof (G)){Object.extend(E,G);G=E.keypath}Object.extend(E,DC.Binding.bindingInfoFromS tring(G));if("transformValue" in E){E.transformer={transformValue:E.transformValue,reverseTransformedValue:E.rev erseTransformedValue||null};delete E.transformValue;delete E.reverseTransformedValue}if("*."===E.keypath.substr(0,2)){if(A){C=A}else{C=new DC.KVO()}E.keypath=E.keypath.substr(2)}E.name=B;E.object=C;E.observer=this;E.ob serverFn=D;F=new DC.Binding(E);F.bind();this.bindings[B]=F},__postConstruct:function(){if(!this. automaticallySetupBindings){return }this.__initialising=true;this.__copyParameters(this.__parameters||{});this.set upBindings();this.updateBindings();this.createObservers();delete this.__initialising},__copyParameters:function(C){var D;var A;var B=DC.KVO.adaptTree;for(D in C){if(-1!==D.search(/Binding$/)){continue}A=C[D];if("object"===DC.typeOf(A)&&!( "addObserverForKeyPath" in A)){B(A)}this[D]=A}this.__parameters=C},bindingInfoForName:function(A){if(!this .__parameters){return null}return this.__parameters[A+"Binding"]},__createAutoObserver:function(C,B){var A=DC.ChangeType.setting;return function(D){if(this.bindings[B]||A==D.changeType){return }C.apply(this,arguments)}},createObservers:function(){var E=this.exposedBindings;var A=E.length;var B;var D;var C;for(B=0;B<A;++B){C=E[B];D=this["observe"+C.titleCase()+"Change"];if(!D){conti nue}D=this.__createAutoObserver(D,C);this.addObserverForKeyPath(this,D,C,"__auto _observer__")}},setupBindings:function(){var D=this.exposedBindings;var B=D.length;var E;var A;var C;for(C=0;C<B;++C){A=D[C];E=this.bindingInfoForName(A);if(!E){continue}this.bin dNameToKeyPath(A,E,this.__relativeSource)}},updateBindings:function(){var E=this.bindings;var D=this.exposedBindings;var B=D.length;var A;var C;for(C=0;C<B;++C){A=E[D[C]];if(!A){continue}A.update()}},unbind:function(){for (var A in this.bindings){this.bindings[A].unbind()}}});DC.Bindable.__subclassCreated__=fu nction(C){var E=C.superclass.prototype;var D=C.prototype;if(D.hasOwnProperty("defaultPlaceholders")){var B=Object.clone(E.defaultPlaceholders);D.defaultPlaceholders=Object.extend(B,D.d efaultPlaceholders)}if(E.exposedBindings===D.exposedBindings&&!D.maskedBindings) {return }var A=(E.maskedBindings===D.maskedBindings)?{}:$S(D.maskedBindings);function F(H){return !(H in A)}var G=E.exposedBindings.filter(F);if(E.exposedBindings!==D.exposedBindings){G=G.con cat(D.exposedBindings.filter(F))}D.exposedBindings=G};DC.SortDescriptor=Class.cr eate({constructor:function(D,A,B){this.keyPath=D;this.ascending=A;this.compariso nFn=B||this.defaultCompare;var C=typeof (this.comparisonFn);if("string"!=C&&"function"!=C){throw new InvalidArgumentError("comparisonFn must be either the name of a method or a function reference")}},resolveComparisonFn:function(B){var A=this.comparisonFn;if("string"===typeof (A)){A=B[A]}if("function"!==typeof (A)){throw new TypeError("comparisonFn does not resolve to a function")}return A},compareObjects:function(C,B){if(!C.valueForKeyPath||!B.valueForKeyPath){thro w new InvalidArgumentError("Objects are not Key Value compliant")}var E=C.valueForKeyPath(this.keyPath);var D=B.valueForKeyPath(this.keyPath);var A=this.resolveComparisonFn(E);return A.call(E,D)},defaultCompare:function(A){return DC.compareValues(this,A)},reversedSortDescriptor:function(){return new DC.SortDescriptor(this.keyPath,!this.ascending,this.comparisonFn)}});DC.ValueTr ansformer=Class.create({transformedValue:function(A){return A},reverseTransformedValue:function(A){return A},__factory__:function(){var B=Array.from(arguments);var A=this;function C(){}return function(){C.prototype=A.prototype;var D=new C();A.prototype.constructor.apply(D,B);return D}}});DC.ValueTransformer.__subclassCreated__=function(A){var C=DC.ValueTransformer.prototype;var B=A.prototype;if(C.reverseTransformedValue==B.reverseTransformedValue){A.protot ype.reverseTransformedValue=null}};DC.transformer={};DC.transformerInstances={}; DC.findTransformerWithName=function(transformerName){var valueTransformer=DC.transformerInstances[transformerName.toLowerCase()];if(valu eTransformer){return valueTransformer}if(-1===transformerName.indexOf(".")){valueTransformer=DC.tran sformer[transformerName]}if(!valueTransformer){try{valueTransformer=eval(transfo rmerName)}catch(e){}}if(!valueTransformer){throw new InvalidArgumentError("The transformerName argument does not specify a valid ValueTransformer: "+transformerName)}if("function"!==typeof (valueTransformer)){return valueTransformer}if(valueTransformer.__factoryFn__){valueTransformer=valueTrans former()}else{valueTransformer=new valueTransformer()}return valueTransformer};DC.registerTransformerWithName=function(B,A){if(!B.transforme dValue){throw new InvalidArgumentError("The valueTransformer argument does not support the ValueTransformer method transformedValue")}A=A.toLowerCase();DC.transformerInstances[A]=B};DC.transform er.Not=Class.create(DC.ValueTransformer,{transformedValue:function(A){return(A?f alse:true)},reverseTransformedValue:function(A){return !!A}});DC.registerTransformerWithName(new DC.transformer.Not(),"not");DC.transformer.Boolean=Class.create(DC.ValueTransfo rmer,{constructor:function(A,B){this.trueValue=A;this.falseValue=B},transformedV alue:function(A){return(A==this.trueValue)},reverseTransformedValue:function(A){ return(A?this.trueValue:this.falseValue)}});DC.transformer.Matches=Class.create( DC.ValueTransformer,{constructor:function(A){this.trueRegex=A},transformedValue: function(A){return this.trueRegex.test(A)}});DC.transformer.Generic=Class.create(DC.ValueTransform er,{constructor:function(A,B){this.modelValues=A;this.displayValues=B},transform edValue:function(B){var A=this.modelValues.indexOf(B);var C;if(-1==A){return C}else{return this.displayValues[A]}},reverseTransformedValue:function(B){var A=this.displayValues.indexOf(B);var C;if(-1==A){return C}else{return this.modelValues[A]}}});DC.transformer.Truncated=Class.create(DC.ValueTransform er,{constructor:function(A){this.max=A||50},ellipsis:String.fromCharCode(8230),t ransformedValue:function(C){if(!C&&0!==C){return C}C=""+C;var A=C.length;if(A<=this.max){return C}var B=this.max/2-2;return[C.substr(0,B),this.ellipsis,C.substr(A-B)].join(" ")}});DC.registerTransformerWithName(new DC.transformer.Truncated(50),"truncated");DC.transformer.StringsToObjects=Class .create(DC.ValueTransformer,{constructor:function(A){this.key=A||"string"},trans formedValue:function(B){if(!B||!B.map){return B}function A(C){var D=new DC.KVO();D[this.key]=C;return D}return B.map(A,this)},reverseTransformedValue:function(B){if(!B||!B.map){return B}function A(C){return C[this.key]}return B.map(A,this)}});DC.registerTransformerWithName(new DC.transformer.StringsToObjects("string"),"StringsToObjects");DC.transformer.Fi rstObject=Class.create(DC.ValueTransformer,{transformedValue:function(A){if(DC.t ypeOf(A)=="array"){return A[0]}return A}});Object.extend(DC,{NoSelectionMarkerType:"noSelection",MultipleValuesMarker Type:"multipleValues",NullValueMarkerType:"nullValue"});DC.Binding=Class.create( {constructor:function(A){Object.extend(this,A);if("string"===typeof (this.transformer)){this.transformer=DC.findTransformerWithName(this.transforme r)}if("function"===typeof (this.transformer)){if(this.transformer.__factoryFn__){this.transformer=this.tr ansformer()}else{this.transformer=new this.transformer()}}this.refresh()},bind:function(){this.object.addObserverForK eyPath(this,this.observeChangeForKeyPath,this.keypath)},unbind:function(){this.o bject.removeObserverForKeyPath(this,this.keypath)},refresh:function(){var A=this.object.valueForKeyPath(this.keypath);this.cachedOriginalValue=A;this.mar kerType=this.markerTypeFromValue(A);if(this.markerType){if((this.markerType+"Pla ceholder") in this){A=this[this.markerType+"Placeholder"]}else{A=this.observer.defaultPlaceho lderForMarkerWithBinding(this.markerType,this.name)}}else{A=this.transformedValu e(A)}this.cachedValue=A},transformedValue:function(A){if(!this.transformer){retu rn A}return this.transformer.transformedValue(A)},validateProposedValue:function(B){if(this .transformer){if(!this.transformer.reverseTransformedValue){throw new Error("Can't validate a value when the transformer doesn't have a reverseTransformedValue method")}B=this.transformer.reverseTransformedValue(B)}var A=this.object.validateValueForKeyPath(B,this.keypath);if(A instanceof DC.Error){return A}return this.transformedValue(A)},setValue:function(A){if(this.cachedValue===A){return }this.markerType=this.markerTypeFromValue(A);this.cachedValue=A;if(this.transfo rmer){if(!this.transformer.reverseTransformedValue){return }A=this.transformer.reverseTransformedValue(A)}this.cachedOriginalValue=A;var B=this.updating;this.updating=true;this.object.setValueForKeyPath(A,this.keypat h);this.updating=B},mutable:function(){if(this.transformer&&!this.transformer.re verseTransformedValue){return false}var A=this.object.infoForKeyPath(this.keypath);return A&&A.mutable},value:function(){return this.cachedValue},update:function(){var B=this.value();var C=new DC.ChangeNotification(this.object,DC.ChangeType.setting,B);this.updating=true;t ry{this.observerFn.call(this.observer,C,this.keypath)}catch(A){console.error('Ex ception while bindng "'+this.name+'" to keypath "'+this.keypath+' ": '+A)}this.updating=false},observerFn:function(C,A,B){},markerTypeFromValue:func tion(A){if(null===A||"undefined"===typeof (A)||""===A){return DC.NullValueMarkerType}if(DC.Markers.MultipleValues===A){return DC.MultipleValuesMarkerType}if(DC.Markers.NoSelection===A){return DC.NoSelectionMarkerType}return null},placeholderValue:function(){var A;if((this.markerType+"Placeholder") in this){A=this[this.markerType+"Placeholder"]}else{A=this.observer.defaultPlaceho lderForMarkerWithBinding(this.markerType,this.name)}if("function"===typeof (A)){A=A.call(this.object)}return A},observeChangeForKeyPath:function(G,A,B){if(this.updating&&G.newValue===this. cachedOriginalValue){return }this.cachedOriginalValue=G.newValue;var E=G.newValue;this.markerType=this.markerTypeFromValue(E);if(this.markerType){E= this.placeholderValue()}else{E=this.transformedValue(E)}var C=Object.clone(G);C.newValue=E;if(DC.ChangeType.setting===G.changeType){this.ca chedValue=E}var F=this.updating;this.updating=true;try{this.observerFn.call(this.observer,C,A,B )}catch(D){console.error('Exception while bindng "'+this.name+'" to keypath "'+this.keypath+' ": '+D)}this.updating=F}});DC.Binding.bindingRegex=/^(.*?)(?:\((.*)\))?$/;DC.Bindi ng.compoundRegex=/^\s*([^&|].*?)\s*(\&\&|\|\|)\s*(\S.+)\s*$/;DC.Binding.bindingI nfoFromString=function(B){var A;var C;A=B.match(DC.Binding.bindingRegex);if(!A||A.length<3){throw new InvalidArgumentError("bindingString isn't in correct format")}var D={keypath:A[1]};if(A[2]){D.transformer=DC.findTransformerWithName(A[2])}return D};Class.extend(Array,{containsObject:function(A){return -1!==this.indexOf(A)},valueForKey:function(D){if(!D||0===D.length){throw new InvalidArgumentError("the key is empty")}if("@count"==D){return this.length}var E=new Array(this.length);var C;var A=this.length;var B;for(C=0;C<A;++C){B=this[C];E[C]=B?B.valueForKey(D):null}return E},setValueForKey:function(D,C){if(!C||0===C.length){throw new InvalidArgumentError("key is empty")}var B;var A=this.length;for(B=0;B<A;++B){this[B].setValueForKey(D,C)}},indexesOfObjects:f unction(E){var D;var B=E.length;var A=[];var C;for(D=0;D<B;++D){C=this.indexOf(E[D]);if(-1===C){continue}A.push(C)}return A},addObject:function(B){var A=this.length;var C=new DC.ChangeNotification(this,DC.ChangeType.insertion,[B],null,[A]);this.push(B);t his.observeElementAtIndex(A);this.notifyObserversOfChangeForKeyPath(C,DC.KVO.kAl lPropertiesKey)},addObjects:function(G){var B=G.length;var E=this.length;var C=[];var A=[];var F=new DC.ChangeNotification(this,DC.ChangeType.insertion,C,null,A);for(index=0;index< B;++index){var D=G[index];this.push(D);this.observeElementAtIndex(E);C.push(D);A.push(E++)}thi s.notifyObserversOfChangeForKeyPath(F,DC.KVO.kAllPropertiesKey)},insertObjectAtI ndex:function(B,A){if(A<0||A>this.length){throw new RangeError("index must be within the bounds of the array")}var C=new DC.ChangeNotification(this,DC.ChangeType.insertion,[B],null,[A]);this.splice(A, 0,B);this.observeElementAtIndex(A);this.notifyObserversOfChangeForKeyPath(C,DC.K VO.kAllPropertiesKey)},insertObjectsAtIndexes:function(E,C){if(E.length!==C.leng th){throw new InvalidArgumentError("length of objects and indexes parameters must be equal")}var A=E.length;var D;var B;for(D=0;D<A;++D){B=C[D];this.splice(B,0,E[D]);this.observeElementAtIndex(B)}v ar F=new DC.ChangeNotification(this,DC.ChangeType.insertion,E,null,C);this.notifyObserve rsOfChangeForKeyPath(F,DC.KVO.kAllPropertiesKey)},replaceObjectAtIndex:function( C,B){var A=this[B];this[B]=C;var D=new DC.ChangeNotification(this,DC.ChangeType.replacement,[C],[A],[B]);this.notifyOb serversOfChangeForKeyPath(D,DC.KVO.kAllPropertiesKey)},replaceObjectsAtIndexes:f unction(F,D){var B=[];var A=F.length;var E;var C;for(E=0;E<A;++E){C=D[E];B[E]=this[C];this.stopObservingElementAtIndex(C);this [C]=F[E];this.observeElementAtIndex(C)}var G=new DC.ChangeNotification(this,DC.ChangeType.replacement,F,null,D);this.notifyObser versOfChangeForKeyPath(G,DC.KVO.kAllPropertiesKey)},removeObject:function(B){var A=this.indexOf(B);if(-1===A){return }this.removeObjectAtIndex(A)},removeObjects:function(D){var A=D.length;var B;for(var C=0;C<A;++C){B=this.indexOf(D[C]);if(-1===B){continue}this.removeObjectAtIndex( B)}},removeObjectsAtIndexes:function(D){var C;var E=D.sort(function(I,H){return H-I});var A=D.length;var B=[];for(C=0;C<A;++C){var F=E[C];this.stopObservingElementAtIndex(F);B.push(this[F]);this.splice(F,1)}var G=new DC.ChangeNotification(this,DC.ChangeType.deletion,null,B,E);this.notifyObserver sOfChangeForKeyPath(G,DC.KVO.kAllPropertiesKey)},removeObjectAtIndex:function(B) {if(B<0||B>=this.length){throw new RangeError("index must be within the bounds of the array")}this.stopObservingElementAtIndex(B);var A=this.splice(B,1);var C=new DC.ChangeNotification(this,DC.ChangeType.deletion,null,A,[B]);this.notifyObserv ersOfChangeForKeyPath(C,DC.KVO.kAllPropertiesKey)},removeAllObjects:function(){v ar D;var C=[];var A=this.length;C.length=A;for(D=0;D<A;++D){this.stopObservingElementAtIndex(D);C [D]=D}var B=this.splice(0,A);var E=new DC.ChangeNotification(this,DC.ChangeType.deletion,null,B,C);this.notifyObserver sOfChangeForKeyPath(E,DC.KVO.kAllPropertiesKey)},objectsAtIndexes:function(C){va r D;var B=[];var A=C.length;B.length=C.length;for(D=0;D<A;++D){B[D]=this[C[D]]}return B},observeChildObjectChangeForKeyPath:function(F,E,B){var D=F.object;var C=this.indexOf(D);if(!this.__uid){this.initialiseKeyValueObserving()}if(-1===C) {D._removeParentLink(this,null,this.__uid);return }var A=new DC.ChangeNotification(D,DC.ChangeType.replacement,[F.newValue],[F.oldValue],[C] );this.notifyObserversOfChangeForKeyPath(A,E)},observeElementAtIndex:function(A) {var B=this[A];if(!B||!B._addParentLink){return }if(!this.__uid){this.initialiseKeyValueObserving()}B._addParentLink(this,null, this.__uid)},stopObservingElementAtIndex:function(A){var B=this[A];if(!B||!B._removeParentLink){return }if(!this.__uid){this.initialiseKeyValueObserving()}B._removeParentLink(this,nu ll,this.__uid)},initialiseKeyValueObserving:function(){var B;var A=this.length;this.__observers={};this.__uid=this.__uid||DC.generateUid();for(B =0;B<A;++B){this.observeElementAtIndex(B)}}});DC.KVO.adapt(Array.prototype);DC.A rrayOperator={avg:function(A){return this.sum(A)/A.length},count:function(A){throw new InvalidArgumentError("@count operator must end the keyPath")},distinctUnionOfArrays:function(A){return this.unionOfArrays(A).distinct()},distinctUnionOfObjects:function(A){return A.distinct()},max:function(D){var B=null;var E;var A;var C;for(E=0,A=D.length;E<A;++E){C=D[E];if(null===B||C>B){B=C}}return B},min:function(C){var E=null;var D;var A;var B;for(D=0,A=C.length;D<A;++D){B=C[D];if(null===E||B<E){E=B}}return E},sum:function(B){var D=0;var A=B.length;var C;for(C=0;C<A;++C){D+=B[C]}return D},unionOfArrays:function(B){var D=[];var A;var C;for(C=0,A=B.length;C<A;++C){D=D.concat(B[C])}return D},unionOfObjects:function(A){return A}};Object.extend(DC,{dataModel:new DC.KVO(),registerModelWithName:function(B,A){DC.dataModel.setValueForKey(B,A)}, unregisterModelWithName:function(A){delete DC.dataModel[A]}});String.prototype.titleCase=function(){return this.charAt(0).toUpperCase()+this.substr(1)};String.prototype.trim=function(){v ar B=this.replace(/^\s+/,"");for(var A=B.length-1;A>0;--A){if(/\S/.test(B.charAt(A))){B=B.substring(0,A+1);break}}re turn B};String.prototype.beginsWith=function(A){return A===this.substring(0,A.length)};if(!String.prototype.localeCompare){String.prot otype.localeCompare=function(A){if(this<A){return -1}else{if(this>A){return 1}else{return 0}}}}String.prototype.expand=function(C,A){function B(F,D){var E=C[D];if(null===E||"undefined"===typeof (E)){return A}return E}return this.replace(/\$\{(\w+)\}/g,B)};var CancelledError=DC.defineError("CancelledError");var InvalidStateError=DC.defineError("InvalidStateError");(function(){var C=-1;var A=0;var B=1;DC.Deferred=Class.create({constructor:function(D){this.canceller=D;this._re sult=null;this._status=C;this._callbacks=[]},_fire:function(D){while(this._callb acks.length){this._status=(D instanceof Error)?B:A;this._result=D;var E=this._callbacks.shift()[this._status];if(!E){continue}D=E(D);if(D instanceof DC.Deferred){var F=this;function G(H){F._fire(H);return H}D.addMethods(G,G);return }}this._status=(D instanceof Error)?B:A;this._result=D},result:function(){return this._result},cancel:function(){if(C!==this._status){throw new InvalidStateError("Can not cancel Deferred because it is already complete")}var D=(this.canceller&&this.canceller());if(!(D instanceof Error)){D=new CancelledError("Deferred operation cancelled")}this.failure(D)},addMethods:function(D,E){this._callbacks.push([D,E ]);if(C===this._status){return this}this._fire(this._result);return this},addCallback:function(D){return this.addMethods(D,null)},addErrorHandler:function(D){return this.addMethods(null,D)},callback:function(D){if(C!==this._status){throw new InvalidStateError("Can not signal callback because Deferred is already complete: result="+D)}this._fire(D)},failure:function(D){if(C!==this._status){throw new InvalidStateError("Can not signal failure because Deferred is already complete: error="+D)}this._fire(D)}})})();window.XHR=(function(){var getTransport=function(){throw new Error("XMLHttpRequest not available.")};if(!DC.Browser.IE){getTransport=function(){return new XMLHttpRequest()}}else{var progIdCandidates=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];va r len=progIdCandidates.length;var progId;var xhr;for(var i=0;i<len;++i){try{progId=progIdCandidates[i];xhr=new ActiveXObject(progId);getTransport=function(){return new ActiveXObject(progId)};break}catch(e){}}}function send(url,method,options){var timeout;function noop(){}function cancel(){xhr.onreadystatechange=noop;xhr.abort()}function readyStateChanged(xhrEvent){if(4!==xhr.readyState){return }if(timeout){clearTimeout(timeout)}if(xhrSent===false){arguments.callee.delay(0 );return }var status=xhr.status;var succeeded=(status>=200&&status<300)||304==status;if(0===status||"undefined"===t ypeof (status)){var protocol=window.location.protocol;succeeded="file:"===protocol||"chrome:"===pro tocol}var result=xhr.responseText;var err;if(succeeded){if("HEAD"==method){result={};try{var headers=xhr.getAllResponseHeaders();if(headers){headers=headers.split("\n");hea ders.forEach(function(header){var match=header.match(/^([^:]+):(.+)$/m);var name=match[1].trim();result[name]=match[2].trim()})}}catch(e){}}else{var contentType=options.responseContentType||xhr.getResponseHeader("Content-Type"); if(contentType.match(/(?:application\/(?:x-)?json)|(?:text\/json)/)){try{result= eval("("+result+")")}catch(e){err=e;succeeded=false}}if(contentType.match(/(?:ap plication|text)\/xml/)){result=xhr.responseXML}}}else{err=new Error("XHR request failed");err.url=url;err.method=method;err.xhr=xhr;err.status=xhr.status;err.st atusText="Failed to load resource."}if(succeeded){deferred.callback(result)}else{deferred.failure(err)}x hr.onreadystatechange=noop;xhr=null}var xhr=getTransport();var queryString=Object.toQueryString(options.parameters||{});var body=options.body||"";var async=!options.sync;var deferred=new DC.Deferred(cancel);var xhrSent=false;method=(method||"GET").toUpperCase();try{if("GET"==method){if(que ryString&&-1===url.indexOf("?")){url=url+"?"+queryString}else{if(queryString&&-1 !==url.indexOf("?")){url=url+"&"+queryString}else{if("&"===url.slice(-1)){url=ur l+queryString}else{url=url+queryString}}}}if(options.responseContentType&&xhr.ov errideMimeType){xhr.overrideMimeType(options.responseContentType)}if(options.use r){xhr.open(method,url,async,options.user,options.password||"")}else{xhr.open(me thod,url,async)}var headers=options.headers||{};for(var h in headers){xhr.setRequestHeader(h,headers[h])}if("POST"==method){xhr.setRequestHe ader("Content-Type",options.contentType||"application/x-www-form-urlencoded");bo dy=queryString}if(async){xhr.onreadystatechange=readyStateChanged;timeout=setTim eout(function(){xhr.abort()},30000)}xhr.send(body);xhrSent=true;if(!async){ready StateChanged()}}catch(e){var err=new Error("XHR request failed");err.url=url;err.method=method;err.xhr=xhr;err.status=-1;err.statusText ="Failed to load resource.";deferred.failure(err)}return deferred}return{get:function(url,parameters,options){return XHR.request("GET",url,parameters,options)},post:function(url,parameters,options ){return XHR.request("POST",url,parameters,options)},request:function(method,url,paramet ers,options){method=method.toUpperCase();options=options||{};options.parameters= parameters;return send(url,method,options)}}})();DC.Controller=Class.create(DC.Bindable,{construc tor:function(A){this.base(A)},registerWithName:function(A){if(!A){return }this.name=A;DC.registerModelWithName(this,A)}});DC.Markers={MultipleValues:"Th isIsAnUniqueStringThatRepresentsMultipleValues",NoSelection:"ThisIsAnUniqueStrin gThatRepresentsNoSelection"};DC.SelectionProxy=Class.create(DC.KVO,{constructor: function(A){this.controller=A;this.mutable=true},infoForKey:function(B){var A=this.controller.selectedObjects();var C=A.infoForKey(B);C.mutable&=this.mutable;return C},infoForKeyPath:function(C){var A=this.controller.selectedObjects();var B=A.infoForKeyPath(C);B.mutable&=this.mutable;return B},translateValue:function(D){if("array"!==DC.typeOf(D)){return D}if(1===D.length){return D[0]}var C;var A;var B=D[0];for(C=1,A=D.length;C<A;++C){if(0!==DC.compareValues(B,D[C])){return DC.Markers.MultipleValues}}return B},valueForKey:function(C){var B=this.controller.selectedObjects();if(0===B.length){return DC.Markers.NoSelection}var A=B.valueForKey(C);return this.translateValue(A)},validateValueForKeyPath:function(E,F){var B=this.controller.selectedObjects();var A=B.length;var D;if(0===A){return E}var C;for(D=0;D<A;++D){C=B[D].validateValueForKeyPath(E,F);if(C instanceof DC.Error){return C}}return C},valueForKeyPath:function(C){var B=this.controller.selectedObjects();if(0===B.length){return DC.Markers.NoSelection}var A=B.valueForKeyPath(C);return this.translateValue(A)},setValueForKey:function(D,C){if(!this.mutable){return }var B=this.controller.selectedObjects();var A=this.valueForKey(C);B.setValueForKey(D,C);var E=this.valueForKey(C);if(A===E){return }var F=new DC.ChangeNotification(this,DC.ChangeType.setting,E,A);this.notifyObserversOfCha ngeForKeyPath(F,C)},setValueForKeyPath:function(C,F){if(!this.mutable){return }var B=this.controller.selectedObjects();var A=this.valueForKeyPath(F);B.setValueForKeyPath(C,F);var D=this.valueForKeyPath(F);if(A===D){return }var E=new DC.ChangeNotification(this,DC.ChangeType.setting,D,A);this.notifyObserversOfCha ngeForKeyPath(E,F)}});DC.ObjectController=Class.create(DC.Controller,{constructo r:function(A){this.base(A);this.objectClass=DC.KVO;this.__content=null;this.__ed itable=true;this.__selectedObjects=[];this.__selection=new DC.SelectionProxy(this)},observeChildObjectChangeForKeyPath:function(F,E,B){thi s.base(F,E,B);if("selectedObjects"!==B){return }var C="selection."+E;var D=this.valueForKeyPath(C);var A=new DC.ChangeNotification(this,DC.ChangeType.setting,D,null);this.notifyObserversOf ChangeForKeyPath(A,C)},keyDependencies:{},exposedBindings:["editable","content"] ,editable:function(){var A=this.__editable;if(this.bindings.content){A&=this.bindings.content.mutable()} return A},setEditable:function(A){if(this.bindings.content){A&=this.bindings.content.m utable()}if(this.bindings.editable){this.bingings.editable.setValue(A)}this.__ed itable=A},content:function(){return this.__content},setContent:function(A){if(this.bindings.content){this.bindings. content.setValue(A)}this.__content=A;this.willChangeValueForKey("selectedObjects ");if(!A){this.__selectedObjects=[]}else{this.__selectedObjects=[A]}this.didChan geValueForKey("selectedObjects");this.forceChangeNotificationForKey("selection") },selectedObjects:function(){return this.__selectedObjects},selection:function(){return this.__selection}});DC.AjaxController=Class.create(DC.ObjectController,{flushCo ntentBeforeQuery:false,fetchesInitially:true,constructor:function(A){this.queryD elay=0;this.url="";this.method="GET";this.base(A);if(this.parameters){DC.KVO.ada ptTree(this.parameters)}else{this.parameters=new DC.KVO()}this.addObserverForKeyPath(this,this.queryUpdated,"url");this.addObser verForKeyPath(this,this.queryUpdated,"method")},__postConstruct:function(){this. base();if(this.fetchesInitially&&this.url&&this.url.length&&this.validateParamet ers()){this.forceChangeNotificationForKey("url")}},validateParameters:function() {return true},fullURL:function(){var H={};var E=this.parameters.mutableKeys();var A=E.length;var B=this.url;var D;var G;for(var C=0;C<A;++C){G=E[C];if(this.parameters.hasOwnProperty(G)){H[G]=this.parameters[ G]}}D=Object.

  • MB5B Report table for Open and Closing stock on date wise

    Hi Frds,
    I am trying get values of Open and Closing stock on date wise form the Table MARD and MBEW -Material Valuation but it does not match with MB5B reports,
    Could anyone suggest correct table to fetch the values Open and Closing stock on date wise for MB5B reports.
    Thanks
    Mohan M

    Hi,
    Please check the below links...
    Query for Opening And  Closing Stock
    Inventory Opening and Closing Stock
    open stock and closing stock
    Kuber

  • Report for open and shipped qty

    hi,
    any standard report to show open and shipped qty by SO no.?
    pls advice. thanks

    Hi jojo
    For list of open orders t.code is VA05
    Incomplete delivery - V_UC 
    Reward if useful
    Regards
    Srinath
    Edited by: sri nath on Apr 16, 2008 10:31 PM

Maybe you are looking for