﻿
// for header link to change language
//---------------------------------------------
function ChangeLanguage(lid)
{   
    var nowUri=String (window.parent.location);
    var targetUri="";
    
    if(nowUri.indexOf('?')==-1)
        targetUri=nowUri +"?lid="+lid;
    else
    {
        var firstSplit=nowUri.split('?');
        var secondSplit=firstSplit[1].split('&');
        var hasLid=false;
        
        for(i=0;i<secondSplit.length;i++)     
        {
            if(secondSplit[i].indexOf("lid=")!=-1)
            {
                secondSplit[i]="lid="+lid;
                hasLid =true;
                break;
            }
        }
        if (hasLid==false )
            secondSplit.push("lid="+lid); 
    
        firstSplit[1]=secondSplit.join('&');
        targetUri =firstSplit .join('?');  
    } 
    
    window.parent.location=targetUri;
}

// for navigation bar change section
//---------------------------------------------
function ChangeSection(section)
{   
    var hubPath=document.getElementById ("nav_panel").attributes["class"].value;
    hubPath =hubPath.replace("{0}",section+".aspx");
    
    window.parent.frames[2].location=hubPath;
}

// for navigation bar css
//---------------------------------------------
function navMouseOver(obj)
{
    var oli=Object(obj);
    oli.attributes["class"].value="round_item_selected";
 
}

function navMouseOut(obj)
{
    var oli=Object(obj);
    oli.attributes["class"].value="round_item";
}

// for product got to detail
//---------------------------------------------

function productGoToDetail(pName)
{
    var hubPath=document.getElementById ("NowPageIndex").attributes["class"].value;
    hubPath =hubPath.replace("{0}",pName);
    window.location =hubPath;
    
}


// for inventory got to detail
//---------------------------------------------

function inventoryGoToDetail(iName)
{
    var hubPath=document.getElementById ("NowPageIndex").attributes["class"].value;
    hubPath =hubPath.replace("{0}",iName);
    window.location =hubPath;
    
}