// x.js
// X v3.10, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003 Michael Foster (mike@cross-browser.com)
// This library is distributed under the terms of the LGPL (gnu.org)


		
if (Drupal.jsEnabled) { 
$(document).ready(function(){

//leftfunc();

//rightfunc();


//tabs();

//tabsgame();

$('div.nav2').hover(function(){
   $(this).css('color','blue'); //mouseover
},function(){

   $(this).css('color','red'); //mouseout

}); 

}); 
}

function tabsgame()
	{
$('div.firsttabgame').click(function(){

    var nid = $(this).attr("id");
	//alert(nid);
	$('div.secondtabgame').removeClass("secondtabgame").addClass("firsttabgame");
	//$(this).css({backgroundColor:"#D4DDC2"});
	$(this).removeClass("firsttabgame").addClass("secondtabgame");

		var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomerightbottomdata/" + nid;
						$.getJSON(url, function(json){

							
						$('div.buttonboxgame').html(json.both);  
						/*$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);*/
						$('div.imagboxgame').html(json.img);
						$('div.textpartrightgame').html(json.body);

						leftfunc();
						rightfunc();
						});
							 return false;
						}); 

 



$('div.secondtabgame').click(function(){

    var nid = $(this).attr("id");
	//alert(nid);
	$('div.firsttabgame').removeClass("firsttabgame").addClass("secondtabgame");
	//$(this).css({backgroundColor:"#FFFFFF"});
	$(this).removeClass("secondtabgame").addClass("firsttabgame");

	var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomerightbottomdata/" + nid;
						$.getJSON(url, function(json){

							
						$('div.buttonboxgame').html(json.both);  
						/*$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);*/
						$('div.imagboxgame').html(json.img);
						$('div.textpartrightgame').html(json.body);

						leftfunc();
						rightfunc();
						});
							 return false;
						}); 

 //tabsgame();
	}


function tabs()
	{
$('div.firsttab').click(function(){

    var nid = $(this).attr("id");
	//alert(nid);
	$('div.secondtab').removeClass("secondtab").addClass("firsttab");
	//$(this).css({backgroundColor:"#D4DDC2"});
	$(this).removeClass("firsttab").addClass("secondtab");

		var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomerighttopdata/" + nid;
						$.getJSON(url, function(json){

							
						$('div.buttonbox').html(json.both);  
						/*$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);*/
						$('div.imagbox').html(json.img);
						$('div.textpartright').html(json.body);

						leftfunc();
						rightfunc();
						});
							 return false;
						}); 

 



$('div.secondtab').click(function(){

    var nid = $(this).attr("id");
	//alert(nid);
	$('div.firsttab').removeClass("firsttab").addClass("secondtab");
	//$(this).css({backgroundColor:"#FFFFFF"});
	$(this).removeClass("secondtab").addClass("firsttab");

	var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomerighttopdata/" + nid;
						$.getJSON(url, function(json){

							
						$('div.buttonbox').html(json.both);  
						/*$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);*/
						$('div.imagbox').html(json.img);
						$('div.textpartright').html(json.body);

						leftfunc();
						rightfunc();
						});
							 return false;
						}); 

 //tabs();
	}


function leftfunc()
{
$('div.rightaero  > a').click(function(){
	//alert("hello");

	var nid = $(this).attr("id");
					var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomemiddlehomedata/" + nid;
						$.getJSON(url, function(json){

							
						$('div.buttondiv').html(json.both);  
						$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);
						$('div.middleimage').html(json.img);
						$('div.middleimagea').html(json.body);

						leftfunc();
						rightfunc();
						});
							 return false;
						}); 

}

function rightfunc()
{

	$('div.leftaero  > a').click(function(){
	//alert("hello");

	var nid = $(this).attr("id");
					var base =  window.location.hostname;
					var url = "http://" + base + "/portalgray/gethomemiddlehomedata/" + nid;
						$.getJSON(url, function(json){


						$('div.buttondiv').html(json.both); 				  
						$('div.leftaero').html(json.prev);
						$('div.rightaero').html(json.next);
						$('div.middleimage').html(json.img);
						$('div.middleimagea').html(json.body);


leftfunc();
						rightfunc();
						});
							 return false;
						}); 




}


