/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// preload images
/*
var arImages=new Array();
function preload_img() {
	var temp = preload_img.arguments; 
	for(x=0; x < temp.length; x++) {
		arImages[x]=new Image();
		arImages[x].src=preload_img.arguments[x];
	}
}
function preload() {
	preload_img();
}*/
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// change image state on mouse over
function rollover(element, ext){
	if(element.indexOf('.')!= -1){
		image_name = element.substr(0,element.indexOf('.'));
	}
	else{
		image_name = element;
	}
	document.getElementById(element).src = "images/"+image_name+"_o"+(ext?"."+ext:".gif");
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// change image state on mouse out
function rollout(element, ext){
	if(element.indexOf('.')!= -1){
		image_name = element.substr(0,element.indexOf('.'));
	}
	else{
		image_name = element;
	}
	document.getElementById(element).src = "images/"+image_name+(ext?"."+ext:".gif");
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// open window
var win,win2,win3;
function open_win(url,width,height,name,scrolls){
	switch(name) {
		case 1:   
			win = window.open(url,'win1','scrollbars='+(scrolls?'yes':'no')+',menubar=no,height='+height+',width='+width+',resizable=yes,toolbar=no,status=no,location=no');
			win.focus();
			break;
		case 2:   
			win2 = window.open(url,'win2','scrollbars='+(scrolls?'yes':'no')+',menubar=no,height='+height+',width='+width+',resizable=yes,toolbar=no,status=no,location=no');
			win2.focus();
			break;
		case 3:   
			win3 = window.open(url,'win3','scrollbars='+(scrolls?'yes':'no')+',menubar=no,height='+height+',width='+width+',resizable=yes,toolbar=no,status=no,location=no');
			win3.focus();
			break;
		default:    
			window.open(url,'','scrollbars='+(scrolls?'yes':'no')+',menubar=no,height='+height+',width='+width+',resizable=yes,toolbar=no,status=no,location=no');
	}
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// retrieve content from pages with xmlHttpRequest
// file = the file to parse
// element = the id of the element to place the result inside
// parent = true or false... if the layer is in a parent frame
var content= '';
function getPage(file, element, parent){
	// clear the fetching variable
	var xmlhttp=false; 
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); // try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest(); // if we were able to get a working active x object, start an XMLHttpRequest
	}
	// open the file through GET
	xmlhttp.open('GET', file, true); 
	xmlhttp.onreadystatechange=function() {
		// check if it is ready to receive data
		if (xmlhttp.readyState==4) { 
			// get the date retrieve
			content = xmlhttp.responseText; 
			if(content){ // check if there is something in the content variable
				// verify if the element is in a parent window
				if(parent){
					// clear the inner content of the element
					window.parent.document.getElementById(element).innerHTML = ""; 
					// change the inner content of the element
					window.parent.document.getElementById(element).innerHTML = content;
					if(element=='profile'){
						window.parent.document.getElementById('box').style.visibility = 'visible';
					}
			
				}
				else{
					// clear the inner content of the element
					document.getElementById(element).innerHTML = ""; 
					// change the inner content of the element
					document.getElementById(element).innerHTML = content; 
					if(element=='profile'){
						document.getElementById('box').style.visibility = 'visible';
					}
				}
			}
		}
	}
	// reset the XMLHttpRequest
    xmlhttp.send(null) 
	return; 
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
// clear content of the drag box
// element = id
function clearLayer(element){
	if(document.getElementById(element))
	{
		document.getElementById(element).innerHTML = ""; 
		if(element=='profile'){
			document.getElementById('box').style.visibility = 'hidden';
			document.getElementById('box').style.top = pos_top;
			document.getElementById('box').style.left = pos_left;
		}
	}
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
/* change tab state */
function changeTabState(active, ary_inactives){
	document.getElementById(active+'_c').style.display = 'block';
	document.getElementById(active).style.display = 'none';
	for(i in ary_inactives){
		if(document.getElementById(ary_inactives[i]+'_c')) {
			document.getElementById(ary_inactives[i]+'_c').style.display = 'none';
		}
		if(document.getElementById(ary_inactives[i])) {
			document.getElementById(ary_inactives[i]).style.display = 'block';
		}
	}
	return;
}
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */


//Create the sub array of the letter selector {{{
function createSubArrayFromValue(arr){
	var arrReturn = new Array();
	for(intI = 0; intI < arr.length; intI++)
		arrReturn[arr[intI]] = new Array();
	return arrReturn;
}
//}}}

