﻿function Browser() {
    var userAgent, str, i
    this.isIE = false;
    this.isNS = false;
    this.isOpera = false;
    this.isiPhone = false;
    this.isiPad = false;
    this.version = null;

    userAgent = navigator.userAgent;

    str = "MSIE";
    if ((i = userAgent.indexOf(str)) >= 0) {
        this.isIE = true;
        return;
    }

    str = "Opera";
    
    if ((i = userAgent.indexOf(str)) >= 0) {
    	this.isOpera = true;
    }
    
    str = "iPhone";
    
    if ((i = userAgent.indexOf(str)) >= 0) {
    	this.isiPhone = true;
    }
    
    str = "iPad";
    
    if ((i = userAgent.indexOf(str)) >= 0) {
    	this.isiPad = true;
    }

    str = "Netscape6/";
    if ((i == userAgent.indexOf(str)) >= 0) {
        this.isNS = true;
        return;
    }

    str = "Gecko";

    if ((i = userAgent.indexOf(str)) >= 0) {
        this.isNS = true;
        return;
    }
}
