// JavaScript Document
    function changediv(content, title)
{
	document.getElementById('header').innerHTML = "<div id='leftC'> <!-- --></div><div id='rightC'> <!-- --> </div><strong>"+title+"</strong> - " +content; 

}

function killdiv()
{
     document.getElementById('header').innerHTML = "<div id='leftC'> <!-- --></div><div id='rightC'> <!-- --> </div><!-- -->"; // or whatever default you want
}
function editCustom(listID,title) {
	 document.getElementById('block-' + listID).innerHTML = "<div class='handle'>"+title+"</div><div class='Cborder'><!-- --></div><iframe src='addCustom.php?listID="+listID+"' frameborder='0' scrolling='no' style='height:550px; width:100%;'><!-- --></iframe>";
}
//
//
//
//
//

function gotoNews(id) {
	location.href ='http://www.ranct.com/'+id;
	return false;	
}
function createXmlHttpRequestObject() {
	// will store the reference to the XMLHttpRequest object
	var xmlHttp;
	// if running Internet Explorer
	if(window.ActiveXObject) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e) {
			xmlHttp = false;
		}
	}
	// if running Mozilla or other browsers
	else {
		try {
			xmlHttp = new XMLHttpRequest();
		}
		catch (e) {
			xmlHttp = false;
		}
	
	}
	// return the created object or display an error message
	if (!xmlHttp)
		alert("Error creating the XMLHttpRequest object.");
	else
		return xmlHttp;
}

function refreshArticle_switch(url,target)
{

    if (document.getElementById(target).innerHTML != '')
    {
        document.getElementById(target).innerHTML = '';
    }
    else
    {

        refreshArticle(url,target);
    }

}
function refreshArticle(url,target) {
    // native XMLHttpRequest object
        //document.getElementById(target).innerHTML = '<span class="arefreshArticle_waiting"><a href="java script:refreshArticle(\''+url+'\',\''+target+'\');">sending...</a></span>';
   req = createXmlHttpRequestObject();
           req.onreadystatechange = function() {refreshArticleDone(target);};
        req.open("GET", url, true);
        req.send(null);
}    

function refreshArticleDone(target) {
    // only if req is "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            results = req.responseText;
            document.getElementById(target).innerHTML = results;
        } else {
            document.getElementById(target).innerHTML="refreshArticle error:\n" +
                req.statusText;
        }
    }
}
function fixSizeDelay()

  {

    var t=setTimeout("fixSize()",800)

  }
  function fixSizeDelay2()

  {

    var t=setTimeout("fixSize()",1200)

  }
function fixSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
   // myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
   // myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
   // myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var collapsedDiv=0, expandedDiv=0;
  collapsedDiv=myHeight-212;
  expandedDiv = myHeight-32;
  	if (document.getElementById('related').offsetHeight>2 || document.getElementById('morefromsource').offsetHeight>2 || document.getElementById('comments').offsetHeight>2) {
 		document.getElementById('RANCTiFrame').style.height = collapsedDiv+'px'; //RELATED IS VISIBLE
		document.getElementById('comments').style.height = expandedDiv+'px'; //RELATED IS VISIBLE
	} else {
	  	document.getElementById('RANCTiFrame').style.height = expandedDiv+'px'; //RELATED IS HIDDEN
		document.getElementById('comments').style.height = collapsedDiv+'px'; //RELATED IS VISIBLE
  	}

}

animatedcollapse.addDiv('comments', 'fade=1,height=100%,hide=1')
animatedcollapse.addDiv('related', 'fade=1,height=180px,hide=1')
animatedcollapse.addDiv('morefromsource', 'fade=1,height=180px,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
	//$: Access to jQuery
	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
	//state: "block" or "none", depending on state
}

animatedcollapse.init()