

//-- constants
var closeedit = true;
var winW = 0; var winH = 0;

var divloading = '<table width="100%" height="100%"><tr><td><div width="100%" align=center><img src="images/loading.gif" width=16 height=16><br><font style="font-size:8px;">LOADING</font></div></td></tr></table>';
var divloadingimg = '<table width=250 height=330><tr><td><div width=250 align=center><img src="images/loading.gif" width=16 height=16><br><font style="font-size:8px;">LOADING</font></div></td></tr></table>';

var divprocessing = '<br><br><br><br><table border=0 cellpadding=0 cellspacing=0 align=center><tr>';
divprocessing = divprocessing+'<td align=center height=28><font color=#888888 size=2>uploading data</font></td></tr><tr>';
divprocessing = divprocessing+'<td width=222><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=222 HEIGHT=20>';
divprocessing = divprocessing+'<PARAM NAME=movie VALUE="/js/processing.swf"><PARAM NAME=loop VALUE=true><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="/js/processing.swf" quality=high bgcolor=#FFFFFF WIDTH=222 HEIGHT=20 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></td>';
divprocessing = divprocessing+'</tr></table>';



//----------------------------- FUNCTIONS ----------------------------------
function editon(){}		//editx.src='images/msgbox_x_s.gif';
function editoff(){}	//editx.src='images/msgbox_x.gif';
//--------------------------------------------------------------------------------------	
function sizevedit(x,y){
	
	document.getElementById("veditin").innerHTML = divloading;
	
	var posx = parseInt((winW - x) / 2);
	var posy = parseInt((winH - y) / 2);
	
	var scrolloffset = getScrollXY(); 	

	if(!nn){posy = posy + document.documentElement.scrollTop + scrolloffset[1];}
	else{posy = posy + window.pageYOffset;}
	
	if(posy<0){posy=0;}if(posx<0){posx=0;}
	
	document.getElementById("vedit").style.width= x + 'px';
	document.getElementById("vedit").style.height= y + 'px';
	
	document.getElementById("vedit").style.left= posx + 'px';
	document.getElementById("vedit").style.top= posy + 'px';	
	
	document.getElementById("veditin").style.height= (y-25) + 'px';
}	

//--------------------------------------------------------------------------------------	
function sizevedit_obj(x,y,obj){
	
	//document.getElementById(obj).innerHTML = divloading;
	
	var posx = parseInt((winW - x) / 2);
	var posy = parseInt((winH - y) / 2);
	
	var scrolloffset = getScrollXY(); 	

	if(!nn){posy = posy + document.documentElement.scrollTop + scrolloffset[1];}
	else{posy = posy + window.pageYOffset;}
	
	if(posy<0){posy=0;}if(posx<0){posx=0;}
	
	document.getElementById(obj).style.width= x + 'px';
	document.getElementById(obj).style.height= y + 'px';
	
	document.getElementById(obj).style.left= posx + 'px';
	document.getElementById(obj).style.top= posy + 'px';	
	

}	


//--------------------------------------------------------------------------------------

function naviswitch(name){
	if(name=='edit'){

		document.getElementById("vfade").style.visibility="visible";
		document.getElementById("vedit").style.visibility="visible";

	}	
	else if(name=='editoff'){


		document.getElementById("vfade").style.visibility="hidden";
		document.getElementById("vedit").style.visibility="hidden";
		document.getElementById("veditin").innerHTML = divloading;
		closeedit = true;
	}		
	else if(name=='processing'){

		document.getElementById("vfade").style.visibility="visible";
		document.getElementById("veditin").innerHTML = divprocessing;
		document.getElementById("vedit").style.visibility="visible";
		closeedit = false;
	}	

}

//--------------------------------------------------------------------------------------
function calc_windowsize(){

	var D = document;				//document width&height
  DocwinH = Math.max(
      Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
      Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
      Math.max(D.body.clientHeight, D.documentElement.clientHeight)
  );

  DocwinW = Math.max(
      Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
      Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
      Math.max(D.body.clientWidth, D.documentElement.clientWidth)
  );
	

	
	if (nn){
	  winW = window.innerWidth;
	 	winH = window.innerHeight;

		document.getElementById("vfade").style.width= (DocwinW) + 'px';
		document.getElementById("vfade").style.height= (DocwinH) + 'px';	
	}
	else{

 	
		winW = document.body.offsetWidth;
		winH = document.body.offsetHeight;
		//winW = document.documentElement.clientWidth;
		//winH = document.documentElement.clientHeight;
		
		document.getElementById("vfade").style.width= (DocwinW-25) + 'px';
		document.getElementById("vfade").style.height= (DocwinH) + 'px';	
	}


}	
//--------------------------------------------------------------------------
function edittophide(){
	
	if(document.getElementById('entrytop')){document.getElementById('entrytop').style.visibility='visible';}
}	


//--------------------------------------------------------------------------------------

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}
	
