
var contentDivId

function hideDiv(id1,id2) {
    //resizeIframe();
    document.getElementById(id1).style.display = "none";
    if (document.getElementById(id2) != null)
	    document.getElementById(id2).style.display = "none";
	//resizeIframe();
}
function hideDivforModalWindow(id1, id2) {
    //resizeIframe();
    document.getElementById(id1).style.display = "none";
    if (document.getElementById(id2) != null)
        document.getElementById(id2).style.display = "none";
    
} 
function showDivs(id1,id2)
{
    //resizeIframe();
    document.getElementById(id1).style.display = "";
    if (document.getElementById(id2) != null)
	    document.getElementById(id2).style.display = "";
	//setTimeout('resizeIframe()', 5000);
	//resizeIframe();
}
function showDivforModalWindow(id1, id2) {
    //resizeIframe();
    document.getElementById(id1).style.display = "";
    if (document.getElementById(id2) != null)
        document.getElementById(id2).style.display = "";
    //setTimeout('resizeIframe()', 5000);
   
} 

function getBrowserSize()
{
    var bodyWidth = document.documentElement.clientWidth;
    var bodyHeight = parent.document.documentElement.clientHeight;
    	//var self = parent;
		var bodyWidth, bodyHeight; 
		if (parent.innerHeight)
		{ // all except Explorer 
		 
		   bodyWidth = self.innerWidth; //self
		   bodyHeight = parent.innerHeight; //self
		}  else if (parent.document.documentElement && parent.document.documentElement.clientHeight) 
		{
		   // Explorer 6 Strict Mode
		    bodyWidth = document.documentElement.clientWidth;
		    bodyHeight = parent.document.documentElement.clientHeight; 
		}
		else if (parent.document.body) 
		{// other Explorers
		    bodyWidth = document.body.clientWidth;
		    bodyHeight = parent.document.body.clientHeight; 
		} 
		
		
		var scrOfX = 0, scrOfY = 0;
		if (typeof (parent.window.pageYOffset) == 'number') {
			//Netscape compliant
		    scrOfY = parent.window.pageYOffset;
		    scrOfX = window.pageXOffset;
		} else if (parent.document.body && (parent.document.body.scrollLeft || parent.document.body.scrollTop)) {
			//DOM compliant
		scrOfY = parent.document.body.scrollTop;
			scrOfX = document.body.scrollLeft;

} else if (parent.document.documentElement && (parent.document.documentElement.scrollLeft || parent.document.documentElement.scrollTop)) {
			//IE6 standards compliant mode
scrOfY = parent.document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
		  }
		  //return [ scrOfX, scrOfY ];
		  //top.parent.document.bgColor = 'green';
//		    top.parent.document.getElementById("myNewBlackDiv").display="";
//		  top.parent.document.getElementById("myNewBlackDiv").style.height=bodyHeight + scrOfY +15 + "px";
//		  top.parent.document.getElementById("myNewBlackDiv").style.width="221"+"px"; 
		  
		
		 
		 

		
		 // parent.document['body'].style.background = '#758DAE';
	  //parent.document.bgColor='#758DAE';
		
		
		document.getElementById('blackDiv').style.height=bodyHeight + scrOfY  + "px";
		document.getElementById('blackDiv').style.width=bodyWidth  + "px" ;

		var contentW=document.getElementById(contentDivId).style.width;
		var contentH=document.getElementById(contentDivId).style.height;
		var actW=bodyWidth - contentW.replace('px','');
		var actH=((bodyHeight - contentH.replace('px',''))/2) + scrOfY;
		
		document.getElementById(contentDivId).style.left=actW/2 +"px";
		document.getElementById(contentDivId).style.top=actH +"px";
		//document.getElementById(contentDivId).style.display="";
		//document.getElementById('blackDiv').style.display="";
}
function getContentDivId(contentDivIdParam)
{
contentDivId=contentDivIdParam;
}
function openGrayDiv(contentDivIdParam)
{
    //resizeIframe();
	getContentDivId(contentDivIdParam)
	
	window.onresize=getBrowserSize;

	window.onscroll = getBrowserSize;
	parent.window.onscroll = getBrowserSize;
	getBrowserSize();
	//resizeIframe();
}

function openGrayDivforModalWindow(contentDivIdParam) {
    //resizeIframe();
    getContentDivId(contentDivIdParam)

    window.onresize = getBrowserSize;

    window.onscroll = getBrowserSize;
    parent.window.onscroll = getBrowserSize;
    getBrowserSize();
 
}



/*function resizeIframe() {

    var iFramesize;
    var iLeftMenuHeight = 0;
    if (navigator.userAgent.toLowerCase().indexOf("msie 6.0") != -1)
        iFramesize = document.body.scrollHeight;
    else if (navigator.userAgent.toLowerCase().indexOf("msie 7.0") != -1)
        iFramesize = document.body.scrollHeight + 0;
    else if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1)
        iFramesize = document.body.scrollHeight + 10;
    else if (navigator.userAgent.toLowerCase().indexOf("safari") != -1)
        iFramesize = document.body.scrollHeight;
    else if (navigator.userAgent.toLowerCase().indexOf("navigator") != -1)
        iFramesize = document.body.scrollHeight;
    else
        iFramesize = document.body.scrollHeight;
    //alert(iFramesize);
    if (iFramesize < 550)
        iFramesize = 600;

    var parentHeight = parent.document.body.scrollHeight - 58;
    // alert(parentHeight);
    if (parentHeight > iFramesize) {
        parent.document.getElementById('contentFrame').style.height = parentHeight + "px";
    }
    else {
        parent.document.getElementById('contentFrame').style.height = iFramesize + "px";
    }
    parent.document.getElementById('contentFrame').style.height = iFramesize + "px";
    parent.document.title = document.title;

    return true;
}*/
