function getFile(pURL,where) {
  
     var curDateTime = new Date()
    
   
  oxmlhttp = null;
    try
      { oxmlhttp = new XMLHttpRequest();
        oxmlhttp.overrideMimeType("text/xml");
      }
    catch(e)
      { try
          { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch(e)
          { return null;
          }
      }
    if(!oxmlhttp) return null;
    try
      { oxmlhttp.open("GET",pURL,false);
        oxmlhttp.send(null);
      }
    catch(e)
      { return null;
      }
    //return oxmlhttp.responseText;
	 
	mywebpage=oxmlhttp.responseText;
	//where="nav";
	document.getElementById(where).innerHTML=mywebpage; 
}



function editFile(pURL,where) {
  
     var curDateTime = new Date()
	 var ep= curDateTime.getTime();
	 pURLorig=pURL;
     pURL=pURL+"?x="+ep;
   
  oxmlhttp = null;
    try
      { oxmlhttp = new XMLHttpRequest();
        oxmlhttp.overrideMimeType("text/xml");
      }
    catch(e)
      { try
          { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch(e)
          { return null;
          }
      }
    if(!oxmlhttp) return null;
    try
      { oxmlhttp.open("GET",pURL,false);
        oxmlhttp.send(null);
      }
    catch(e)
      { return null;
      }
    //return oxmlhttp.responseText;
	 
	mywebpage=oxmlhttp.responseText;
	var text_array=mywebpage.split("\n");
	//where="nav";
	temptext="";
	for(i=6;i<text_array.length;i++){
	 	temptext=temptext+""+text_array[i]+"\n";
		
	}
	
	document.getElementById(where).title.value=text_array[0];
	document.getElementById(where).author.value=text_array[1]; 
	document.getElementById(where).contact.value=text_array[2]; 
	document.getElementById(where).rating.value=text_array[3]; 
	document.getElementById(where).views.value=text_array[4]; 
	document.getElementById(where).tempasoc.value=text_array[5]; 
	document.images['preview'].src="blogimages/"+text_array[5]; 
	document.getElementById(where).editarea.value=text_array[6]; 
	document.getElementById(where).changes.selectedIndex=1;
	document.getElementById(where).editfile.value=pURLorig; 
	//document.getElementById(where).submit.disabled=true;
	//.Button1.disabled=false
}

function viewblog(pURL,where) {
  
     var curDateTime = new Date()
	 var ep= curDateTime.getTime();
	 pURLorig=pURL;
     pURL=pURL+"?x="+ep;
   
  oxmlhttp = null;
    try
      { oxmlhttp = new XMLHttpRequest();
        oxmlhttp.overrideMimeType("text/xml");
      }
    catch(e)
      { try
          { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch(e)
          { return null;
          }
      }
    if(!oxmlhttp) return null;
    try
      { oxmlhttp.open("GET",pURL,false);
        oxmlhttp.send(null);
      }
    catch(e)
      { return null;
      }
    //return oxmlhttp.responseText;
	 
	mywebpage=oxmlhttp.responseText;
	var text_array=mywebpage.split("\n");
    var mytitle=text_array[0];
	var myauthor=text_array[1];
	var myimage=text_array[5];
	

	temptext="";
	for(i=6;i<text_array.length;i++){
	 	temptext=temptext+""+text_array[i]+"\n";
		
	}
	
	temptextbr="";
	text_arraybr=temptext.split("\r");
	for(j=0;j<text_arraybr.length;j++){
	 	temptextbr=temptextbr+""+text_arraybr[j]+"<br>";
		
	}
	
	var mydata="";
	if(myimage!=""){mydata=mydata+"<img name='preview' id='preview' src=blogimages/"+myimage+"><br><br>";}
	mydata=mydata+"<b>"+mytitle+"</b></br><i>"+myauthor+"</i></br>";
	mydata=mydata+"</br>"+temptextbr+"<br><br>";

	document.getElementById(where).innerHTML=mydata; 

}

function clearform(which) {
	document.getElementById(which).title.value="";
	document.getElementById(which).author.value=""; 
	document.getElementById(which).contact.value=""; 
	document.getElementById(which).rating.value="0"; 
	document.getElementById(which).views.value="0"; 
	document.getElementById(which).asoc.value=""; 
	document.getElementById(which).editarea.value=""; 
	document.getElementById(which).myaction.value="";
	document.getElementById(which).editfile.value="";
}