function disableRightClick(e)
{
  var message = "This Site is administered with the \ndolphin-web based management tools(R) \n\ncreated by creants.com. \n\n- More infos at http://www.creants.com";
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}
//disableRightClick();


function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openThumpUp(id)
{
	//?id=' + id
	openBrWindow('dolphin_popup_image.cfm?pid=' + id,'POPUPTHUMP','width=506,height=605,top=100,left=200');
}
function openImage(id)
{
	//?id=' + id
	openThumpUp(id);
}
function openPopUp(uid)
{
	//?id=' + id
	openBrWindow('dolphin_popup.cfm?dolphin=' + uid,'POPUP','width=500,height=605,top=100,left=200,scrollbars=no');
}
function openPopup(cid)
{
	//?id=' + id
	openPopUp(cid);
}
function openpopup(cid)
{
	//?id=' + id
	openPopUp(cid);
}
function openPopUpExtern(linkString)
{
	//?id=' + id
	openBrWindow(linkString,'POPUP','width=950,height=800,top=10,left=10,scrollbars=yes');
}
function openPopUpAdmin(fid,rid)
{
	//?id=' + id
	openBrWindow('dolphin/fw/popupExtranet.cfm?fid=' + fid + '&rid=' + rid,'POPUP'+rid+fid,'width=500,height=700,top=100,left=200,scrollbars=yes');
	
}
function openSearchPopUp(cid,pid)
{
	//?id=' + id
	openBrWindow('dolphin_popup.cfm?navistring=' + cid + '&contentstring=' + cid + '&cont_page_id=' + pid,'POPUP'+cid,'width=562,height=443,top=100,left=200,scrollbars=yes');
}
//mouseover sub-Navigation
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function showLayer(key) { //v6.0
  		hideLayer();
		obj=document.getElementById(key);
		obj.style.visibility='visible';
		//alert(key);
}
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}
function switchNaviText(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}
function setPopUpFocus()
{
	window.focus();	
}
function closeLayer(key) { //v6.0
  		MM_showHideLayers(key,'','hide');
}

function correct_layout() {
	if(document.getElementById('containerContent').offsetHeight) {
		var div_heights = new Array(
			document.getElementById('containerContent').offsetHeight,
			document.getElementById('containerNaviLeft').offsetHeight,
			document.getElementById('containerNaviRight').offsetHeight
		);
		div_heights = div_heights.reverse(div_heights.sort(num_sort));
		var div_height_adress = document.getElementById('layerAdress').offsetHeight;
		var div_height_searchResult = document.getElementById('layerSearchResult').offsetHeight;
		var div_height_search = ((div_heights[0]) - (div_height_adress + 84));
		var styleSearchHeight = div_height_search + "px";
		var styleHeight = (div_heights[0]) + "px";
		document.getElementById('containerNaviLeft').style.height = styleHeight;
		document.getElementById('containerContent').style.height = styleHeight;
		document.getElementById('containerNaviRight').style.height = styleHeight;
		if(div_height_searchResult <= div_height_search ) {
			document.getElementById('layerSearchResult').style.height  = styleSearchHeight;
			}
		}
		
	}
	
function num_sort(a,b) {
	return a-b;
	}
	
function dropDown(key) { //v6.0
		obj=document.getElementById(key);
		if(obj.style.visibility=='visible')
		{
			MM_showHideLayers(key,'','hide')}
		else
		{
			MM_showHideLayers(key,'','show')}
}
