function detectBrowser() {
    
    var d, dom, ie, ie4, ie5x, mac, win, lin, old, ie5mac, ie5xwin, op;
    
    d = document;
    n = navigator;
    na = n.appVersion;
    nua = n.userAgent;
	  win = ( na.indexOf( 'Win' ) != -1 );
    mac = ( na.indexOf( 'Mac' ) != -1 );
    lin = ( nua.indexOf( 'Linux' ) != -1 );
    
    if ( !d.layers ){
        dom = ( d.getElementById );
        op = ( nua.indexOf( 'Opera' ) != -1 );
        konq = ( nua.indexOf( 'Konqueror' ) != -1 );
        saf = ( nua.indexOf( 'Safari' ) != -1 );
        moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
		ie7  = (nua.indexOf( 'MSIE 7.0') != -1);
		ie6  = (nua.indexOf( 'MSIE 6.0') != -1);
        ie = ( d.all && !op );
        ie4 = ( ie && !dom );
       
        /*
        ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
        Opera will register true in this test if set to identify as IE 5
        */
        
        ie5x = ( d.all && dom );
        ie5mac = ( mac && ie5x );
        ie5xwin = ( win && ie5x );
    }
}

function resizeTool(){  
		detectBrowser();
		var newH = getPageWH("h")-60-(moz ? 0 : 0);
		if (newH<=0) {newH=0;}
		var newW = getPageWH("w")-20-(moz ? 2 : 0);
		
		vContentArea 		= 	parseInt(newW) - 32;
		vShadowBottom 	= 	parseInt(newW) - 16;
		vBgWidth			=	parseInt(newW) - (245+640);
		document.getElementById('layoutpageMiddle').style.width		=	newW.toString()+"px";
		document.getElementById('layoutcontentArea').style.width		=	vContentArea.toString()+"px";
		document.getElementById('layoutpageBottom').style.width		=	newW.toString()+"px";
		document.getElementById('layoutshadowBottom').style.width 	=	vShadowBottom.toString()+"px";
		document.getElementById('layoutmenuPart').style.width 			=	newW.toString()+"px";
		document.getElementById('layoutmenu').style.width 				=	vShadowBottom.toString()+"px";
		document.getElementById('layoutlogoPart').style.width			=	newW.toString()+"px";		
		document.getElementById('layoutstaticItems').style.width		=	vBgWidth.toString()+"px";
}

function getPageWH(xPart){  
    if( typeof window.innerWidth  == 'number' ) {
        pageW = window.innerWidth;
        pageH = window.innerHeight;
    } 
    else if(document.documentElement && 
        document.documentElement.clientWidth ) {
		pageW = document.documentElement.clientWidth;
		pageH = document.documentElement.clientHeight;
	} 
	else{
		pageW = document.body.clientWidth;
		pageH = document.body.clientHeight;
	}
	if(xPart=="w") return pageW;
	else return pageH;
}

