function Loadpage(path, tabId, target, external, height, width) {
        if ( (!path) || (trim(path) == "") ) {
                return alert ("path cannot be empty or null");
        }
        var queryStringIndex = path.indexOf("?");
        var normalizedPath = (queryStringIndex > 0)?path.substring(0, queryStringIndex):path;
     //   normalizedPath = normalizedPath.toLowerCase();
        var isWebServerFile = false;
        var isExternalSite = false;
        height = ( (height == "") || (height == "null") || (!height) )?"534" :height;
        width =  ( (width  == "") || (width  == "null") || (!width)  )?"650" :width;
        tabId =  ( (tabId == "" ) || (tabId == "null" ) || (!tabId)  )?"home":tabId

        if(normalizedPath.indexOf("http://") >= 0 || normalizedPath.indexOf("https://") >= 0) {
                isExternalSite = true;
        }else if(normalizedPath.indexOf("global_docs/") >= 0 || normalizedPath.indexOf("portal/") >= 0) {
                isWebServerFile = true;
        }

        if (target == "1" || target == "2") {
                var param =     "left=95,top=11,scrollbars=yes,resizable=yes,width="+width+",height="+height;
                if(target == "2") {
                        param += ",location=no,status=no,toolbar=yes,menubar=yes";
                }
                if(!isWebServerFile && !isExternalSite) {
                        path="/APPS/portal/loadPopup.do?path="+path;
                }
             path=location.protocol+"//"+location.host+"/THGCB"+path;
               window.open(path, "_blank", param);
        }else {
                if(!isWebServerFile && !isExternalSite) {
                        path = "/APPS/portal/loadPage.do?tabId="+tabId+ "&path="+path;
                        path=location.protocol+"//"+location.host+"/THGCB"+path; 
                }
                top.location.href = path;
        }
}
