
if( typeof(hglf_setStyleProperty)!="function" ){
    // follows functions are sTEPiT v2 functions.
    function hglf_makeMSIEStyleString(ppty){
	for(var i=0; i<ppty.length; i++){
	    if(ppty.substr(i,1)!='-')
		continue;
	    if(i+2<ppty.length){
		ppty= ppty.substring(0,i)
		    + ppty.substr(i+1,1).toUpperCase()
		    + ppty.substr(i+2);
	    }
	}
	return ppty;
    }
    function hglf_isStyleAllowableTag(tagName){
	if(!tagName) return false;
	var s= tagName.toUpperCase();
	if(s=="SPAN" || s=="P" || s=="DIV" || s=="I")
	    return true;
	else
	    return false;
    }
    function hglf_setStyleProperty(e, ppty, value){
	if(!e||!ppty) return;
	if(!hglf_isStyleAllowableTag(e.tagName)) return ;
	if(e.currentStyle){ // MSIE
	    ppty= hglf_makeMSIEStyleString(ppty);
	    e.style[ppty]= value;
	}else{
	    e.style.setProperty(ppty, value, "");
	    // alert( "set ["+ppty+"] to ["+value+"] result ["+hglf_getStyleProperty(e,ppty)+"]" );
	    // Safari@MAC is OK.
	}
    }
}

function hglf_getFrameWidth(){
    if(window.innerWidth)
	return window.innerWidth;
    else if(document.documentElement && document.documentElement.clientWidth)
	return document.documentElement.clientWidth;
    else if(document.body && document.body.clientHeight)
	return document.body.clientHeight;
    else
	return 0;
}
function hglf_getFrameHeight(){
    if(window.innerHeight)
	return window.innerHeight;
    else if(document.documentElement && document.documentElement.clientHeight)
	return document.documentElement.clientHeight;
    else if(document.body && document.body.clientHeight)
	return document.body.clientHeight;
    else
	return 0;
}

function hglf_setPositionAbs(e, top, x, pos_x){
    if(!e) return ;
    if(typeof(e.style.posTop)=="number"){
	e.style.posTop= top;
	if(x=="left")
	    e.style.posLeft= pos_x;
	else if(x=="right")
	    e.style.posRight= pos_x;
    }else{
	e.style.top= top + 'px';
	if(x=="left")
	    e.style.left= pos_x + 'px';
	else if(x=="right")
	    e.style.right= pos_x + 'px';
    }
}

function hglf_set_footer_position(id){
    var e= document.getElementById(id);
    if(e){
	var margin= 24;
	var scrollBarMargin= isMSIE()? 18: 39;
	hglf_setStyleProperty(e, 'width', hglf_getFrameWidth()-margin*2+'px');
	var height= e.offsetHeight || 48;
	hglf_setPositionAbs(e, hglf_getFrameHeight()-height-scrollBarMargin,
			    "right", +margin);
    }
}

function isMSIE(){
    var ua= navigator.userAgent;
    return ua.indexOf("MSIE")!=-1? true: false;
}
