
/* A place to store my effect objects */
var effects = new Array();
/* Servicebox highlight */
function EffectHighlightService( idstr )
{
	if( effects[idstr] )
		effects[idstr].cancel();
	effects[idstr] = new Effect.Parallel( [	new Effect.Fade($('service'+idstr),{sync:true,to:1.0} ),
						new Effect.Morph($('service'+idstr),{sync:true,style:{backgroundColor:'#EAF3FE',borderColor:'#005FCB'}} ) ],
						{duration:0.3}
					);
}
/* Servicebox dehighlight */
function EffectDeHighlightService( idstr )
{
	if( effects[idstr] )
		effects[idstr].cancel();
	effects[idstr] = new Effect.Parallel( [	new Effect.Fade($('service'+idstr),{sync:true,to:0.5} ),
						new Effect.Morph($('service'+idstr),{sync:true,style:{backgroundColor:'#F4F4F4',borderColor:'#999'}} ) ],
						{duration:1}
					);
}
/* Prepare Servicebox for highlight effect */
function EffectPrepareService( idstr )
{
	$('service'+idstr).setStyle({backgroundColor:'#F4F4F4',borderColor:'#999',opacity:0.5});
}

/* Hide element, set height before (IE bug) */
function HideElement( idstr )
{
	$(idstr).setStyle({height: $(idstr).getHeight() + 'px'});
	$(idstr).hide();
}


/*
Use PopUp: <a href="html-or.jpg" onclick="return popup(this,123,456)" title="...">
*/
var pop = null;
function popdown() 
{
	if ( pop && !pop.closed ) 
		pop.close();
}

function popup( obj, w, h ) 
{
	var url = ( obj.getAttribute ) ? obj.getAttribute( 'href' ) : obj.href;
	if ( !url ) return true;
	w = ( w ) ? w += 20 : 150;  // 150px*150px is the default size
	h = ( h ) ? h += 25 : 150;
	var args = 'width=' + w + ',height=' + h + ',resizable';
	popdown();
	pop = window.open(url,'',args);
	return (pop) ? false : true;
}

