var winW = 630, winH = 460;
var srcWidth = 0, srcHeight = 0;
var myHeight = 0, myWidth  = 0;

window.onresize = resize;

function resize() {
	myDiv = document.getElementById('overAll')
	maxBackDiv(myDiv)
 }


function maxBackDiv(myDiv) {

 if (myDiv.style.visibility == "visible") {

  if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    winW = window.innerWidth;
    winH = window.innerHeight;
   }
   if (navigator.appName.indexOf("Microsoft")!=-1) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
   }
 }

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    srcWidth = window.innerWidth;
    srcHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    srcWidth = document.documentElement.clientWidth;
    srcHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    srcWidth = document.body.clientWidth;
    srcHeight = document.body.clientHeight;
  }

 myHeight = srcHeight;
 myWidth  = srcWidth;

 if (winH > srcHeight) { myHeight = winH}
 if (winW > srcWidth) { myWidth = winW}

 myDiv.style.width = myWidth + "px";
 myDiv.style.height = myHeight + "px";
 }
}


function positionEmbeddedDiv(myDtlDiv) {

// srcHeight = 450;
// srcWidth = 760;

// detect scroll offset
var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
var dsocleft=document.all? iebody.scrollLeft : pageXOffset
var dsoctop=document.all? iebody.scrollTop : pageYOffset

myDtlDiv.style.left = (dsocleft+srcWidth-760)/2 + "px";
myDtlDiv.style.top = (dsoctop+srcHeight-450)/2 + "px";

myDtlDiv.style.width = "450px";
myDtlDiv.style.height = "760px";

}

function openEmbeddedCoolIris(url) {
myDiv = document.getElementById('overAll')
myDiv.style.visibility = 'visible';
myDiv.style.display = 'block';

maxBackDiv(myDiv)

myDiv.style.backgroundColor = '#000000';
myDiv.style.position = 'absolute';
myDiv.left = "0px";
myDiv.right = "0px";

var value = 6.5;
myDiv.style.opacity = value/10;
myDiv.style.filter = 'alpha(opacity=' + value*10 + ')';

myDtlDiv = document.getElementById('CoolIris')
myDtlDiv.style.visibility = 'visible';
myDtlDiv.style.display = 'block';
myDtlDiv.style.margin = '0px';
myDtlDiv.style.padding = '1px';
myDtlDiv.style.paddingTop = '3px';
myDtlDiv.style.backgroundColor = '#000000';
myDtlDiv.style.position = 'absolute';

myDtlDiv.innerHTML = "<object id='coolirisOuter' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='760' height='450'><param name='movie' value='http://apps.cooliris.com/embed/cooliris.swf' /><param name='flashvars' value='feed=" + url + "' /><param name='allowFullScreen' value='true' /><param name='allowScriptAccess' value='always' /><!--[if !IE]>--><object id='coolirisInner' type='application/x-shockwave-flash'data='http://apps.cooliris.com/embed/cooliris.swf' width='760' height='450'><param name='flashvars' value='feed=" + url + "' /><param name='allowFullScreen' value='true' /><param name='allowScriptAccess' value='always' /></object><!--<![endif]--></object>";

positionEmbeddedDiv(myDtlDiv)

myDtlDiv.style.opacity = "";
myDtlDiv.style.filter = "";
}

function closeOverAll() {
	document.getElementById('overAll').style.visibility = 'hidden';
	document.getElementById('overAll').style.display = 'none';
}








function sizeContainer() {
  var myWidth = 0, myHeight = 0,myWidth = 0, divHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
    divHeight = document.getElementById('menu').clientHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
    divHeight = document.getElementById('menu').clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
    divHeight = document.getElementById('menu').clientHeight;
  }



var contentH = ((myHeight*1)-137);
var divH = (myHeight*1)-165-(divHeight*1)
if (divH<52) {
 divH=52
}


if (contentH < divHeight+80) {
	contentH = divHeight+80;
}

if (contentH<100) {
 contentH=100
}

document.getElementById('content1').style.height=contentH + "px";
if (document.getElementById('log_container')) {

	document.getElementById('log_container').style.height=divH + "px";
//	if ((myHeight*1)-152-(divHeight*1) < 33) {
//		document.getElementById('log_container').style.display='none';
//	}
//	else {
//		document.getElementById('log_container').style.display='block';
//	}
//	alert(divH)
 }
}

