function divsh( showID, hideID )
{
	var elems = document.getElementById( showID ); var elemh = document.getElementById( hideID );
	elems.style.display = 'block'; elemh.style.display = 'none';
}

function trimAll(sString,len) {
	while (sString.substring(0,1) == ' ') { sString = sString.substring(1, sString.length); }
	while (sString.substring(sString.length-1, sString.length) == ' ') { sString = sString.substring(0,sString.length-1); }
	sString = sString.replace("/    /", " "); sString = sString.replace("/   /", " "); sString = sString.replace("/  /", " ");
	if (sString.length < len) { sString = ''; }
	return sString;
}

function cC(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(1*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function rC(name) {
 	//alert(name);
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eC(name) {
	cC(name,"",-1);
}

function changecss(theClass,element,value) {
 var cssRules;
 if (document.all) {
  cssRules = 'rules';
 }
 else if (document.getElementById) {
  cssRules = 'cssRules';
 }
 for (var S = 0; S < document.styleSheets.length; S++){
  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
    document.styleSheets[S][cssRules][R].style[element] = value;
   }
  }
 }	
}

function wopen(url, name, w, h)
{ w += 32; h += 96;
  wleft = (screen.width - w) / 2; wtop = (screen.height - h) / 2;
  if (wleft < 0) { w = screen.width;  wleft = 0;  }
  if (wtop < 0) {  h = screen.height; wtop = 0;  }
  var win = window.open(url, name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=no');
  win.resizeTo(w, h); win.moveTo(wleft, wtop); win.focus();
}
