var ajaxRequest = false;

var globalarr = [];

var hidden = 'hidden';
var visible = 'visible';
var none = 'none';
var inline = 'inline';

/*@cc_on @*//*@if (@_jscript_version >= 5)// JScript gives us Conditional compilation, we can cope with old IE versions.// and security blocked creation of the objects. try {  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
 //alert("Msxml2 AJAX"); } catch (e) {  try {
   ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");   
  	//alert("Microsoft AJAX");  } catch (E) {   ajaxRequest = false;  } }@end @*/if (!ajaxRequest && typeof XMLHttpRequest!='undefined') {	try {
		ajaxRequest = new XMLHttpRequest();
		//alert("XMLHttpRequest AJAX");	} catch (e) {		ajaxRequest=false;	}}if (!ajaxRequest && window.createRequest) {	try {		ajaxRequest = window.createRequest();
		//alert("createRequest AJAX");	} catch (e) {		ajaxRequest=false;	}}
	

function fadeOutIn(out, inn)
{
	var i,g;
	var timer = 10;
	globalarr[0] = document.getElementById(out).style;
	globalarr[1] = document.getElementById(inn).style;
	for(i=0; i<10; i++, timer+=15)
	{
		g = 1 - ((i+1)/10);
		if(i<9) {
			setTimeout("globalarr[0].opacity=" + g + ";", timer);
		} else {
			setTimeout("globalarr[0].opacity=" + g + ";globalarr[0].display='none';", timer);
		}
	}
	for(i=0; i<10; i++, timer+=15)
	{
		g = 0 + ((i+1)/10);
		if(i==0) {
			setTimeout("globalarr[1].display='inline';globalarr[1].opacity=" + g, timer);
		} else {
			setTimeout("globalarr[1].opacity=" + g, timer);
		}
	}
	
	//setTimeout("delete globalarr[0];delete globalarr[1];", timer+20);
	return timer;
}

function fadeIn(inn)
{
	var i,g;
	var timer = 10;
	globalarr[2] = document.getElementById(inn).style;
	
	for(i=0; i<10; i++, timer+=15)
	{
		g = 0 + ((i+1)/10);
		if(i==0) {
			setTimeout("globalarr[2].display='inline';globalarr[2].opacity=" + g, timer);
		} else {
			setTimeout("globalarr[2].opacity=" + g, timer);
		}
	}
	
	setTimeout("delete globalarr[2];", timer+20);
	return timer;
}

function fadeOut(out)
{
	var i,g;
	var timer = 10;
	globalarr[3] = document.getElementById(out).style;
	
	for(i=0; i<10; i++, timer+=15)
	{
		g = 1 - ((i+1)/10);
		if(i==0) {
			setTimeout("globalarr[3].display='inline';globalarr[3].opacity=" + g, timer);
		} else {
			setTimeout("globalarr[3].opacity=" + g, timer);
		}
	}
	
	setTimeout("delete globalarr[3];", timer+20);
	return timer;
}


function checkForKey(e, key, callback)
{
	//alert('check for key ' + key);
	var characterCode;// literal character code will be stored in this variable	if(e && e.which) { //if which property of event object is supported (NN4)		characterCode = e.which //character code is contained in NN4's which property	} else {		//e = event;		characterCode = e.keyCode; //character code is contained in IE's keyCode property	}
	
	if(key == 'enter') {		if(characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
			callback.call(callback);
		}	}
}
