
function hide(divId){

	document.getElementById(divId).style.visibility='hidden';
	document.getElementById(divId).style.position='absolute';
	document.getElementById(divId).style.zIndex='-1';
	
}

function reveal(divId){

	document.getElementById(divId).style.visibility='visible';
	document.getElementById(divId).style.position='static';
	document.getElementById(divId).style.zIndex='3';
	
}

function showDiv(divId){
	document.getElementById(divId).style.visibility='visible';
	document.getElementById(divId).style.zIndex='3';
}


function getShuffle(){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	

	var url = '_includes/front_random_member.php';
	var params = '';
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('randomMemberDiv').innerHTML=http.responseText;
		}
	}
}

function getGalleryImages(number){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	

	var url = '_includes/front_latest_gallery_images.php';
	var params = 'number=' + number;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('galleryImagesDiv').innerHTML=http.responseText;
		}
	}
}


function getLatestMembers(number){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	

	var url = '_includes/front_latest_members.php';
	var params = 'number=' + number;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('latestMembersDiv').innerHTML=http.responseText;
		}
	}
}

function getFrontFolios(number){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	

	var url = '_includes/front_folios.php';
	var params = 'number=' + number;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('frontFolios').innerHTML=http.responseText;
		}
	}
}

function updateLinkCatList(id, name){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	
	
	var url = '../_includes/get_link_cat_list.php';
	var params = 'cat_id=' + id + '&name=' + name;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('linkCatListDiv').innerHTML=http.responseText;
		}
	}
}

function getLink(id, label, linkUrl, catId){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	
	
	var url = '../_includes/get_link_list.php';
	var params = 'link_id=' + id + '&label=' + label + '&url=' + linkUrl + '&cat_id=' + catId;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('linkListDiv'+catId).innerHTML=http.responseText;
		}
	}
}

function getSideAds(method, id, text){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	

	var url = '../_includes/get_side_ads.php';
	var params = 'method=' + method + '&id=' + id + '&text=' + text;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('sideAdDiv').innerHTML=http.responseText;
		}
	}
}

function getSideWidgets(method, id, text){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	
	text = text.replace(/&/g, "%26");
	var url = '../_includes/get_side_widgets.php';
	var params = 'method=' + method + '&id=' + id + '&text=' + text;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('sideWidgetDiv').innerHTML=http.responseText;
		}
	}
}

function toggle(divId){
	if(document.getElementById(divId).style.visibility=='visible'){
		document.getElementById(divId).style.visibility='hidden';
		document.getElementById(divId).style.position='absolute';
		document.getElementById(divId).style.zIndex='-1';
	} else{
		document.getElementById(divId).style.visibility='visible';
		document.getElementById(divId).style.position='static';
		document.getElementById(divId).style.zIndex='3';
	}
}

function restore(elementId, text){
	document.getElementById(elementId).value=text;
}

function checkFile(fileId, buttonId, warningId, type){
	
	var fileName = document.getElementById(fileId).value;
	
	if(fileName.length<1){
		
		document.getElementById(buttonId).disabled = true;
		
	} else{
		
		var ext = fileName.substring(fileName.length-3, fileName.length);
		
		if(type=='file'){
			
			if(ext=='exe'){
				document.getElementById(warningId).style.visibility='visible';
				document.getElementById(warningId).style.zIndex='3';
				document.getElementById(fileId).value='';
				disable(buttonId);
			} else{
				enable(buttonId);
			}
			
		} else{
			if(ext=='jpg' || ext=='gif' || ext=='png'){
				enable(buttonId);	
			} else{
				document.getElementById(warningId).style.visibility='visible';
				document.getElementById(warningId).style.zIndex='3';
				document.getElementById(fileId).value='';
				disable(buttonId);
			}
		}
	}
	
}


function disable(buttonId){
	
	document.getElementById(buttonId).style.filter="alpha(opacity=50)";
	document.getElementById(buttonId).style.opacity=".5";
	document.getElementById(buttonId).style.cursor="no-drop";
	document.getElementById(buttonId).disabled=true;

}

function enable(buttonId){
	
	document.getElementById(buttonId).style.filter="alpha(opacity=100)";
	document.getElementById(buttonId).style.opacity="1";
	document.getElementById(buttonId).style.cursor="pointer";
	document.getElementById(buttonId).disabled=false;
	
}

function rollover(elId){
	
	document.getElementById(elId).style.opacity='1';
	document.getElementById(elId).style.filter='alpha(opacity=100)';
	
}

function rollout(elId){
	
	
	if(document.getElementById(elId).style.opacity){
		var curVal = document.getElementById(elId).style.opacity*100;	
	} else{
		var tempVal = document.getElementById(elId).style.filter;
		var curVal = parseFloat(tempVal.replace(/[^0-9.]/g, ''));
	}
	
	if(curVal>60){
		var newVal = curVal - 2;
		
		document.getElementById(elId).style.opacity = (newVal/100);
		document.getElementById(elId).style.filter='alpha(opacity='+newVal+')';
		var timer = window.setTimeout('rollout(\''+elId+'\')', 10);
	}
}


