﻿function HideLabel(oLabel)
{
    document.getElementById(oLabel).style.display = 'none';
}

function ResetLogin()
{
    document.getElementById("ctl00_body_txtExistingEmail").value = "";
    document.getElementById("ctl00_body_txtExistingPassword").value = "";
    document.getElementById("ctl00_body_pnlLoginMessage").style.display = 'none';
    document.getElementById("ctl00_body_txtExistingEmail").focus();
}

function ResetLogin2()
{
    document.getElementById("ctl00_body_txtNewFirstName").value = "";
    document.getElementById("ctl00_body_txtNewSurname").value = "";
    document.getElementById("ctl00_body_txtNewEmail").value = "";
    document.getElementById("ctl00_body_txtNewPassword").value = "";
    document.getElementById("ctl00_body_txtNewConfirmPassword").value = "";
    document.getElementById("ctl00_body_pnlLoginMessage2").style.display = 'none';
    document.getElementById("ctl00_body_txtNewFirstName").focus();
}

function WatchItem()
{
    alert("Boo!");
    return false;
}

function addFav()
{
if (document.all)
	window.external.AddFavorite('http://www.find-dvd.co.uk/', 'Cheap DVDs');
else
	alert("Sorry. Netscape users must bookmark the pages manually by hitting <Ctrl-D>");
}

function eMail() {
	window.location = "mailto:info@find-cd.co.uk"
}

function ValidatePrice(oPrice)
{
    
    oPriceVal = document.getElementById(oPrice).value;
    
     if (isNaN(oPriceVal) || oPriceVal == "") 
     {
        alert('Must be numerical');
        return false;
     }
     else 
     {
        if (oPriceVal.indexOf('.') == -1) 
        {
            return true;
        }
        else 
        {
            dectext = oPriceVal.substring(oPriceVal.indexOf('.')+1, oPriceVal.length);
            if (dectext.length > 2)  
            {
                alert('No more than 2 digits after the decimal point');
                return false;
            }
            else
            {
                return true;
            }
        }
    }
}

function ValidatePrice2(oPrice, oPWID)
{
    
    oPriceVal = document.getElementById(oPrice).value;
    
     if (isNaN(oPriceVal) || oPriceVal == "") 
     {
        alert('Must be numerical');
        return false;
     }
     else 
     {
        if (oPriceVal.indexOf('.') == -1) 
        {
            animatedcollapse.hide(oPWID);
            return true;
        }
        else 
        {
            dectext = oPriceVal.substring(oPriceVal.indexOf('.')+1, oPriceVal.length);
            if (dectext.length > 2)  
            {
                alert('No more than 2 digits after the decimal point');
                return false;
            }
            else
            {
                animatedcollapse.hide(oPWID);
                return true;
            }
        }
    }
}

function ConfirmDelete()
{
    var blnConf = confirm("Are you sure you wish to delete this item from your watch list?");
    
    return blnConf;
}


function doClick(buttonName,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;

         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
                btn.click();
                event.keyCode = 0
            }
        }
   }


function showTrailer(URL) {
window.open(URL, 'DVDTrailer', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400,left = 810,top = 500');
}
function eMail() {
var nxt="o@f"
window.location = "mail"+"to:inf"+nxt+"ind"+"-dvd.co.uk"
}
function setTrailer(f_id,m_id)
{
    document.getElementById("trailerDiv").innerHTML="<object id='MediaPlayer' width=480 height=360 classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading Windows Media Player components...' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'><param name='filename' value='http://flvplayer.mymovies.net/medifusion/player.swf?fid="+f_id+"&mid="+m_id+"&mtid=trl&mspd=700&mxspd=1200&fti=Trailer&pread=&postad=&partner=medifusion'><param name='Showcontrols' value='False'><embed type='application/x-mplayer2' src='http://flvplayer.mymovies.net/medifusion/player.swf?fid="+f_id+"&mid="+m_id+"&mtid=trl&mspd=700&mxspd=1200&fti=Trailer&pread=&postad=&partner=medifusion' name='MediaPlayer' pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/' width=480 height=360></embed></object>";
}
