function freeze_out(file)
{
	var sec_attempt = 0;
	if(document.getElementById('freeze')!= null )
	{
		var freeze_div = document.getElementById('freeze');
		var loader = document.getElementById('load');
		sec_attempt = 1;
	}
	else
	{
		var freeze_div = document.createElement('div');
		var loader = document.createElement('div');
		freeze_div.id='freeze';
		loader.id='load';
	}
	freeze_div.style.position='absolute';
	freeze_div.style.top='0px';
	freeze_div.style.left='0px';
	var arrayPageSize = getPageSize();
	freeze_div.style.width =arrayPageSize[0] + 'px';
	freeze_div.style.height =arrayPageSize[1] +'px';
	freeze_div.style.background = '#000';
	freeze_div.style.opacity='0.8';
	freeze_div.style.filter='alpha(opacity=60)';
	freeze_div.onclick = function(){un_freeze()};
	var left = (screen.width/2)-345;
	var top = (screen.height/2)+150;
	loader.style.position='absolute';
	loader.style.top=top+'px';
	loader.style.left=left+'px';
	loader.style.width ='660px';
	loader.style.height ='500px';
	loader.innerHTML = '<img style="padding:245px 0px 0px 250px" src="loader.gif">';
//	loader.onclick = function(){un_freeze()};
	if(sec_attempt==1)
	{
		document.getElementById('freeze').style.display = 'block';
		document.getElementById('load').style.display = 'block';
	}
	else
	{
		document.body.appendChild(freeze_div);
		document.body.appendChild(loader);
	}
	loadXMLDoc(loader.id,file);
	
}
function loadXMLDoc(loader,file)
{
	var xmlhttp=false; //Clear our fetching variable
        try 
		{
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } 
		catch (e) 
		{
			try 
			{
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } 
			catch (E) 
			{
                xmlhttp = false;
			}
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
		{
			xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
//        file = 'popup_innerpages.htm'; //This is the path to the file we just finished making *
		xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
		xmlhttp.onreadystatechange=function() 
		{
	        if (xmlhttp.readyState==4) 
			{ //Check if it is ready to recieve data
				document.getElementById(loader).innerHTML=xmlhttp.responseText;
	        }
		}
        xmlhttp.send(null) //Nullify the XMLHttpRequest
		return;
}

function un_freeze()
{
	document.getElementById('freeze').style.display = 'none';
	document.getElementById('load').style.display = 'none';
}
function show_hide_detail(id)
{
	if(document.getElementById(id).style.display == 'block')
		document.getElementById(id).style.display = 'none';
	else
		document.getElementById(id).style.display = 'block';

	if(document.getElementById("arrow_down_"+id).style.display=='block')
	{
		document.getElementById("arrow_down_"+id).style.display = 'none';
		document.getElementById("arrow_up_"+id).style.display = 'block';
	}
	else
	{
		document.getElementById("arrow_up_"+id).style.display = 'none';
		document.getElementById("arrow_down_"+id).style.display = 'block';
	}
}
    function getPageSize() {
	        
	     var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}

