function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.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 onresize() {
	if(window.location.href.indexOf('cset=') > -1) {
		document.execCommand('Refresh') ;
	}
}

function mainwin(page) {
	if(window.opener && !window.opener.closed) {
		window.opener.focus();
		window.close();
	}
	else {
	  mshow = window.open( page , "main" );
	  if ( ( typeof(mshow) != "object" ) || !mshow || mshow.closed ) {
	    return false;
	  }
	  else {
		mshow.window.focus();
		window.close();
	  }
	}
}

// Disable select-text script
  
function showclip(name,w,h) {
  rshow = window.open(name , "clip", "toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,resizable=yes,width="+w+",height="+h+",left=10,top=10" );
  if ( ( typeof(rshow) != "object" ) || !rshow || rshow.closed ) {
   return false;
  }
  else {
    rshow.window.focus();
  }
}

function disableselect(e){
	return false
} 
  
function reEnable(){
	return true
} 
  
//if IE4+
document.onselectstart=new Function ("return false") 
  
//if NS6
if (window.sidebar){
	document.onmousedown=disableselect
	document.onclick=reEnable
}

// Disable select-image script

function right(e) {
	if (navigator.appName == 'Netscape' &&
		(e.which == 3 || e.which == 2))
		return false;
		else if (navigator.appName == 'Microsoft Internet Explorer' &&
		(event.button == 2 || event.button == 3)) {
		alert("I'm sorry, right click has been disabled.");
		return false;
	}
	return true;
} 
  
// document.onmousedown=right;
// document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
// window.onmousedown=right;
// window.onmouseup=right;

