function wygEdit(docid,catid) {
	if (document.location.href.indexOf("dev.")==7) {
		var wygwindow = window.open ("/members/docedit.php?docid="+docid+"&catid="+catid, "wygwindow","location=0, status=0, scrollbars=1, width=800, height=900, top=6, left=6") ;
			if(wygwindow) {
				wygwindow.focus();
			} ;
		return false;
	}
	document.location.href = 'http://www.ecomdelta.com/?ref='+document.location.href ;
}

function initpage() {
	var p = document.getElementById('mainpage') ;
	var bdyW ;
	p.style.visibility = 'visible' ;
	p.style.zIndex = 99 ;

	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		bdyW = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		bdyW = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		bdyW = document.body.clientWidth;
	}
  	
	if ((bdyW -780) > 0) {
		var halfwidth = (bdyW -780) ; 
//		alert(halfwidth) ;
		halfwidth = halfwidth / 2 ;
//		alert(halfwidth) ;
		p.style.left = halfwidth + 'px' ;
	}

}

