var isIE  = (navigator.appVersion.toLowerCase().indexOf("msie") != -1) ? true : false;
var isMac = (navigator.appVersion.toLowerCase().indexOf("macintosh") != -1) ? true : false;
var isSafari  = (navigator.appVersion.toLowerCase().indexOf("safari") != -1) ? true : false;
//*******************************************************************************************
function clearAllTimeouts(){
      for(key in timeOuts ){
            clearTimeout(timeOuts[Number(key)]);
      }
}

function getLastElementNode(node) {
    
    child =  node.lastChild;
    while (  child != null ) {
        if (child.nodeType == 1) return child    
        child = child.previousSibling;    
    }
    return null;    
}

function isChildDiv(a, b){	
	// we climb through b parents till we find a or null
 	while(b && (a!=b) && (b!=null)){
		b = b.parentNode;
	}
	return a == b;
}

function getCookie(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	
	if (document.cookie.match(re)){ //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	}
	return ""
}

function setCookie(name, value){
	document.cookie = name+"="+value + ";path=/" //cookie value is domain wide (path=/)
}
