

function OpenDialogWindow(strURL,strWindowName)
{
    var iWidth;
    var iHeight;
    var windowDialogViewer;
    var features;

    
    iWidth=screen.width - 25;
    iHeight=screen.height - 135;
    strURL = StrDecode(strURL);

    features = "dialogWidth:" +iWidth +"px; dialogHeight:"+iHeight+"px; center:yes;scroll:no"
    window.open(strURL,strWindowName,features);
}

function hidestatus()
{
    window.status="";
    return true
}

function Div(w,h,t,l,p,bg){
    // define object properties
    this.div=document.createElement('div');
    this.w=w+'px';
    this.h=h+'px';
    this.pos='absolute';
    this.top=t+'px';
    this.left=l+'px';
    this.pad=p+'px';
    this.bord='1px solid #000';
    this.bg='#'+bg;
    // define 'display()' method
    this.display=function(){
        this.div.style.width=this.w;
        this.div.style.height=this.h;
        this.div.style.position=this.pos;
        this.div.style.top=this.top;
        this.div.style.left=this.left;
        this.div.style.padding=this.pad;
        this.div.style.border=this.bord;
        this.div.style.background=this.bg;
        document.getElementsByTagName('body')[0].appendChild(this.div);
    }
}


function Show()
{
    Div.prototype.margin='2px';
    var div1=new Div(300,250,100,100,5,'00f');
    div1.display();
    alert(div1.margin); // returns ‘2px’
    var div2=new Div(500,500,50,50,5,'0ff');
    div2.display();
    alert(div2.margin); // returns ‘2px’
}


function ShowReferralForm() {

    var strUrl = "";
    strUrl = document.location.href.toString();

    if (parseInt(strUrl.indexOf("/customer/")) >= 0)
        strUrl = "../"
    else strUrl = "";
    
    var d = new Date();
    var strSecond = d.getSeconds();
    var strMiliSecond = d.getMilliseconds();
    strUrl = strUrl + "referralform.aspx?uid" + strSecond + strMiliSecond
    window.showModalDialog(strUrl, "win", "dialogWidth:505px; dialogHeight:635px; center:yes")
}

function OpenUrlFmFlash(strEnumServiceType) {

    var strOpenServiceUrl="";
    var strUrl="";
    strUrl = document.location.href.toString();
    var strAdminUrlIndexOf="";
    var strCustomerUrlIndexOf = "";

    if (parseInt(strUrl.indexOf("/admin/")) >= 0 || parseInt(strUrl.indexOf("/customer/")) >= 0)
        strOpenServiceUrl = "../"
    
    switch (strEnumServiceType) {
        case "enumAccountingBookkeepingServices":
            strOpenServiceUrl += "resources/book_acc_cfo.pdf";
            break;
        case "enumElectronicDocMgmtServices":
            strOpenServiceUrl += "resources/elec_doc_management.pdf";
            break;
        case "enumPayrollProcessingServices":
            strOpenServiceUrl += "resources/payroll_processing_services.pdf";
            break;
        case "enumFinancialDashboard":
            strOpenServiceUrl += "resources/qvinci_dashboard.pdf";
            break;
        case "enumDataIntegrationServices":
            strOpenServiceUrl += "resources/quickbooks_integration.pdf";
            break;
        case "enumITServices":
            strOpenServiceUrl += "resources/it_services.pdf";
            break;
        case "enumWebMktgServices":
            strOpenServiceUrl += "resources/web_marketing.pdf";
            break;
        case "enumCCProcessing":
            strOpenServiceUrl += "resources/credit_and_debit_card_processing.pdf";
            break;
        case "enumCFSServices":
            strOpenServiceUrl += "formsandchecklist.aspx";
            break;
        case "enumBSAServices":
            strOpenServiceUrl += "resources/business_sales_acquisition.pdf";
            break;
            
            default:
                break;

        }
        if (strOpenServiceUrl != "")
            window.open(strOpenServiceUrl);


    }



    /*===================== AJAX GET XML HTTP OBJECT ======================= */

    function GetXmlHttpObject() {
        var xmlHttp = null;
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        return xmlHttp;
    }

    var tRedirect = false;
    var strBrowserName = getBrowserName();
    //alert(strBrowserName);
    if (strBrowserName == "msie" || strBrowserName == "safari" || strBrowserName == "firefox")
    //if (strBrowserName == "msie")
        tRedirect = true;
    
    if(tRedirect == false)
    {
        document.location.href = "invalidbrowser.aspx";
    }
    
    
/* Determine browser
*/ 
function getBrowserName(){ 
var browserName = ""; 

var ua = navigator.userAgent.toLowerCase(); 
if ( ua.indexOf( "opera" ) != -1 ) { 
browserName = "opera"; 
} else if ( ua.indexOf( "msie" ) != -1 ) { 
browserName = "msie"; 
} else if ( ua.indexOf( "safari" ) != -1 ) { 
browserName = "safari"; 
} else if ( ua.indexOf( "mozilla" ) != -1 ) { 
if ( ua.indexOf( "firefox" ) != -1 ) { 
browserName = "firefox"; 
} else { 
browserName = "mozilla"; 
} 
} 

return browserName; 
}; 