
function RedirectWithParameter(strTargetPath)
{
    var strSiteCollection = "sites/hyro";
    var strCurrentSitePath = window.location.href.replace("http://", "").replace("https://", "");
    var sptCurrentSitePath = strCurrentSitePath.split("/");
    var strActualChannelPath = "";
    
    //check hyperlink 
    var strHyperLink = (window.location.href.toLowerCase().indexOf("http://") > -1) ? "http://" : "https://";
    
    
    if (strCurrentSitePath.toLowerCase().indexOf(strSiteCollection) == -1)
        strActualChannelPath =  strHyperLink + sptCurrentSitePath[0] + "/" + strTargetPath + "?channel=" + sptCurrentSitePath[2];
    else
        strActualChannelPath =  strHyperLink + sptCurrentSitePath[0] + "/" + sptCurrentSitePath[1] + "/" + sptCurrentSitePath[2] + "/" + strTargetPath + "?channel=" + sptCurrentSitePath[4];
    
    strSiteCollection = null;
    strCurrentSitePath = null;
    sptCurrentSitePath = null;
    
    window.location.href = strActualChannelPath;
}