function addComment(u,v,w,h,s){
window.open(u+"&id="+v+"&subject="+s+"&","Comment","width="+w+",height="+h+",scrollbars=yes,status=yes")}
function readComment(u,v,w,h,s){
window.open(u+"&RestrictToCategory="+v,"Comment","width="+w+",height="+h+",resizable,scrollbars=yes,status=yes")}
function dxInsertDate(){

var now= new Date()
var month= now.getMonth()
var date= now.getDate()
var year= now.getFullYear()
var mnth= new Array()
var dt= new Array()

mnth[0]="January"
mnth[1]="February"
mnth[2]="March"
mnth[3]="April"
mnth[4]="May"
mnth[5]="June"
mnth[6]="July"
mnth[7]="August"
mnth[8]="September"
mnth[9]="October"
mnth[10]="November"
mnth[11]="December"

dt[1]="st"
dt[2]="nd"
dt[3]="rd"
dt[4]="th"
dt[5]="th"
dt[6]="th"
dt[7]="th"
dt[8]="th"
dt[9]="th"
dt[10]="th"
dt[11]="th"
dt[12]="th"
dt[13]="th"
dt[14]="th"
dt[15]="th"
dt[16]="th"
dt[17]="th"
dt[18]="th"
dt[19]="th"
dt[20]="th"
dt[21]="st"
dt[22]="nd"
dt[23]="rd"
dt[24]="th"
dt[25]="th"
dt[26]="th"
dt[27]="th"
dt[28]="th"
dt[29]="th"
dt[30]="th"
dt[31]="st"

document.write(date+dt[date]+" "+mnth[month]+" "+year)
}
function doSearch(categories,group,strict,auto) {
var strSearch="";
if(auto=="Y"){
categories="";
group="";
var href=new String(window.location.href+"&");
var ar=href.split("&cat=");
if(ar[1]!=null){
categories=ar[1].split("&")[0];
}
var ar=href.split("&cat2=");
if(ar[1]!=null){
categories+="~"+ar[1].split("&")[0];
}
var ar=href.split("&cat3=");
if(ar[1]!=null){
categories+="~"+ar[1].split("&")[0];
}
var ar=href.split("&cat4=");
if(ar[1]!=null){
categories+="~"+ar[1].split("&")[0];
}
var ar=href.split("&cat5=");
if(ar[1]!=null){
categories+="~"+ar[1].split("&")[0];
}
var ar=href.split("&cat6=");
if(ar[1]!=null){
categories+="~"+ar[1].split("&")[0];
}
strSearch="&amp;categories="+categories;
}else{
if(categories!=""){strSearch+="&amp;categories="+categories};
if(group!=""){strSearch+="&amp;group="+group};
}
if(strict!=""){strSearch+="&amp;strict="+strict};
var form=document.forms["searchForm"];
  var query = form.Query.value;
  if( query == '' ){
    alert('Please enter the search term or phrase.');
    form.Query.focus();
  } else {
    window.location.href = '/A55D03/Blog.nsf/dx/search.htm?opendocument&amp;q=' + escape(query)+strSearch;
  }
}
function writeStat(pth,page,xhtml,subject){
var docurl=document.URL;
docurl=docurl.split("#")[0];
document.write("<img alt='Statistics' style='position:absolute;left:1px;top:1px;visibility:hidden' width='1' height='1' src='"+pth+"/fLog?CreateDocument&t="+docurl+"&r="+document.referrer+"&s="+subject+"&p="+page+"' "+xhtml+">");}
function storeCuk(){
if(f.remember.checked){
if(!isNull(f.author)){cookie.author=f.author.value;}
if(!isNull(f.organisation)){cookie.organisation=f.organisation.value;}
if(!isNull(f.country)){cookie.country=f.country.value;}
if(!isNull(f.email)){cookie.email=f.email.value;}
if(!isNull(f.website)){cookie.website=f.website.value;}
cookie.store();
}
}
function cuk(){
this.$document=document;
this.$name="DX";
var hours=744;
if(hours){this.$expiration=new Date((new Date()).getTime()+hours*3600000)}else{this.$expiration=null}
this.$path="/";
}
cuk.prototype.store=function (){
var cval=""
for(var prop in this){
if((prop.charAt(0)=='$')||((typeof this[prop])=='function'))
continue;
if(cval!=""){cval+='&'}
cval+=prop+':'+escape(this[prop])
}
var c=this.$name+'='+cval
if(this.$expiration){c+='; expires='+this.$expiration.toGMTString()}
if(this.$path){c+='; path='+this.$path}
this.$document.cookie=c
}
cuk.prototype.load=function (){
var ac=this.$document.cookie
if(ac==""){return false}
var s=ac.indexOf(this.$name+'=')
if(s==-1){return false}
s+=this.$name.length+1
var e=ac.indexOf(';',s)
if(e==-1)e=ac.length
var cval=ac.substring(s,e)
var a=cval.split('&')
for(var i=0; i<a.length;i++){a[i]=a[i].split(':')}
for(var i=0;i<a.length;i++){this[a[i][0]]=unescape(a[i][1])}
return true
}
function isUndefined(property){return (typeof property=='undefined');}
function isNull(val){return (val==null);}
function dxMail(n,d){
location.href="mailto:"+n+"@"+d;
}
function welcome(pre,post,t){
var cookie=new cuk();
cookie.load();
if(!isNull(cookie.author)){
var name="";
if(t=="Y"){
name="<a href=\"../discuss.htm?openagent&mode=email&pass="+cookie.email+"\" title=\"Goto my recent Comments on this Site\">"+cookie.author+"</a>";
}else{
name=cookie.author;
}
document.write(pre+name+post);}}
function toggleDiv(o){
if (document.getElementById(o.id+"Control").style.display=="none"){
document.getElementById(o.id+"Control").style.display="";
document.getElementById("i"+o.id+"Control").innerHTML="-";
}else{
document.getElementById(o.id+"Control").style.display="none";
document.getElementById("i"+o.id+"Control").innerHTML="+";
}
}
var requestURL="/A55D03/Blog.nsf/";
var req;
function smartCloud(c){
loadJSON(requestURL+"vTagCategoryCount?readviewentries&collapseview&restricttocategory="+c+"&count=1000&outputformat=json");
}
function smartCloud2(){
var theMin=32767;
var theMax=0;
var theLevels=4;
var theQual=1;
var cArray=new Array();
var tArray=new Array();
var wArray=new Array();
cArray.length=0;
tArray.length=0;
wArray.length=0;
var html="";
if(thisCategory!="null"){
html+="<a href="+"../archive?openview&amp;title="+thisCategory+"&amp;type=cat&amp;cat="+thisCategory+"><strong>" +unescape(thisCategory)+"</strong></a><br/><br/>";
}
var viewObj=eval( "(" + req.responseText + ")" );
var viewEntries = viewObj.viewentry;
if(viewEntries!=null){
for (var x = 0; x < viewEntries.length; x++){
var entryData = viewEntries[x].entrydata;
if (entryData!=null){
var desc=parseInt(viewEntries[x]["@descendants"]);
if(desc>=theQual){
cArray.push(desc);
if(desc>theMax){theMax=desc;}
if(desc<theMin){theMin=desc;}
for (var y=1;y<=theLevels;y++){
	if((desc-theMin)<=((theMax-theMin)/theLevels)*y){
		wArray.push(y);
		break;
	}	
}
tArray.push(entryData[0].text[0])
}}}
for (var x=0; x < tArray.length; x++) { 
html+="<li class='tag"+wArray[x]+"'>\n<a href="+"../archive?openview&amp;title="+thisCategory+"%20"+"&gt;"+"%20"+escape(tArray[x])+"&amp;type=cat&amp;cat="+thisCategory+"&amp;tag="+escape(tArray[x])+">"+tArray[x]+"</a>\n</li>\n";      
}
}
document.getElementById("dxSC").innerHTML=html;
}
function loadJSON(url) {
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChangeJSON;
        req.open("GET", url, true);
          req.setRequestHeader("Content-Type", "text/javascript");
        req.send(null);
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChangeJSON;
            req.open("GET", url, true);
	req.setRequestHeader("Content-Type", "text/javascript");
            req.send();
        }
    }
}
function processReqChangeJSON() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
smartCloud2();
         } else {
            alert("There was a problem retrieving the XML data:\n" +
                req.statusText);
         }
    }
}

