function showPopup(URL,w,h,resize,scr) {  
	l = (screen.availWidth-w) / 2;
	t = (screen.availHeight-h) / 2;
	window.open(URL, "Mail", "height=" + h + ",width=" + w + ",top=" + t + ",left=" + l + ",toolbar=no,status=no,resizable=" + resize + ",scrollbars=" + scr +"");
}

function showF(type,id) {
	var obj = document.getElementById(type+'_'+id)
	if(obj.style.display=='none'){
		obj.style.display='block'
	}else{
		obj.style.display='none'
	}
}

function SetBgColor(strObj){
  var obj = document.getElementById(strObj)
  if (obj != undefined){
    if (obj.className==''){
      obj.className='TMenuItemOver'
    }
    else{
      obj.className=''
    }  
  }
}
function Show(strOjb){
  obj = document.getElementById(strOjb)
  if (obj!=undefined){  
    if (obj.className.indexOf('hidden') != -1){
       obj.className = obj.className.replace('hidden','show')
    }
  }
}

function hide(strOjb){
  obj = document.getElementById(strOjb)
  if (obj!=undefined){
    if (obj.className == ''){
      obj.className = 'hidden'
    }
    if (obj.className.indexOf('show') != -1){
      obj.className = obj.className.replace('show','hidden')
    }
  }  
}

function showCaseTeaser(imgObj,strObj){
  var obj = document.getElementById(strObj)
  var objTable = imgObj.parentNode.parentNode.parentNode.parentNode
  if (obj!=undefined){
    if (obj.className.indexOf('hidden') != -1){
      Show(strObj)
    }
    else{
      hide(strObj)      
    }
  }
  if (imgObj.src.indexOf('plus.gif') != -1){
    imgObj.src = imgObj.src.replace('plus.gif','min.gif')    
    objTable.className='BGcaseTeaser'
  }
  else{
    imgObj.src = imgObj.src.replace('min.gif','plus.gif')
    objTable.className=''
  }
}

function hideBlock(){
  hide('block_Approach')
  hide('block_Expertise')
  hide('block_Davaci')
  hide('block_Academy')
  Show('BtnArrowApproach')
  Show('BtnArrowExpertise')
  Show('BtnArrowDavaci')
  Show('BtnArrowAcademy')
}

function hideMenu(strnotHide){
  if (strnotHide.indexOf('APPROACH') == -1){  
    hide('Sub_Approach')
    Show('BtnArrowApproach')
  }
  if (strnotHide.indexOf('EXPERTISE') == -1){  
    hide('Sub_Expertise')
    Show('BtnArrowExpertise')
  }
  if (strnotHide.indexOf('DAVACI') == -1){  
    hide('Sub_Davaci')  
    Show('BtnArrowDavaci')
  }
}
function printme(strobj)
{
	var objOut = document.getElementById(strobj);
	var out = objOut.innerHTML;

	var wh = window.open("","wh","width=640px,height=480px,scrollbars=yes");
	wh.document.open();
	var output = '<link href="css/stylesheet.css" rel="stylesheet" type="text/css">';
	output += '<'+'script type="text/javascript">';
	output += 'window.print();';
	output += '</'+'script>';
	output = '<html><head>'+output+'</head><body>'+out+'</body></html>';
	wh.document.writeln(output);
	wh.document.close();
}

//Smooth Resize
var timeoutLength = 20;
var pixelsPerTick = 8;
var originalHeight = 60;

function resize(item,image,oHdr)
{
	//status = document.getElementById('content1').offsetHeight;
	var style = document.getElementById(item).style;
	if (style.display != 'none')
	{
		//originalHeight = document.getElementById(item).offsetHeight;
		if (document.getElementById(item).innerHTML.length>0){
		  smoothResize1(item);
		  document.getElementById(image).src = 'img/plus.jpg';
		  document.getElementById(oHdr).className='bgCollapsedCase'
		}
	}
	else
	{	  
		document.getElementById(item).style.display = 'block';
		var arr = document.getElementById('objCases').value.split(',')
		for(var cnt=0;cnt<arr.length;cnt++){		
      if (arr[cnt] != '' &&(arr[cnt] != item)){
        if (document.getElementById(arr[cnt]).style.display == 'block'){
		      smoothResize1(arr[cnt]);
		      document.getElementById('IMG_'+arr[cnt]).src = 'img/plus.jpg';
		      document.getElementById('Hdr'+arr[cnt]).className='bgCollapsedCase'
		    }
		  }
		}
		if (document.getElementById(item).innerHTML.length>0){
		  smoothResize2(item,originalHeight);		
		  document.getElementById(image).src = 'img/minus.jpg';
		  document.getElementById(oHdr).className = 'bgUnCollapsedCase';
		}
	}
	//status = document.getElementById('content1').offsetHeight;
}
function smoothResize1(item)
{
	if ( (document.getElementById(item).offsetHeight-pixelsPerTick) <= 0 )
	{		
		document.getElementById(item).style.display = 'none';			
	}
	else
	{
		document.getElementById(item).style.height = document.getElementById(item).offsetHeight-pixelsPerTick;
		setTimeout("smoothResize1('"+item+"')",timeoutLength);			
	}
}
function smoothResize2(item,max)
{ 
	if ( (document.getElementById(item).offsetHeight+pixelsPerTick) >= max )
	{ 
		document.getElementById(item).style.height = max;				
	}
	else
	{	  
	  document.getElementById(item).style.height = document.getElementById(item).offsetHeight+pixelsPerTick;		
	  setTimeout("smoothResize2('"+item+"',"+max+")",timeoutLength);
	}
}
//End smooth Resize

function ButtonOver(obj){
  obj  = document.getElementById(obj)
  if (obj != undefined && obj != '' ){
      obj.className  += '_over'
  }
}
function ButtonOut(obj){
  obj  = document.getElementById(obj)
  if (obj != undefined && obj != '' ){
    obj.className  = obj.className .replace('_over','') 
  }
}
