// JavaScript Document

///*********** JQuery Action ***********///
///******* STYLESHEET SWITCHING ***********///
(function($)
{
	$(document).ready(function() {
		$('.styleswitch').click(function()
		{
			switchStylestyle(this.getAttribute("rel"));
			return false;
		});
		var c = readCookie('style');
		if (c) switchStylestyle(c);
	});

	function switchStylestyle(styleName)
	{
		$('link[@rel*=style][title]').each(function(i) 
		{
			this.disabled = true;
			if (this.getAttribute('title') == styleName) this.disabled = false;
		});
		createCookie('style', styleName, 365);
	}
})(jQuery);
// cookie functions http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name)
{
	createCookie(name,"",-1);
}


///******** JS TO AS CONNECTOR *********///
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window['ie_'+movieName] : document['ff_'+movieName];
}

function callToAS(str) 
{
	
	getFlashMovie("flashReader").sendToAS(str);
}

function sendToJS(val)
{
	document.getElementById('boxX').value = "ROM";
	document.getElementById('boxX').value = val;
}

///******** KEYPRESS DETECTOR *********///

//process this function whenever a key is pressed
$(document).keypress(function (e) {

	//a & A
	if (e.keyCode == 65 || e.charCode == 65 || e.keyCode == 97 || e.charCode == 97){
		callToAS('all.0000');
	}

	//H & h
	if (e.keyCode == 104 || e.charCode == 104 || e.keyCode == 72 || e.charCode == 72){
		callToAS('hl.0000');
	}
	

});

///******** EXPANDING DIV CONTAINER *********////*


$(document).ready(function() {})
function resizeDiv(adjustment){
	//document.getElementById('descx').innerHTML='Testing1';
	var browser = navigator.appName;
	var b_ver = navigator.appVersion;
	var $content_h = jQuery('.content_area_holder').height();
	
	var $home_content_h = $content_h;
	var $outer_h = $content_h + 20 + adjustment;
	if(browser == "Microsoft Internet Explorer"){
		jQuery('#content').height($outer_h);
		jQuery('#outer_wrap').height($outer_h);
		jQuery('#inner_wrap').height($outer_h);
		jQuery('#flash_circle_innerpg').height($outer_h);

	}else{
		jQuery('#content').height($outer_h);
		jQuery('#outer_wrap').height($outer_h);
		jQuery('#inner_wrap').height($outer_h);
		jQuery('#flash_circle_innerpg').height($outer_h);

	}

}

function prax(){
	document.write("HELLO");
}

