// www.turtle-media.com
//
var root, numlevels
root = 'http://www.turtle-media.com/cms2/'

////////////////////////////////////////////////////////////////////
function $(id){return document.getElementById(id);}
////////////////////////////////////////////////////////////////////
// get  and set cookie script
function getC(c_name){ 
if (document.cookie.length>0){c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1){ c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) {c_end=document.cookie.length}; return unescape(document.cookie.substring(c_start,c_end))}} return ""}
// setPermCookie script
function setC(c_name, c_value){document.cookie =  c_name + '=' + c_value + '; expires=Thu, 2 Aug 2040 20:47:11 UTC; path=/'}
////////////////////////////////////////////////////////////////////
//showhide
function show(divid){try{$(divid).style.display = "block";}     catch(err){}}
function showrow(divid){try{$(divid).style.display = "";}     catch(err){}}
function showinline(divid){try{$(divid).style.display = "inline";} catch(err){}}
function hide(divid){try{$(divid).style.display = "none";} catch(err){}}
////////////////////////////////////////////////////////////////////
function redirect(url){document.location = url}
function conf(url){if(confirm("Are you sure?")){redirect(url)}}
////////////////////////////////////////////////////////////////////
function getVal(id){return $(id).value}
////////////////
function setfocus(a_field_id) {$(a_field_id).focus()}
////////////////

/////////////AJAX/////////////////////////////////////////////////////
function ajax(filename){
var xmlHttp;
try{  // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
} catch (e) { try{  // Internet Explorer 6.0+
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) { try { // IE 5.5+
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {alert("Your browser does not support AJAX!"); return false;}}}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4){
gotAjax(xmlHttp.responseText)}}
xmlHttp.open("GET", filename, true);xmlHttp.send(null);}
/////////
function gotAjax(data){alert(data)}
////////////////////////////////////////////////////////////////////

function doHeightChangeMem(elem,startHeight,endHeight,steps,intervals,powr) { 

    if (elem.heightChangeMemInt)
	window.clearInterval(elem.heightChangeMemInt);
    var actStep = 0;
    elem.heightChangeMemInt = window.setInterval(
	function() { 
	  elem.currentHeight = easeInOut(startHeight,endHeight,steps,actStep,powr);
	  elem.style.height = elem.currentHeight + "px"; 
	  actStep++;
	  if (actStep > steps){
		  window.clearInterval(elem.heightChangeMemInt);
	  }
	} 
	,intervals)
}

function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) { 
    var delta = maxValue - minValue; 
    var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
    return Math.ceil(stepp) 
    } 

function widthChange(divid) { 
	if (!divid.currentHeight)  divid.currentHeight= 0 ;	//if no memory is set, set it first; 
    doHeightChangeMem(divid, divid.currentHeight, 80, 20, 1, 2); 	
} 

function widthRestore(divid) { 
    if (!divid.currentHeight)  return; 
    doHeightChangeMem(divid, divid.currentHeight, 0, 20, 1, 2); 
}

function goDown(divid){
	bot = $(divid + 'bot');
	widthChange(bot); 

}

function goUp(divid){
	bot = $(divid+'bot')
	widthRestore(bot)
}




window.onload = function(){
}







