// JavaScript Document
function dimLink(x){
	p = document.getElementById('navigation');
	L = p.getElementsByTagName('a');
	for (i = 0; i < L.length; i++){
		if (L[i].href == x){
			L[i].className = 'currentPage';
			L[i].href = 'javascript:;';
			L[i].innerHTML = "<span style='font-weight:bold; font-size:14px'>" + L[i].innerHTML + "</span>";
			return;
		}
	}
}

function newKeyword(){
	p = prompt("Please enter only one word, it may have spaces:","");
	if (p == null || p == ''){
		return false;
	}
	p = ", " + p;
	p = document.form2.keywords.value + p
	document.form2.keywords.value = p
}

function myConfirm(msg,act){
	/*For cancel purpose only*/
	p = confirm("Are you sure to ..." + msg);
	if (p){
		window.location = act;
	}
	else{
		return false;
	}
}

function anima(ob,t){
	if(t){
		$(ob).fadeOut("slow",function(){anima(ob,false)});
	}
	else{
		$(ob).fadeIn("slow",function(){anima(ob,true)});
	}
	
}
//input[@type=text]
$(document).ready(function(){
  $('a').click(function() {
  this.blur();
}); 
$("input,textarea,select,option").focus(function() {
  $(this).css('border-color','green');
});
$('input').blur(function() {
  $(this).css('border-color','');
});
$('form').submit(function() {						
  $('input[@type=submit]').attr("disabled","disabled");														
});
//$("a"[@href^=http*]").append("<span class='External'>?</span>");
$("a[@href^=http]").addClass("ExternalLink");
$("a[@href^=http]").attr("target", "_blank");
$("a[@href^=https]").addClass("ExternalLink");
$("a[@href^=https]").attr("target", "_blank");
//anima("#logo h2",true)

var myColors = [
{param:"color", fromColor:"white", toColor:"orange", duration:10000}
];
$("#logo h2").colorBlend(myColors);
$('td *, #page *').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - ",	
	fixPNG: true,
	opacity: 0.95,
	left: -120
});


/*.tooltip({
	
	showURL: false
});*/
})	

h = new Object();
IDss = new Object();
function showPanel(ID){

IDss[ID] = ID;
if (h[ID]){
	$(ID).hide("slow");
	h[ID] = false;

	}
	else{
	$(ID).show("slow");	
	jQuery.each(IDss, function(){	
	if (ID != this && h[this]){
	h[IDss[this]] = false;
	$(IDss[this]).hide("slow");
	 }
	});
	h[ID] = true;
	}

}
