/*
 * Browserweiche auf der Immonet-Startseite, leitet auf Mobilportal
 */
 
  
function isSmallClient(client) {
    var smallClients=
    [

           "153x130",
           "176x220",
           "240x320",
           "320x320",
           "480x640",
           "avantgo",
           "astel",
           "benq",
           "blackberry",
           "blazer",
           "danger",
           "dlib",
           "docomo",
           "elaine",
           "eudoraweb",
           "hiptop",
           "j2me",
           "netfront",
           "nokia",
           "obigo",
           "mda",
           "midp",
           "mmef20",
           "mmp/2",
           "mot-",
           "mobile",
           "newt",
           "opera mini",
           "palm",
           "panasonic",
           "pdxgw",
           "philips",
           "portalmmm",
           "proxinet",
           "pocket",
           "sharp",
           "sagem",
           "samsung",
           "sda",
           "sec-",
           "sie-",
           "sgh-",
           "small",
           "sonyericsson",
           "symbian",
           "sharp-tq-gx10",
           "ts21i-10",
           "up.browser",
           "up.link",
           "vodafone",
           "windows ce",
           "winwap",
           "wireless",
           "xda"
    ];

    client=client.toLowerCase();
    for (var i=0;i<smallClients.length;i++)
    {
       if (client.indexOf(smallClients[i])>=0)
       {
           return true;
       }
    }
    return false;

}

 

function isSmartClient(client) {
    var smartClients=["iphone", "ipod"];
    client=client.toLowerCase();
    for (var i=0;i<smartClients.length;i++)
    {
        if (client.indexOf(smartClients[i])>=0) {
         	return true;
        }
    }
    return false;
}

 

function smallClient() {
    if (isSmallClient(navigator.userAgent))
    {
           if (document.location.hash=="#nomobile" && isSmartClient(navigator.userAgent)) {
              	document.cookie="nomobile";
				return;
           }

           if (document.cookie && document.cookie.indexOf("nomobile")>=0) {
              return;
           }

        document.location="http://mobil.immonet.de";
    }

    else if (isSmartClient(navigator.userAgent)) {
         document.location="http://iphone.immonet.de";

    }
}

 
smallClient();
