var agt = navigator.userAgent.toLowerCase ();

var is_ie     = ((agt.indexOf ("msie") != -1) && (agt.indexOf ("opera") == -1) && (agt.indexOf ("safari") == -1));

function unlockFormComponents() {

    var locker = null;

    if (is_ie) {

        locker = top.document.getElementById('formLocker');

        if (locker != null) {

            //window.top.document.body.removeChild(locker);

            //see http://support.microsoft.com/kb/925014 for details.

            locker.outerHTML="";

        }

    } else {

        locker = window.document.getElementById('formLocker');

        if (locker != null) {

            window.document.body.removeChild(locker);

        }

    }

}

function restartGif(){
	for(var i=0; i<document.images.length; i++){
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "GIF"){
			img.src = img.src;
		}
	}
}


function lockFormComponents() {

    if (is_ie) {

        var objFrame = window.top.document.createElement("iframe");

        objFrame.setAttribute('src', 'javascript:""');

        objFrame.className = "frLookupDialog";



        objFrame.style.width = top.document.body.clientWidth + 'px';

        objFrame.style.height = (top.document.body.scrollHeight ? top.document.body.scrollHeight : top.document.body.offsetHeight) + 'px';

        objFrame.style.display = "block";

        objFrame.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";





        var objDiv = window.top.document.createElement("div");

        objDiv.appendChild(objFrame);

        window.top.document.body.appendChild (objDiv);



        objDiv.setAttribute('id', 'formLocker');

        objDiv.style.position = "absolute";

        objDiv.style.background = "url(img/ajax-loader.gif) fixed no-repeat 50% 50%";

        objDiv.style.width = top.document.body.clientWidth + 'px';

        //objDiv.style.height = (top.document.body.scrollHeight ? top.document.body.scrollHeight : top.document.body.offsetHeight) + 'px';

        objDiv.style.height = Math.max(top.document.body.scrollHeight, top.document.body.offsetHeight) + 'px';

        objDiv.style.top = '0px';

        objDiv.style.left = '0px';

        objDiv.style.zIndex = 10000;



    } else {

        var objLocker = window.document.createElement("img");

        objLocker.className = "lookupDialogPad";

        objLocker.setAttribute('src', 'img/x-gray.png');

        objLocker.setAttribute('id', 'formLocker');



        objLocker.style.background = "url(img/ajax-loader.gif) fixed no-repeat 50% 50%";

        objLocker.style.width = document.body.clientWidth + 'px';

        //objLocker.style.height = (document.body.scrollHeight ? document.body.scrollHeight : document.body.offsetHeight) + 'px';

        objLocker.style.height = Math.max(document.body.scrollHeight, document.body.offsetHeight) + 'px';



        window.document.body.appendChild (objLocker);

    }

}