var varFlashVars;
var varObjFlashViewer;
var varAnimationName;
var pageUrl;

//alert("in popoup mgr");

function getRoot()
{
    var strPath = window.location.href;
    var ct = strPath.lastIndexOf("/");
    //var strPath2 = strPath.substring(0,ct);
    //ct = strPath2.lastIndexOf("/");
    strPath = strPath.substring(0,ct+1);
    GB_ROOT_DIR = strPath;
}


function showAnimation(animationPath, varWidth, varHeight) 
{   
    if(varWidth != null  && varHeight != null)
    {
        getRoot();
        pageTitle = "Animation";
        pageUrl = "AnimationViewer.aspx?a=" + animationPath + "&w=" + varWidth + "&h=" + varHeight ;
        varAnimationName = animationPath;
        var productID=0;var Currency=0;var Price=0;
        loadAnimation(pageUrl, pageTitle, productID, Currency, Price,varWidth, varHeight);
    }
    else
    {
        varWidth = "";
        varHeight = "";
        getRoot();
        pageTitle = "Animation";
        pageUrl = "AnimationViewer.aspx?a=" + animationPath ;
        varAnimationName = animationPath;
        var productID=0;var Currency=0;var Price=0;
        loadAnimation(pageUrl, pageTitle, productID, Currency, Price);
    }
}


function loadAnimation(pageURL, pageTitle, productID, Currency, Price, varWidth, varHeight)
{    
    var timer = 1000;     
    var url = pageURL;//+".aspx";
    if (varWidth != undefined)
    {
        t = setTimeout("GB_showCenter( '" + pageTitle + "','" + pageURL + "',parseInt( " + varHeight + "),parseInt(" + varWidth + ") ); sessvars.myObj = {poppedup: true};", timer);
    }
    else
    {
        t = setTimeout("GB_showCenter( '" + pageTitle + "','" + pageURL + "',parseInt(495),parseInt(880) ); sessvars.myObj = {poppedup: true};", timer);
    }
}


function CloseWindow() 
{
    parent.GB_hide_new_page();
}


