window.onload = function() {
  var arrSlistEv =[]
  //var arrSlink = document.getElementsByClassName('slink')
  //var arrSlist = document.getElementsByClassName('slist')
  var arrSlink = getElementsByClassName('slink')
  var arrSlist = getElementsByClassName('slist')
//  var myAccordion = new fx.Accordion(arrSlink,arrSlist, {opacity: true, duration: 500})
  arr1 = getElementsByClassName('page_only')
  for (var i=0; i<arr1.length; i++) {
    arr1[i].onmouseover=changeCurPost
  }
  hidePostMetaAll()
// livepreview *
	if(!document.getElementById) return false	

	var commentArea = document.getElementById('comment')
  if (commentArea != undefined) {
	  commentArea.onkeyup = function(){
	    var commentString = this.value
		  commentString = wpautop(wptexturize(commentString))
		  document.getElementById('preview').innerHTML = commentString  	
	  }	
	}
//livepreview*
}

function hidePostMeta(objPost) {
  //var isIE = navigator.appName == "Microsoft Internet Explorer";
  var isIE=false;
  for (var i=0;i < objPost.childNodes.length;i++) {
    if (!isIE && objPost.childNodes[i].nodeType == 1 && (objPost.childNodes[i].className == 'info_page' || objPost.childNodes[i].className == 'sep'  )) {
      objPost.childNodes[i].style.display = 'none'
    }
  }
}
function hidePostM() {
  //var isIE = navigator.appName == "Microsoft Internet Explorer";
  for (var i=0;i < this.childNodes.length;i++) {
    if (this.childNodes[i].nodeType == 1 && (this.childNodes[i].className == 'info_page' || this.childNodes[i].className == 'sep'  )) {
      this.childNodes[i].style.display = 'none'
    }
  }
}
function viewPostMeta(objPost) {
  for (var i=0;i < objPost.childNodes.length;i++) {
    if (objPost.childNodes[i].nodeType == 1 && (objPost.childNodes[i].className == 'info_page' || objPost.childNodes[i].className == 'sep'  )) {
      objPost.childNodes[i].style.display = 'block'
    }
  }
}
function hidePostMetaAll() {
  objDoc = document.getElementsByTagName('div')
  for (var j=0;j < objDoc.length;j++) {
    hidePostMeta(objDoc[j])
  }  
}
function viewS() {

}
function changeCurPost() {
  hidePostMetaAll()
  viewPostMeta(this)
}
function addDelicious(){
//  objLi = document.getElementById('delicious')
  document.write( '<script type="text/javascript" src="http://del.icio.us/feeds/json/granvik?count=20"></script><script type="text/javascript" src="/wp-content/themes/ddd2/scripts/delicious.js"></script>')
}


function getElementsByClassName(className){
  arr = document.getElementsByTagName('*')
  var arrRes =[]
  for (i=0;i<arr.length;i++){
    if (arr[i].className == className ) {
      arrRes.push(arr[i])
    }
  }
  return arrRes
}

