function getObj(objID)
{
    if (document.getElementById) {return document.getElementById(objID);}
    else if (document.all) {return document.all[objID];}
    else if (document.layers) {return document.layers[objID];}
}

function vbvlearn()
{
    ifObj = window.frames[0].frames[0];
    ifObj.src="register.aspx?cmd=vbvlearn";
    ifObj.location.href="register.aspx?cmd=vbvlearn";
}

function showCart()
{
    /*
    try
    {
        ifObj = window.frames[0];
        if (ifObj==undefined) 
        {
            ifObj=parent.window;
        }
        ifObj.src="cart.aspx";
        ifObj.location.href="cart.aspx";
    }
    catch(e) 
    {
    }
    */
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx?cmd=cart";
        ifObj.location.href="register.aspx?cmd=cart";
    }
    catch(e) 
    {
    }
}
function goHome()
{
    try
    {
        ifObj = parent.window;
        ifObj.src="master.aspx";
        ifObj.location.href="master.aspx";
    }
    catch(e) 
    {
    }
}
function goRegister()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx";
        ifObj.location.href="register.aspx";
    }
    catch(e) 
    {
    }
}
function goProducts()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx?cmd=list";
        ifObj.location.href="register.aspx?cmd=list";
    }
    catch(e) 
    {
    }
}
function goEditUser()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        //ifObj=getObj("MainIFrame").document.frames[0].document.frames["ContentIFrame"];
        ifObj.src="register.aspx?cmd=edituser";
        ifObj.location.href="register.aspx?cmd=edituser";
    }
    catch(e) 
    {
    }
}

function goChangePass()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        //ifObj=getObj("MainIFrame").document.frames[0].document.frames["ContentIFrame"];
        ifObj.src="register.aspx?cmd=changepass";
        ifObj.location.href="register.aspx?cmd=changepass";
    }
    catch(e) 
    {
    }
}

function goGetPassword()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx?cmd=getpass";
        ifObj.location.href="register.aspx?cmd=getpass";
    }
    catch(e) 
    {
    }
}
function goInvite()
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx?cmd=invite";
        ifObj.location.href="register.aspx?cmd=invite";
    }
    catch(e) 
    {
    }
}
function goDetail(id)
{
    try
    {
        //ifObj = window.frames[0].frames[0];
        ifObj = window.frames[0];
        ifObj.src="register.aspx?cmd=detail&id" + id;
        ifObj.location.href="register.aspx?cmd=detail&id" + id;
    }
    catch(e) 
    {
    }
}
function goPoints()
{
    try
    {
        ifObj = window.frames[0];
        //ifObj=getObj("MainIFrame").document.frames[0].document.frames["ContentIFrame"];
        ifObj.src="register.aspx?cmd=points";
        ifObj.location.href="register.aspx?cmd=points";
    }
    catch(e) 
    {
    }
}
function go(cmd)
{
    try
    {
        ifObj = window.frames[0];
        ifObj.src="master.aspx?cmd=" + cmd;
        ifObj.location.href="master.aspx?cmd=" + cmd;
    }
    catch(e) 
    {
    }
}

function setCartInfo(text) 
{
    ifObj = parent.parent.getObj("CartInfo");
    ifObj.innerHTML=text;
}

function goPayPal(link) 
{
    //ifObj = parent.parent.getObj("MainIFrame");
    //ifObj = parent.parent.parent.getObj("IFPayPal");
    //window.open(link) 
    parent.parent.parent.parent.location.href=link;
    //ifObj.width='90%';
    //ifObj.height='90%';
    //ifObj.src=link;
}

function setConfirmation(pmt) 
{
    if(pmt=="true") 
    {
    //alert("O seu pagamento foi confirmado!\n\rFoi enviado um email a confirmar a encomenda.\n\r\n\rObrigado!");
    } 
    else 
    {
    //alert("O seu pagamento não foi confirmado!\n\r\n\rPor favor tente de novo.");
    }
}

function confirmUnicre() 
{
    parent.location.href="3dsok.aspx";
}

function confirmPayPal() 
{
    location.href="default.aspx?cmd=payconfirm";
}
function retry(payopt, message)
{
    parent.location.href="order.aspx?payopt=" + payopt + "&msg=" + message;
    alert(message);
}


function setUpdated(sUpdated)
{
    try 
    {
        var Obj = getObj('lblResult');
        Obj.innerHTML=sUpdated;
    } 
    catch (e) 
    {
        try 
        {
            var Obj2 = parent.getObj('lblResult');
            Obj2.innerHTML=sUpdated;
        } 
        catch (e) 
        {
        }
    }
}

function setValidation(obj, id, lng, hash)
{
    try 
    {
        var Obj = getObj('IFMainContent');
        Obj.src="content.aspx?obj=" + obj + "&id=" + id + "&lng=" + lng + "&hash=" + hash;
    } 
    catch (e) 
    {
        try 
        {
            var Obj2 = getObj('MainIFrame');
            Obj2.src="master.aspx?obj=" + obj + "&id=" + id + "&lng=" + lng + "&hash=" + hash;
        } 
        catch (e) 
        {
        
            var Obj3 = getObj('ContentIFrame');
            Obj3.src="validate.aspx?obj=" + obj + "&id=" + id + "&lng=" + lng + "&hash=" + hash;
        }
    }
}

function setRegistration(id)
{   
    try 
    {
        var Obj = getObj('IFMainContent');
        Obj.src="content.aspx?sponsor="  + id;
    } 
    catch (e) 
    {
        try 
        {
            var Obj2 = getObj('MainIFrame');
            Obj2.src="master.aspx?sponsor="  + id;
        } 
        catch (e) 
        {
        
            var Obj3 = getObj('ContentIFrame');
            Obj3.src="register.aspx?sponsor="  + id;
        }
    }
}

function redirectAfterValidation()
{
    try 
    {
        ifObj = parent.parent.document.location.href="content.aspx";
    } 
    catch (e) 
    {
    }
}

function emptyCart()
{
        ifObj = parent.parent.window;
        //ifObj=getObj("MainIFrame").document.frames[0].document.frames["ContentIFrame"];
        ifObj.location.href="content.aspx";
}

function setFrameTitle(sTitle) 
{
    try
    {
    divObj = parent.getObj("DivTitle");
    divObj.innerHTML = sTitle;
    }
    catch (e)
    {
    }
}

function goback() 
{
    history.go(-1);
}
