//function helpTab() {
//		$('top10_data_frame').show(); 
//		$('search_frame').hide();
//		$('tab_top10').className = 'off';
//		$('tab_search').className = 'on';
//}
//function faqTab() {
//		
//			$('search_frame').show(); 
//			$('top10_data_frame').hide();
//			$('tab_search').className = 'off'; 
//			$('tab_top10').className = 'on'; 
//}

function toggleHelpFaq(t,q,h){
			var lid = document.getElementById(t);
			var faqID = document.getElementById(q);
			var box = document.getElementById(h);
			
			if (faqID.style.display == "block"){
				lid.className="q-close";
				box.className="q-div-c";
				faqID.style.display = "none";
			}
			else if(faqID.style.display = "none"){
				lid.className="q-open";
				box.className="q-div-o";
				faqID.style.display = "block";
				var num = q.substring(1);
				if (!tm_omni_temp.get(q)){
					tm_omni_temp.set(q, '1');
					omniTracking.navigation_link('helpFAQ' + num, false);
				}
			} 
		
		}

// Below is the script that generates the left navigation

var thisServer = window.location.protocol + "//" + window.location.host + "/h/";

var myLN = new Array(	"Shipping, Delivery and Returns",//Title of the module	
					 	"Print Tickets",
						"Orders Placed Prior to June 14th",
						"Delivery Options",
						"Return Policy",
						"Cancelled/Postponed Events"
					);

var myLNLink = new Array (
						  "https://www.livenation.com/member/order_history?tm_link=help_nav_1_print",
						  thisServer + "previous_orders.html?tm_link=help_nav_1_june14",
						  thisServer + "delivery.html?tm_link=help_nav_1_shipping",
						  thisServer + "returns.html?tm_link=help_nav_1_returns",
						  thisServer + "cancelled.html?tm_link=help_nav_1_cancelled"
						  );
						  
var usingAcct = new Array(
						  "Using Your Account",//Title of the module
						  "View Order History",
						  "Forgot Your Password?",
						  "Edit Profile",
						  //"Edit Preferences",
						  "Edit Billing Information"
							  );

var usingAcctLink = new Array (
						   "https://www.livenation.com/member/order_history?tm_link=help_nav_2_orders",
						   "https://www.livenation.com/member/login?tm_link=help_nav_2_password",
						   thisServer + "manage.html?tm_link=help_nav_2_account",
						   //"https://www.livenation.com/member/edit_subscriptions?tm_link=help_nav_2_preferences",
						   "https://www.livenation.com/member/edit_billing?tm_link=help_nav_2_billing"
								   );

var buyingTix = new Array (
						   "Buying Tickets",
						   "Order Online",
						   "Order by Phone",
						   "Ticketmaster Retail Outlets",
						   "Accessible Seating",
						   "Ticket FAQ's",
						   "Ticket Tips"
						   );

var buyingTixLink = new Array (
						   thisServer + "orderonline.html?tm_link=help_nav_3_online",
						   thisServer + "orderbyphone.html?tm_link=help_nav_3_phone",
						   thisServer + "retaillocations.html?tm_link=help_nav_3_retail",
						   thisServer + "a_seating.html?tm_link=help_nav_3_seating",
						   thisServer + "faq.html?tm_link=help_nav_3_faqs",
						   thisServer + "help_tips.html?tm_link=help_nav_3_tips"
						   );

var customerService = new Array(
							"We're Here To Help",//Title of the module
							"Top 10 FAQs",
							"Read All FAQs",
							"Contact Us",
							"Live Chat",
							"Lost or Destroyed Tickets",
							"Correcting Your Order",
							"Closing Your Account"
								);

var customerServiceLink = new Array(
							thisServer + "help.html?tm_link=help_nav_4_top10",
							thisServer + "faqs.html?tm_link=help_nav_4_allfaqs",
							thisServer + "customer_serve.html?tm_link=help_nav_4_contact",
							"javascript:liveChatWindow('http://ticketmasterus.custhelp.com/app/utils/chat');",
							thisServer + "lost_tix.html?tm_link=help_nav_4_lost",
							thisServer + "correcting.html?tm_link=help_nav_4_correcting",
							thisServer + "closeaccount.html?tm_link=help_nav_4_close"
									);

var policiesAndSecurity = new Array(
							  "Policies and Security",//Title of the module
							  "Privacy Policy",
							  "Purchase Policy",
							  "Terms and Conditions"
							 	 );

var policiesAndSecurityLink = new Array (
							   thisServer + "privacy.html?tm_link=help_nav_5_privacy",
							   thisServer + "purchase.html?tm_link=help_nav_5_purchase",
							   thisServer + "terms.html?tm_link=help_nav_5_terms"
								   );

var aboutUs = new Array(
							  "Who We Are",//Title of the module
							  "About Live Nation",
							  "Our Fan Guarantee",
							  "Ticketmaster Blog",
							  "Across the Globe",
							  "Careers",
							  "Advertise With Us",
							  "Sponsorship Opportunities",
							  "Social Networks",
							  "Investor Relations"
							  //"Developers"
						);

var aboutUsLink = new Array (
							   thisServer + "about_us.html?tm_link=help_nav_6_about",
							   "http://www.livenation.com/ourguarantee?tm_link=help_nav_6_guarantee",
							   "http://blog.ticketmaster.com/?tm_link=help_nav_6_ticketology",
							   "http://www.livenationinternational.com?tm_link=help_nav_6_international",
							   "http://www.livenation.com/careers/index.html?tm_link=help_nav_6_careers",
							   "http://www.livenation.com/advertise/?tm_link=help_nav_6_advertise",
							   "http://promo.livenation.com/sponsorship/?tm_link=help_nav_6_sponsorship",
							   "http://promo-img.livenation.com/lnus/social-networks?tm_link=help_nav_6_social",
							   "http://www.livenation.com/investors?tm_link=help_nav_6_investor"
							   //"http://developers.livenation.com/index.html?tm_link=help_nav_6_developers"
								   );


//To write out the entire left navigation
function createLeftNav(){
	writeLid(myLN[0]);
	showModule(myLN,myLNLink);
	writeLid(usingAcct[0]);
	showModule(usingAcct, usingAcctLink);
	writeLid(buyingTix[0]);
	showModule(buyingTix, buyingTixLink);
	writeLid(customerService[0]);
	showModule(customerService,customerServiceLink);
	writeLid(policiesAndSecurity[0]);
	showModule(policiesAndSecurity,policiesAndSecurityLink);
	writeLid(aboutUs[0]);
	showModule(aboutUs,aboutUsLink);
	//writeLid(workWithUs[0]);
	//showModule(workWithUs,workWithUsLink);
}

//define module title
function writeLid(title) {
	var title;
	document.write("<div class=\"lid-nav\"><h1 class=\"h4\">");
	document.write( title +"</h1></div>");
}

//Find current page
var theURL = window.location.pathname.split('/');
var thePage = theURL.last();

//write out the links within a module
function showModule(leftNavArray, navLink) {
	document.write("<div class=\"container-nav\">");
		
			for (var counter=1,counter2=0; counter< leftNavArray.length,counter2<navLink.length; counter ++,counter2++){
						if ( navLink[counter2].match(thePage) ){
							document.write("<a class=\"on\" href=\"");
						} else {
							document.write("<a href=\"");
						}					
						document.write(navLink[counter2]); 					
						document.write("\" title=\"" + leftNavArray[counter] + "\" >" + leftNavArray[counter]);
						document.write("</a>");
						
			}
	document.write("</div>");
		
}

// Open a new window
function liveChatWindow(url) {
 omniTracking.navigation_link('help_nav_4_chat',false);
 popUpWin = window.open(url,'chatWindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=640,height=640' );
 if (navigator.appName == 'Netscape') {
 popUpWin.focus();
 }
} 

// EASIER Toggle FAQ
function easyToggleFaq(faq_num){
  if(faq_num > 1 && faq_num < 11){
    faq_num = faq_num -1;
    var q = "q"+ faq_num;
    var a = "a"+ faq_num;
    var b = "b"+ faq_num;
    toggleHelpFaq(q,a,b);
  }
  else if(faq_num == 1){
    toggleHelpFaq("q10","a10","b10");
  }
  
}

function helpInit() {
  var s = getQry("faq");
  if(s != ""){
    easyToggleFaq(s)
  }
}

window.onload = helpInit;

