﻿    var xmlHttpObj = null;
    var xmlHttpObjFilm = null;
    
    if ( navigator.appName == "Netscape" )
    {
        navigator.plugins.refresh();
    }

    function playvideo(arg)
    {
            if (!xmlHttpObjFilm)
              xmlHttpObjFilm = CreateXmlHttpRequestObject();
     
             if (xmlHttpObjFilm)
            {
                if(xmlHttpObjFilm.readyState != READYSTATE_LOADING)
                {
                        xmlHttpObjFilm.open("GET","http://" + location.host + "/video/video.ashx?arg="+arg, true);
                        xmlHttpObjFilm.onreadystatechange = function()
                        {
                            elShowFilm232 = document.getElementById('playv');
                            if(elShowFilm232)
                            {
                                if (xmlHttpObjFilm.readyState == READYSTATE_COMPLETE)
                                {
                                    elShowFilm232.className = "player";
                                    if (xmlHttpObjFilm.status == HTTPSTATUS_OK)
                                    {
                                    
                                        if(xmlHttpObjFilm.responseText !="")
                                        {
                                            elShowFilm232.innerHTML ='<OBJECT ID="NSPlay" WIDTH=320 HEIGHT=309 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">     <PARAM NAME="FileName" VALUE="'+xmlHttpObjFilm.responseText +'">     <PARAM NAME="ShowControls" VALUE="1">     <PARAM NAME="ShowDisplay" VALUE="0">     <PARAM NAME="ShowStatusBar" VALUE="1">     <PARAM NAME="AutoSize" VALUE="1">     <Embed type="application/x-mplayer2"    pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" filename="'+xmlHttpObjFilm.responseText+'" src="'+xmlHttpObjFilm.responseText+'" Name=NSPlay    ShowControls=1 ShowDisplay=0 ShowStatusBar=1 width=320 height=309> </embed> </OBJECT>';                            
                                        }
                                        else
                                            elShowFilm232.innerHTML ='<div style="color:Blue; font-size:11px;">this film is not listed on the londonart.co.uk</div>';
                                    }
                                    else
                                    {
                                        elShowFilm232.innerHTML ='<div style="color:Blue; font-size:11px;">this film is not listed on the londonart.co.uk</div>';
                                    }
                                }
                                if(xmlHttpObjFilm.readyState == READYSTATE_LOADING)
                                {
                                    elShowFilm232.className = "loading";
                                    elShowFilm232.innerHTML ='&nbsp;';
                                }
                            }
                        }
                        xmlHttpObjFilm.send(null);
                    }
            }
            
      
    }
    
    var xmlHttpObjFilm2 = null;
    function playvideo2(arg, elm)
    {
            if (!xmlHttpObjFilm2)
              xmlHttpObjFilm2 = CreateXmlHttpRequestObject();
     
             if (xmlHttpObjFilm2)
            {
                if(xmlHttpObjFilm2.readyState != READYSTATE_LOADING)
                {
                        xmlHttpObjFilm2.open("GET","http://" + location.host + "/video/video.ashx?arg="+arg, true);
                        xmlHttpObjFilm2.onreadystatechange = function()
                        {
                                if (xmlHttpObjFilm2.readyState == READYSTATE_COMPLETE)
                                {
                                    if (xmlHttpObjFilm2.status == HTTPSTATUS_OK)
                                    {
                                        if(xmlHttpObjFilm2.responseText !="")
                                        {
                                            elm.target = "_new";
                                            elm.location = xmlHttpObjFilm2.responseText;
                                        }
                                    }
                                }
                        }
                        xmlHttpObjFilm2.send(null);
                    }
            }
    }
    
    function showart(arg)
    {
        if (!xmlHttpObj)
               xmlHttpObj = CreateXmlHttpRequestObject();
            if (xmlHttpObj)
            {
                if(xmlHttpObj.readyState != READYSTATE_LOADING)
                {
                    xmlHttpObj.open("GET","http://" + location.host + "/video/artwork.ashx?arg="+arg, true);
                    xmlHttpObj.onreadystatechange = function()
                    {
                        elShowArt232 = document.getElementById('artprev');
                        if(elShowArt232)
                        {
                            if (xmlHttpObj.readyState == READYSTATE_COMPLETE)
                            {
                                elShowArt232.className = "artworks";
                                if (xmlHttpObj.status == HTTPSTATUS_OK)
                                {
                                
                                    if(xmlHttpObj.responseText !="")
                                    {
                                        elShowArt232.innerHTML = xmlHttpObj.responseText;
                                    }
                                    else
                                        elShowArt232.innerHTML ='<div style="color:Blue; font-size:11px;">No artworks in this section.</div>';
                                }
                                else
                                {
                                    elShowArt232.innerHTML ='<div style="color:Blue; font-size:11px;">No artworks in this section.</div>';
                                }
                                
                            }
                            if(xmlHttpObj.readyState == READYSTATE_LOADING)
                            {
                                elShowArt232.className = "loading";
                                elShowArt232.innerHTML ='&nbsp;';
                            }
                        }
                    }
                    xmlHttpObj.send(null);
                 }
            }
            
    }
    function playvideosync(arg)
    {
       elShowArt232 = document.getElementById('playv');
        if(elShowArt232)
        {
                if(arg)
                {
                    elShowArt232.className = "player";
                    elShowArt232.innerHTML ='<OBJECT ID="NSPlay" WIDTH=320 HEIGHT=309 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">     <PARAM NAME="FileName" VALUE="'+ arg +'">     <PARAM NAME="ShowControls" VALUE="1">     <PARAM NAME="ShowDisplay" VALUE="0">     <PARAM NAME="ShowStatusBar" VALUE="1">     <PARAM NAME="AutoSize" VALUE="1">     <Embed type="application/x-mplayer2"    pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" filename="'+arg+'" src="'+arg+'" Name=NSPlay    ShowControls=1 ShowDisplay=0 ShowStatusBar=1 width=320 height=309> </embed> </OBJECT>';                            
                }
                else
                {
                    elShowArt232.innerHTML ='<div style="color:Blue; font-size:11px;">this video is not listed on the londonart.co.uk</div>';
                }
        }
    }
    function PlayVideoReal(url)
    {
        elShowArt232 = document.getElementById('playv');
        if(elShowArt232)
        {
            elShowArt232.innerHTML = '<object width="320" height="309" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"> <param name="controls" value="All" /> <param name="autostart" value="true" /> <param name="src" value="mms://www.londonart.co.uk/'+ url +'" /> <embed type="video/x-ms-asf" src="mms://www.londonart.co.uk/'+url+'" > </embed></object>';
        }
    }
   
   
