































///////////// AJAX SYNTAX START HERE ///////////////////////////////































































function gJXHidden(actPage,param) {































	































	var html = $.ajax({































		































		url: actPage,































		type: 'POST',































		data: param,































		async: false































		































		































	}).responseText;































	return html;































	































}































	































function loadPAGE(id,p,params) {































	document.getElementById(id).innerHTML = gJXHidden(p,params);































	































}































































































































































///////////// AJAX SYNTAX END HERE ///////////////////////////////































































































































































////////////// LOGIN SLIDES START HERE ////////////////































































































var x = false;































































function gologin(){































	































	if (x == false){































		$('#login_body').slideDown('slow', function() {































			x = true;































		});































	}else{































		$('#login_body').slideUp('slow', function() {































			x = false;































		});































	}	































































}































































////////////// LOGIN SLIDES STOP HERE ////////////////































































///// DISPLAY TIME //////////////































































function show_time(){































	loadPAGE('clocktimer','Display_Time.php','');































}































































/////////////////////////































































































///////////POP UP CODES //////////////////////////















































function showmessage(id){



	var screen_W = screen.width; //900

	var popup_W = 500;

	var desired_pos = (screen_W/2) - (popup_W/2);



	$("#popupmess").css("left",desired_pos + "px");

	var newsid = "newsid=" + id

	$("#block_div").fadeIn('fast', function () {

		$("#popupmess").fadeIn('slow', function () {

		loadPAGE('popupmess','/themes/v2_themes/Ajax_News_Content.php',newsid);

		document.getElementById('block_div').style.visibility = "visible";

	});





	});

	

}



function showitem(id){



	var screen_W = screen.width;

	var popup_W = 500;

	var desired_pos = (screen_W/2) - (popup_W/2);



	$("#popupmess").css("left",desired_pos + "px");

		var itemid = "itemid=" + id

		

		$("#block_div").fadeIn('fast', function () {

			$("#popupmess").fadeIn('slow', function () {

				loadPAGE('popupmess','/themes/v2_themes/Ajax_Donation.php',itemid);

				document.getElementById('block_div').style.visibility = "visible";

			});





		});



}



function load_donation(){

	loadPAGE('item_panel','/themes/v2_themes/Ajax_DonationList.php');

}





























































function close_message(){































	$("#popupmess").fadeOut('slow', function () {































			$("#block_div").fadeOut('slow', function () {







				loadPAGE('popupmess','/themes/v2_themes/Ajax_close.php','');







			 });































     });































}































































//////////////////////////////////////////////////////































































































////////SEARCH ENGINE AUTO SUGGEST //////////////////////////////















































function settype(params){















		















		if(params == 'monster'){







			



			



			document.search_engine.module.value = 'monster';















			















			$(".Monster_Search").css("background-color","#2a555d"); // enable















			















			$(".Monster_Search").css("color","#faf999"); // enable















			















			$(".Item_Search").css("background-color","#b5ccd1");  // disable color















			















			$(".Item_Search").css("color","#45767f");  // disable color















			















		















		}else{















			















			document.search_engine.module.value = 'item';















			















			$(".Monster_Search").css("background-color","#b5ccd1"); // disable















			















			$(".Monster_Search").css("color","#45767f"); // disable















			















			$(".Item_Search").css("background-color","#2a555d");  // enable color















			















			$(".Item_Search").css("color","#faf999");  // enable color















		















			















		}































}















































function searchqry(){































		var stype 		= document.search_engine.module.value;















		var str 	   =  document.search_engine.Search_text.value;















		















		if(stype == 'monster'){















			















			var monster = 'monster=' + str;















			















			if(str.length > 0){































				$("#Search_Query").css("display","block");















				LoadAjax('Search_Query','/themes/v2_themes/Ajax_Monster.php',monster)































			}else{































				$("#Search_Query").css("display","none");































			}















		















		















		















		















		}else{















			var items = 'item=' + str;















			















			if(str.length > 0){































				$("#Search_Query").css("display","block");















				LoadAjax('Search_Query','/themes/v2_themes/Ajax_Item.php',items)































			}else{































				$("#Search_Query").css("display","none");































			}















			















			















		}















		















	















		































}































function releasetext(){































		$("#Search_Query").css("display","none");































}































	































































































function Inint_AJAX() {































	   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE































	   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE































	   try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript































	   alert("XMLHttpRequest not supported");































	   return null;































	}































	function LoadAjax(src,phpfile,param) {































		















	















		 var req = Inint_AJAX();































		 var reqUpdated = Inint_AJAX();































 		 var params = param;































		 































		 req.onreadystatechange = function () { 































			  if (req.readyState==4) {































				   if (req.status==200) {































						document.getElementById(src).innerHTML=req.responseText; //return value































				   } 































			  }































		 };































































		 req.open("POST", phpfile,true); //make connection































		 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header































		 req.setRequestHeader("Content-length", params.length);































		 req.setRequestHeader("Connection", "close");































		 req.send(params); //send value































	}















































function loadqry(n,i){















		document.search_engine.Search_text.value = n;



		document.search_engine.id.value = i;



		















}























function act_search(){







		document.search_engine.submit();







}















































//////////////////////////////////////////////////////////







































///// BUTTONS NEWS UPDATE EVENT////







	







function getselected(params){







		







		







		if(params == 'news'){







			



        	newImage = "url(/themes/v2_themes/v2_images/news_btn-down.png)";



			document.getElementById('news_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/updates_btn-normal.png)";



			document.getElementById('update_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/events_btn-normal.png)";



			document.getElementById('event_button').style.backgroundImage = newImage;



			



			LoadAjax('news_body','/themes/v2_themes/Ajax_News.php','');



			







			







		}else if(params ==  'update'){







			



			newImage = "url(/themes/v2_themes/v2_images/news_btn-normal.png)";



			document.getElementById('news_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/updates_btn-down.png)";



			document.getElementById('update_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/events_btn-normal.png)";



			document.getElementById('event_button').style.backgroundImage = newImage;



			



			



			LoadAjax('news_body','/themes/v2_themes/Ajax_Update.php','');



			







		}else if(params == 'event'){







			



			newImage = "url(/themes/v2_themes/v2_images/news_btn-normal.png)";



			document.getElementById('news_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/updates_btn-normal.png)";



			document.getElementById('update_button').style.backgroundImage = newImage;



			



			newImage = "url(/themes/v2_themes/v2_images/events_btn-down.png)";



			document.getElementById('event_button').style.backgroundImage = newImage;



			



			



			LoadAjax('news_body','/themes/v2_themes/Ajax_Event.php','');







			







		







		







		}else{







			







		}







		







}





function loadgallery(){

	LoadAjax('gallery','/themes/v2_themes/Ajax_Gallery.php','');

}

// tool tip

var xpos = 0;
var ypos = 0;
	
	document.onmousemove = mouseMove;
	function mouseCoords(ev){
			if(ev.pageX || ev.pageY){ 	
				return {x:ev.pageX, y:ev.pageY}; 
			} 
			return { 
				x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, 
				y:ev.clientY + document.body.scrollTop  - document.body.clientTop 
			};
		
		}
		
		
		function mouseMove(ev){
			ev           = ev || window.event;
			var mousePos = mouseCoords(ev);
			xpos = mousePos.x;
			ypos = mousePos.y;
		}
	
	function showimages(id,msg){
		
		w = screen.width / 2;
		h = screen.height / 2;
		
		if(h >= ypos){
			document.getElementById('tooltip_images').style.top  = (ypos + 10)  + "px";
		}else{
			document.getElementById('tooltip_images').style.top  = (ypos - 300)  + "px";
		} 
		
		if(w >= xpos){
			document.getElementById('tooltip_images').style.left = (xpos + 50) + "px";
		}else{
			document.getElementById('tooltip_images').style.left = (xpos - 700) + "px";
		}
	
		
		document.getElementById('tooltip_images').style.visibility = "visible";
		document.getElementById('tool_img').src = id;
		document.getElementById('message').innerHTML = msg;
		
		
	}
	function hideimages(){
		document.getElementById('tooltip_images').style.visibility = "hidden";
	}		
	

// end tooltip





///////////////////////////////////