var LogoStep = 1;    
var DemoVisible = 1;

function rearrange () 
{   
    location.reload ();
}

function showimage1 (imagepage)
{
    var imagewindow1 = window.open(imagepage,'imagewindow1','width=290,height=440,top=390,left=500');
    
    if (imagewindow1.opener == null)
        imagewindow1.opener = self;

    imagewindow1.focus (); 
}

function opensizedwindow (page)
{
    var sizedwindow = window.open (page, 'page', 'width=400,height=350,top=200,left=200');

    if (sizedwindow.opener == null)
        sizedwindow.opener = self;

    sizedwindow.focus ();
}

function opentrivia ()
{
    var triviawindow = window.open ('http://www.daviscup.com/trivia.htm', 'trivia', 'width=402,height=402,top=200,left=200');
}

function openpanorama ()
{
    var panwindow = window.open ('http://www.daviscup.com/panorama/panorama.htm', 'Panoramic Live Camera', 'width=320,height=320,top=100,left=100');
}

function showplayerpicture (imagepage)
{
    var picturewindow1 = window.open(imagepage,'picturewindow1','width=290,height=440,top=390,left=500');
    
    if (picturewindow1.opener == null)
        picturewindow1.opener = self;

    picturewindow1.focus (); 
}

function netcam1 ()
{
    var netcamwindow1 = window.open('http://193.149.47.3/live1.htm','netcamwindow1','width=196,height=204,top=390,left=500');
}

function netcam2 ()
{
    var netcamwindow2 = window.open('http://193.149.47.3/live2.htm','netcamwindow2','width=196,height=204,top=390,left=500');
}

function netcam3 ()
{
    var netcamwindow3 = window.open('http://193.149.47.3/live3.htm','netcamwindow3','width=196,height=204,top=390,left=500');
}

function netcam4 ()
{
    var netcamwindow4 = window.open('http://193.149.47.3/live4.htm','netcamwindow4','width=196,height=204,top=390,left=500');
}

function resizestats ()
{
    window.resizeTo (520,379);
}

function resizealone ()
{
    window.resizeTo (410,129);
}

function checkandresizealone ()
{
    if (dmIsNavigator ())
    {
        ;
    }

    else
    {
        window.resizeTo (410,129);
    }
}

function checknav (newdoc)
{
    if (dmIsNavigator ())
    {
        location.replace (newdoc);        
    }

    else
    {
        animateLogo ();
    }
}

function standalone (resultspage)
{
    var resultswindow1 = window.open(resultspage,'resultswindow1','width=400,height=100,top=100,left=100');
    
    if (resultswindow1.opener == null)
        resultswindow1.opener = self;

    resultswindow1.focus (); 
}

function showimage2 (imagepage)
{
    var imagewindow2 = window.open(imagepage,'imagewindow2','width=425,height=310,top=190,left=300');
    
    if (imagewindow2.opener == null)
        imagewindow2.opener = self;

    imagewindow2.focus (); 
}

function showstats (imagepage)
{
    var statswindow1 = window.open(imagepage,'statswindow1','width=510,height=350,top=390,left=500');
    
    if (statswindow1.opener == null)
        statswindow1.opener = self;

    statswindow1.focus (); 
}

function showcam (imagepage)
{
    var camwindow1 = window.open(imagepage,'camwindow1','width=372,height=344,top=390,left=500');
    
    if (camwindow1.opener == null)
        camwindow1.opener = self;

    camwindow1.focus (); 
}

function animateLogo ()
{
    if (dmIsNavigator ())
    {
        BrowserHeight = document.innerHeight;
    }

    else if (dmIsExplorer ())
    {
        BrowserHeight = document.body.clientHeight;

        if (posY ("Logo") > BrowserHeight)
        {
            LogoStep = -1;

            dmMoveBy ("Logo", 0, LogoStep);
        }

        else if (posY ("Logo") < 5)
        {
            LogoStep = 1;

            dmMoveBy ("Logo", 0, LogoStep);
        }
      
        else
        {
            dmMoveBy ("Logo", 0, LogoStep);
        }

        setTimeout ("animateLogo()", 40);
    }
}

function animateLogo2 ()
{
    if (dmIsNavigator ())
    {
        BrowserHeight = document.innerHeight;
    }

    else if (dmIsExplorer ())
    {
        BrowserHeight = document.body.clientHeight;

        if (posY ("Logo") > BrowserHeight)
        {
            LogoStep = -1;

            dmMoveBy ("Logo", 0, LogoStep);
        }

        else if (posY ("Logo") < 5)
        {
            LogoStep = 1;

            dmMoveBy ("Logo", 0, LogoStep);
        }
      
        else
        {
            dmMoveBy ("Logo", 0, LogoStep);
        }

        setTimeout ("animateLogo2()", 40);
    }
}

function dmUpdateFrames (URL1, URL2)
{  
    parent.frames [1].location.href = URL1;
    parent.frames [2].location.href = URL2;
}

function dmSuppressErrors ()
{
    return (true);
}

function dmIsDynamicBrowser ()
{
    if (parseInt (navigator.appVersion) < 4)
    {
        alert ("Sorry, but this page needs a version 4 browser to display.");
        
        return (false);
    }

    else
    {
        return (true);
    }	
}

function dmIsExplorer ()
{
    if (navigator.appName.indexOf ("Microsoft") != -1)
    {
        return (true);
    }

    else
    {
        return (false);
    }	
}

function dmIsNavigator ()
{
    if (navigator.appName.indexOf ("Netscape") != -1)
    {
        return (true);
    }

    else
    {
        return (false);
    }	
}

function posY (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        return (LayerObject.pixelTop);                
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        return (LayerObject.top);
    }
}

function posX (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        return (LayerObject.pixelLeft);                
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        return (LayerObject.left);
    }
}

function offsetY (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        return (LayerObject.offsetTop);                
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        return (LayerObject.top);
    }
}

function offsetX (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        return (LayerObject.offsetLeft);                
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        return (LayerObject.left);
    }
}

function dmMoveTo (dmObject, dmX, dmY)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        LayerObject.pixelLeft = dmX;
        LayerObject.pixelTop  = dmY;                
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        LayerObject.left = dmX;
        LayerObject.top  = dmY;
    }
}

function dmMoveBy (dmObject, dmX, dmY)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        LayerObject.pixelLeft += dmX;
        LayerObject.pixelTop  += dmY;    
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        LayerObject.left += dmX;
        LayerObject.top  += dmY;
    }
}

function dmShow (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');
    
        LayerObject.visibility = "visible";
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        LayerObject.visibility = "show";
    }
}

function dmHide (dmObject)
{
    if (dmIsExplorer ())
    {
        LayerObject = eval ('document.all' + '[dmObject]' + '.style');

        LayerObject.visibility = "hidden";
    }

    else if (dmIsNavigator ())
    {
        LayerObject = eval ('document' + '[dmObject]');

        LayerObject.visibility = "hide";
    }
}

function dmCloseMenus ()
{
    dmHide ("Menu1");
    dmHide ("Menu2");
    dmHide ("Menu3");
    dmHide ("Menu4");
    dmHide ("Menu5");
    dmHide ("Menu6");

    dmShow ("MenuButton1");
    dmShow ("MenuButton2");
    dmShow ("MenuButton3");
    dmShow ("MenuButton4");
    dmShow ("MenuButton5");
    dmShow ("MenuButton6");

    dmMoveTo ("Menu1", 20,  76);	
    dmMoveTo ("Menu2", 20, 105);	
    dmMoveTo ("Menu3", 20, 134);	
    dmMoveTo ("Menu4", 20, 163);	
    dmMoveTo ("Menu5", 20, 192);	
    dmMoveTo ("Menu6", 20, 221);	

    dmMoveTo ("MenuButton1", 20,  76);	
    dmMoveTo ("MenuButton2", 20, 105);	
    dmMoveTo ("MenuButton3", 20, 134);	
    dmMoveTo ("MenuButton4", 20, 163);	
    dmMoveTo ("MenuButton5", 20, 192);	
    dmMoveTo ("MenuButton6", 20, 221);	
}

function dmOpenMenu (dmMenu)
{ 
    dmCloseMenus ();	

    if (dmMenu == 1)
    {	
        dmMoveBy ("MenuButton2", 0, 58);
        dmMoveBy ("MenuButton3", 0, 58);
        dmMoveBy ("MenuButton4", 0, 58);
        dmMoveBy ("MenuButton5", 0, 58);
        dmMoveBy ("MenuButton6", 0, 58);

        dmShow ("Menu1");	    

        dmHide ("MenuButton1");
    }

    else if (dmMenu == 2)
    {
        dmMoveBy ("MenuButton3", 0, 75);
        dmMoveBy ("MenuButton4", 0, 75);
        dmMoveBy ("MenuButton5", 0, 75);
        dmMoveBy ("MenuButton6", 0, 75);

        dmShow ("Menu2");	    

        dmHide ("MenuButton2");
    }

    else if (dmMenu == 3)
    {
        dmMoveBy ("MenuButton4", 0, 32);
        dmMoveBy ("MenuButton5", 0, 32);
        dmMoveBy ("MenuButton6", 0, 32);

        dmShow ("Menu3");	    

	dmHide ("MenuButton3");
    }

    else if (dmMenu == 4)
    {
        dmMoveBy ("MenuButton5", 0, 43);  
        dmMoveBy ("MenuButton6", 0, 43);  

        dmShow ("Menu4");	    

	dmHide ("MenuButton4");
    }

    else if (dmMenu == 5)
    {
        dmMoveBy ("MenuButton6", 0, 87);

        dmShow ("Menu5");	    

	dmHide ("MenuButton5");
    }

    else if (dmMenu == 6)
    {
        dmShow ("Menu6");	    

        dmHide ("MenuButton6");
    }
}

function dmIssue (IssueString)
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsi.dll?did=news' + IssueString + '.htm';
}

function dmTeamsSearch ()
{
    dmUpdateFrames ('teamshead2.htm','tsearch.htm');
}

function dmNewsCurrent ()
{
    dmUpdateFrames ('headframe.htm','scripts/dcnews1.dll?did=news44.htm');
}

function dmNewsSearch ()
{
    dmUpdateFrames ('newshead2.htm','newss.htm');
}

function dm1996 ()
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsi32c8.html?did=news5.htm';    
    location = "issues96.htm";
}

function dm1997 ()
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsi3e7f.html?did=news24.htm';    
    location = "issues97.htm";
}

function dm1998 ()
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsiab35.html?did=news25.htm';    
    location = "issues98.htm";
}

function dm1999 ()
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsi3ec8.html?did=news37.htm';    
    location = "issues99.htm";
}

function dm2000 ()
{
    parent.parent.frames [2].location.href = 'scripts/dcnewsi2073.html?did=news38.htm';    
    location = "issues.htm";
}

function dmChat ()
{
    dmUpdateFrames ('interhead.htm','newchat.htm');
}

function dmChat2 ()
{
    dmUpdateFrames ('interhead.htm','http://www.freiraum.com/chat/chat.htm');
}

function dmChat3 ()
{
    dmUpdateFrames ('http://www.daviscup.com/interhead.htm','http://193.149.47.2/chat/chat.htm');
}

function dmResultsCurrent ()
{
    dmUpdateFrames ('resultsheadbx.htm','results.htm');
}

function dmResultsZonal ()
{
    dmUpdateFrames ('resultshead3.htm','zonalgroups.htm');
}

function dmResultsDraw ()
{
    dmUpdateFrames ('resultshead4.htm','draw.htm');
}

function dmResultsPrevious ()
{
    dmUpdateFrames ('resultshead2.htm','resultsp1999.htm');
}

function dmStartNewsSearch ()
{
    querystring = "http://www.daviscup.com/scripts/dcnewss.dll?sfy=" + document.formular1.sfy.value + 
                  "&sly="  + document.formular1.sly.value + 
                  "&ste="  + document.formular1.ste.value + 
                  "&spl="  + document.formular1.spl.value +
                  "&sco="  + document.formular1.sco.value;

    window.location.href = querystring;
}

function dmShop ()
{
    ;
}

function dmTeamsCurrent (Team1, Team2)
{
    dmUpdateFrames ('teamshead.htm','scripts/dcsql.dll?sx=nh&n1=' + Team1 + '&n2=' + Team2 + '&');
}

function dmTeamsQualify ()
{
    dmUpdateFrames ('teamshead3.htm','2001_Teams.asc');
}

function dmHistory ()
{
    dmUpdateFrames ('historyhead.htm','history.htm');
}

function dmRadio ()
{
    dmUpdateFrames ('radiohead.htm','radio.htm');
}

function dmPanorama ()
{
    if (dmIsNavigator ())
    {
        dmUpdateFrames ('panohead.htm','panoraman.htm');
    }

    else
    {
        dmUpdateFrames ('panohead.htm','panorama.htm');
    }
}

function dmRules ()
{
    dmUpdateFrames ('ruleshead.htm','rules.htm');
}

function dmGoHistory ()
{
    parent.frames[0].dmOpenMenu (4);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/historyhead.htm','http://www.geocities.com/jordiperez46/history.htm');
}

function dmGoRadio ()
{
    parent.frames[0].dmOpenMenu (5);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/radiohead.htm','http://www.geocities.com/jordiperez46/radio.htm');
}

function dmGoChat ()
{
    parent.frames[0].dmOpenMenu (5);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/interhead.htm','http://www.geocities.com/jordiperez46/newchat.htm');
}

function gopanorama ()
{
    parent.frames[0].dmOpenMenu (5);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/panohead.htm','http://www.geocities.com/jordiperez46/panorama.htm');
}

function dmGoChat2 ()
{
    parent.frames[0].dmOpenMenu (5);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/interhead.htm','http://www.freiraum.com/chat/chat.htm');
}

function dmFAQ ()
{
    dmUpdateFrames ('faqhead.htm','faq.htm');
}

function dmGames ()
{
    dmUpdateFrames ('interhead2.htm','gameover.htm');
}

function dmWAPSMS ()
{
    dmUpdateFrames ('interwap.htm','sms-wap.htm');
}

function dmLocations ()
{
    dmUpdateFrames ('locationshead.htm','location1.htm');
}

function dmLinks ()
{
    dmUpdateFrames ('linkshead.htm','links.htm');
}

function dmFansites ()
{
    dmUpdateFrames ('fanhead.htm','fansites.htm');
}

function dmGuestbook ()
{
    dmUpdateFrames ('guesthead.htm','guestbook.htm');
}

function dmPolls ()
{
    dmUpdateFrames ('pollshead.htm','polls.htm');
}

function dmAbout ()
{
    dmUpdateFrames ('abouthead.htm','about.htm');
}

function dmTickets ()
{
    dmUpdateFrames ('ticketshead.htm','tickets.htm');
}

function dmTV ()
{
    dmUpdateFrames ('tvschedhead.htm','tvsched.htm');
}

function dmGoSMS ()
{
    parent.frames[0].dmOpenMenu (5);	
    dmUpdateFrames ('http://www.geocities.com/jordiperez46/interwap.htm','http://www.geocities.com/jordiperez46/sms-wap.htm');
}

window.onerror = null;

dmIsDynamicBrowser ();



