// JavaScript Document
jQuery.noConflict();
var block;
var time;
var redclass=0;
var greenclass=0;

	function openBlock(id){
		block = document.getElementById(id);
		if(block.style.display = "none"){
			clearTimeout(time);
			time = setTimeout('showBlock()', 500);
		}
		else{
			return;
		}
	}
	function openBlockSp(id){
		block = document.getElementById(id);
		if(block.style.display = "none"){
			clearTimeout(time);
			block.style.display = "block";
			if(navigator.appName == "Microsoft Internet Explorer"){
				jQuery('.highlight').hide();
			}
		}
		else{
			return;
		}
	}
	function closeBlock(id){
		block = document.getElementById(id);
		if(block.style.display = "block"){
			clearTimeout(time);
			time = setTimeout('hideBlock()', 500);
		}
		else{
			block.style.display = "none";
			if(navigator.appName == "Microsoft Internet Explorer"){
				jQuery('.highlight').show(500);
			}
		}
	}	
	function closeBlockSp(id){
		block = document.getElementById(id);
		if(block.style.display = "block"){
			clearTimeout(time);
			block.style.display = "none";
			if(navigator.appName == "Microsoft Internet Explorer"){
				jQuery('.highlight').show();
			}
		}
		else{
			return;
		}
	}	
	function showBlock(){
		block.style.display = "block";
		if(navigator.appName == "Microsoft Internet Explorer"){
				jQuery('.highlight').css('display','none');
				jQuery('#gf_main').css('z-index','-1');
				jQuery('.tabbed-menu').css('z-index','-1');
			}
		
	}
	function hideBlock(){
		block.style.display = "none";
		if(navigator.appName == "Microsoft Internet Explorer"){
				jQuery('.highlight').css('display','block');
				jQuery('#gf_main').css('z-index','1');
				jQuery('.tabbed-menu').css('z-index','1');
			}
	}
	
function initMenu() {
jQuery('#menu ul').hide();
jQuery('#menu li.Selected ul').show();
jQuery('#menu li a').click(
function() {
 var checkElement = jQuery(this).next();
 if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
 jQuery('#menu ul:visible').parent().removeClass('Selected');
 jQuery('#menu ul:visible').slideUp('fast');
 
if(checkElement.parent().is('#lastOne'))
{
var LastLI = document.getElementById('lastOne');
LastLI.style.backgroundImage = "url(http://www.gittigidiyor.com/main/images/help/liLast_blue3.gif)"
checkElement.css("border-left","none");
checkElement.css("border-right","none");


var LastLIChild = LastLI.firstChild
	while(LastLI.childNodes.length)
	{
		if(LastLIChild.tagName == 'A')
		{
			LastLIChild.style.borderLeft = "none";
			LastLIChild.style.borderRight = "none";
			LastLI.removeChild(LastLI.lastChild);
			break;
		}
		LastLIChild = LastLIChild.nextSibling;
	}

}



 return false;
 }
 if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
 jQuery('#menu ul:visible').parent().removeClass('Selected');
 jQuery('#menu ul:visible').slideUp('fast');
 checkElement.slideDown('fast');
 checkElement.parent().addClass('Selected');
 
 var LastLI = document.getElementById('lastOne');
 var LastLIChild = LastLI.firstChild
	while(LastLI.childNodes.length)
	{
		if(LastLIChild.tagName == 'A')
		{
			LastLIChild.style.borderLeft = "none";
			LastLIChild.style.borderRight = "none";
			
				if(document.getElementById('lastOne').lastChild.tagName == "IMG")
				{
					document.getElementById('lastOne').removeChild(document.getElementById('lastOne').lastChild);
					document.getElementById('lastOne').style.backgroundImage = "url(http://www.gittigidiyor.com/main/images/help/liLast_blue3.gif)";
				}
			break;
		}
		LastLIChild = LastLIChild.nextSibling;
	}
 
 
if(checkElement.parent().is('#lastOne'))
{
LastLI.style.background = "url(http://www.gittigidiyor.com/main/images/help/accordion_menu_bg.gif) left top repeat-x";

checkElement.css("border-left","1px solid #ccc");
checkElement.css("border-right","1px solid #ccc");
checkElement.css("border-bottom","none");
checkElement.css("padding-bottom","0px");
//checkElement.css("background","url(http://www.gittigidiyor.com/main/images/help/liLast_blue3.gif) left bottom no-repeat");

LastLIChild = LastLI.firstChild
	while(LastLI.childNodes.length)
	{
		if(LastLIChild.tagName == 'A')
		{
			LastLIChild.style.borderLeft = "1px solid #A9CCDE";
			LastLIChild.style.borderRight = "1px solid #A9CCDE";
			
			var myElement = document.createElement('img');
			myElement.src = "http://www.gittigidiyor.com/main/images/help/liLast_blue2.gif";
			LastLI.appendChild(myElement); 
			
			break;
		}
		LastLIChild = LastLIChild.nextSibling;
	}

}
 
 return false;
 }
 }
 );
 }

function toggleHelpContent(){
 jQuery('.center-accordion a,.yellow-bullets a').click(
function(){
 jQuery(this).next().slideToggle('fast')

if(greenclass==1)
	 {jQuery(this).parent().toggleClass('SelectedGreen');}

if(redclass==1)
	 {jQuery(this).parent().toggleClass('SelectedRed');}
else{jQuery(this).parent().toggleClass('Selected');}
 
 });
 }
 function menuPreLoad(){
	var html = '<div style="display:none;"><img src="/main/images/category_box_bottom.gif" /><img src="/main/images/category_box_mid.gif" /><img src="/main/images/category_box_top.gif" /></div>';
	jQuery('#footerPreloadBox').html(html);
 }
 jQuery(document).ready(function() { initMenu();toggleHelpContent(); menuPreLoad();});