/***********************************************************/
/*

AUTHOR: LOSERGEEKDESIGN NEW MEDIA
CLIENT: TEAM LETHAL - CS GAMING COMMUNITY
DATE: JANUARY 2007

THIS DOCUMENT CONTAINS CODING THAT IS THE SOLE PROPERTY OF
THIS SITE AND ITS OWNERS. USE OF ANY OF THE CODE CONTAINED
IN THIS DOCUMENT IS EXPRESSLY PROHIBITED WITHOUT PRIOR
CONSENT

*/
/***********************************************************/

/***********************************************************/
/***********************************************************/
//-- UNEDITABLE CODE -- START
/***********************************************************/
/***********************************************************/

//Javascript Checking
var noJSMessage = "This site requires javascript to be enabled on your browser. You cannot view this site without Javascript enabled.";
if(!navigator.javaEnabled()) {
	//alert(noJSMessage);
}

	
//Browser and Platform Detection
var navBroInfo = [];
navBroInfo[0] = navigator.appCodeName;
navBroInfo[1] = navigator.appName;
navBroInfo[2] = navigator.appVersion;
navBroInfo[3] = navigator.platform;
/*
if(navigator.appName == "Microsoft Internet Explorer") {
	//kkkkalert("You are using Internet Explorer to view this website. This site is designed for standards complient brows");
	document.write('<link href="http://www.teamlethal-cs.com/newsite/required/stylesheets/ns.css" rel="stylesheet" type="text/css"/>');
}
if(navigator.appName != "Microsoft Internet Explorer")  {
	document.write('<link href="http://www.teamlethal-cs.com/newsite/required/stylesheets/ns.css" rel="stylesheet" type="text/css"/>');
}
*/

//Grab The Most Recent Macromedia Flash Player
function flashGrab() {
	window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
}

//Grab The Most Recent Macromedia Flash Player
function mozGrab() {
	window.location = "http://www.mozilla.com/en-US/firefox/";
}

//Image swapping function
function imgMOControl(imageName, newSrc) {
	document.images[imageName].src = newSrc
}

//Cafepress Launch
function goCafePress() {
	window.open("http://www.cafepress.com/");
}

//Server Display
function dispServer(toWhat){
	switch(toWhat){
		case 'cod4':
			document.getElementById('cod4Details').style.display = "block";
			document.getElementById('tf2Details').style.display = "none";
			document.getElementById('cssDetails').style.display = "none";
			break;
		case 'tf2':
			document.getElementById('cod4Details').style.display = "none";
			document.getElementById('tf2Details').style.display = "block";
			document.getElementById('cssDetails').style.display = "none";
			break;
		case 'css':
			document.getElementById('cod4Details').style.display = "none";
			document.getElementById('tf2Details').style.display = "none";
			document.getElementById('cssDetails').style.display = "block";
			break;
	}
}

// Main Menu Image Movement
function changeMMImg(who,whichState){
	switch(whichState){
		case 'over':
			
			break;
		case 'static':
			
			break;
	}
}


/***********************************************************/
/***********************************************************/
//-- UNEDITABLE CODE -- STOP
/***********************************************************/
/***********************************************************/


/******************************************************************/
/* MCP PAGE SCRIPTING - START
/******************************************************************/
//Member Control Panel - Email Tab	
//Replacing images on rollover
function emailtabov() {
	document.button['emailgo'].src="images/mcp/emailtab/go_o.jpg"
}

function emailtabst() {
	document.button['emailgo'].src="images/mcp/emailtab/go_s.jpg"
}
/******************************************************************/
/* MCP PAGE SCRIPTING - STOP
/******************************************************************/


/******************************************************************/
/* SPLASH PAGE SCRIPTING - START
/******************************************************************/
function check() {
	if(siteOpen) {
		var closeMe = document.getElementById("closed");
		closeMe.innerHTML = "";
		closeMe.style.visibility = "hidden";
	}
	if(!siteOpen) {
		var closeMe = document.getElementById("open");
		closeMe.innerHTML = "";
		closeMe.style.visibility = "hidden";
	}
}

// Send users to the site immediatly
function siteJump() {
	window.location = "http://www.teamlethal-cs.com/home.php";
}

// Send users to the forum immediatly
function forumJump() {
	window.location = "http://www.teamlethal-cs.com/newforum";
}

function moController(state,targetDiv) {
	//alert(targetDiv);
	switch (state) {
		case 0:
			document.getElementById(targetDiv).style.visibility = "hidden";
			break;
		case 1:
			document.getElementById(targetDiv).style.visibility = "visible";
			break;
	}
}
/******************************************************************/
/* SPLASH PAGE SCRIPTING - STOP
/******************************************************************/


/******************************************************************/
/* MEMBERS PAGE SCRIPTING - START
/******************************************************************/
var currView = null; // Currently viewed profile

function showProfile(frameid) {
	//alert(frameid+"\n"+document.getElementById(frameid).style.display);
	if(currView != null){currView.style.display = "none";}
	var i = document.getElementById(frameid);
	i.style.display = "inline";
	currView = i;
	//alert(i.style.display);
}

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
//loads popup only if it is disabled
if(popupStatus==0){
$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#memberPopup").fadeIn("slow");
popupStatus = 1;
}
}
//disabling popup with jQuery magic!
function disablePopup(){
//disables popup only if it is enabled
if(popupStatus==1){
$("#backgroundPopup").fadeOut("slow");
$("#memberPopup").fadeOut("slow");
popupStatus = 0;
}
}
//centering popup
function centerPopup(){
//request data for centering
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#memberPopup").height();
var popupWidth = $("#memberPopup").width();
//centering
$("#memberPopup").css({
	"position": "absolute",
	"top": 0,
	"left": 0
});
//only need force for IE6

$("#backgroundPopup").css({
	"height": windowHeight
});

}

$(document).ready(function(){
	//LOADING POPUP
	//Click the button event!
	$("#button").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopup();
	});
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
		disablePopup();
		}
	});

});

/******************************************************************/
/* MEMBERS PAGE SCRIPTING - STOP
/******************************************************************/


/******************************************************************/
/* FLASH EMBED SCRIPTING - START
/******************************************************************/
var flashvars = {};
var params = { wmode: "transparent" };
var attributes = {};
swfobject.embedSWF("header.swf", "flashHeader", "800", "76", "9.0.0", "required/js/expressInstall.swf", flashvars, params, attributes);

/******************************************************************/
/* FLASH EMBED SCRIPTING - STOP
/******************************************************************/


/******************************************************************/
/* MEMBERS PAGE SCRIPTING - STOP
/******************************************************************/


/******************************************************************/
/* NEW FEED - WORDPRESS - SCRIPTING - START
/******************************************************************/
function get_rss_feed() {
	//clear the content in the div for the next feed.
	//use the JQuery get to grab the URL from the selected item, put the results in to an argument for parsing in the inline function called when the feed retrieval is complete
	$.get('required/proxy.php?url=http://manage.teamlethal-cs.com/?feed=rss2', function(d) {
		//find each 'item' in the file and parse it
		$(d).find('item').each(function() {
 
			//name the current found item this for this particular loop run
			var newsitem = $(this);
			// grab the post title
			var title = newsitem.find('title').eq(0).text();
			// grab the author
			var author = newsitem.find('[nodeName=dc:creator]').eq(0).text();
			// next, the description
			var content = newsitem.find('[nodeName=content:encoded]').eq(0).text();
			//don't forget the pubdate
			var pubDate = newsitem.find('pubDate').eq(0).text();
 
			// now create a var 'html' to store the markup we're using to output the feed to the browser window
			var html = "<div class='newsheader'><span class='thesub'>" + title + "</span> posted by " +author + " on " +pubDate+ "</div><div class='newspost'>" + content + "</div><div class='newsfooter'></div><div class='news_spacer'></div>";
			//put that feed content on the screen!
			$('.newsFeed').append($(html)).hide().fadeIn(1000);  
		});
		$(".newsFeed .loading").fadeOut(500).remove();
	});
 
};

/******************************************************************/
/* NEW FEED - WORDPRESS - SCRIPTING - STOP
/******************************************************************/
