/////////////////////////////////////////////////////////
function toggle(id) {
	var element=document.getElementById(id);
	if (element.className == "hidden") {
		element.className = "visible";
	} else {		
			element.className = "hidden";
			if(element.type=="select-one"){
				element.selectedIndex =-1;
			}
			if(element.type=="text"){
				element.value="";
			}
	}
}
/////////////////////////////////////////////////////////
function loadDiv(divName, url,callBack) {
	if(url.indexOf("?")==-1){
		url+="?noCache="+getTimestamp();
	}
	if(callBack!=null){
		jQuery(divName).load(url,{},callBack);
	}else{
		jQuery(divName).load(url);
	}
}
// lreturns a timestamp. Used to avoid IE caching Ajax requests
/////////////////////////////////////////////////////////
function getTimestamp() {
	tstmp = new Date();
	return tstmp.getTime();
}
// ///////////////////////////////////////////////////////
function doSaveAs(){
	var title=fixFileName(document.title);	
		if (document.execCommand){
			document.execCommand("SaveAs",false,title);
		}else{
			alert('Feature available only in Internet Exlorer 4.0 and later.');
		}
	}
/////////////////////////////////////////////////////////
function fixFileName(str){
	  return (str.replace(/\/|:|\)|\(|\+|\-/g,"-"));
	}
/////////////////////////////////////////////////////////