
function MarkSelectedTab() {
	//mark selected tab
	var rootURL = "writezilla.org";
	var thisLocation = location.href;
	var thisTabElement;
	
	//front end
	if(thisLocation.indexOf(rootURL +"/default.aspx") > 0 || thisLocation == "http://"+ rootURL +"/" || thisLocation == "http://www."+ rootURL +"/") {
		thisTabElement = document.$("tmpl_tab_home");
	}
	else if(thisLocation.indexOf(rootURL +"/contact_us.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_contactus");
	}
	else if(thisLocation.indexOf(rootURL +"/login.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_login");
	}
	//back end
	else if(thisLocation.indexOf(rootURL +"/admin/default.aspx") > 0 || thisLocation == "http://"+ rootURL +"/admin/") {
		thisTabElement = document.$("tmpl_tab_home");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/master/") > 0) {
		thisTabElement = document.$("tmpl_tab_master");
	}
	
	//account
	else if(
		thisLocation.indexOf(rootURL +"/account/default.aspx") > 0 || 
		thisLocation == "http://www."+ rootURL +"/account/" || 
		thisLocation.indexOf(rootURL +"/account/article.aspx") > 0
	) {
		thisTabElement = document.$("tmpl_tab_myaccount");
	}
	else if(thisLocation.indexOf(rootURL +"/account/search.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_search");
	}
	else if(thisLocation.indexOf(rootURL +"/account/my_interests.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_interests");
	}
	else if(thisLocation.indexOf(rootURL +"/account/reports.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_reports");
	}
	else if(thisLocation.indexOf(rootURL +"/account/tutorial.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_tutorial");
	}
	else if(thisLocation.indexOf(rootURL +"/account/grammar_guide/") > 0) {
		thisTabElement = document.$("tmpl_tab_grammarguide");
	}
	
	
	//select the tab
	if(thisTabElement) thisTabElement.className = "selected";
}




function SelectLCItem() {
	var rootURL = "writezilla.org";
	var thisLocation = location.href;
	
	var thisItemElement;
	
	if(thisLocation == "http://"+ rootURL +"/account/tutorial.aspx" || thisLocation == "http://www."+ rootURL +"/account/tutorial.aspx") {
		thisItemElement = document.$("overview");
	}
	else if(thisLocation.indexOf("?r=basics") > 0) {
		thisItemElement = document.$("basics");
	}
	else if(thisLocation.indexOf("?r=research") > 0) {
		thisItemElement = document.$("research");
	}
	else if(thisLocation.indexOf("?r=writing") > 0) {
		thisItemElement = document.$("writing");
	}
	else if(thisLocation.indexOf("?r=structure") > 0) {
		thisItemElement = document.$("structure");
	}
	else if(thisLocation.indexOf("?r=plagiarism") > 0) {
		thisItemElement = document.$("plagiarism");
	}
	
	//samples
	else if(thisLocation.indexOf("?r=sample_technology") > 0) {
		thisItemElement = document.$("s_technology");
	}
	else if(thisLocation.indexOf("?r=sample_news") > 0) {
		thisItemElement = document.$("s_news");
	}
	else if(thisLocation.indexOf("?r=sample_sports") > 0) {
		thisItemElement = document.$("s_sports");
	}
	else if(thisLocation.indexOf("?r=sample_health") > 0) {
		thisItemElement = document.$("s_health");
	}
	else if(thisLocation.indexOf("?r=sample_music") > 0) {
		thisItemElement = document.$("s_music");
	}
	else if(thisLocation.indexOf("?r=sample_travel") > 0) {
		thisItemElement = document.$("s_travel");
	}
	
	//grammar guide
		else if(thisLocation.indexOf("gs_sentance_fragements") > 0) {
			thisItemElement = document.$("gs_sentance_fragements");
		}
		
		else if(thisLocation.indexOf("gs_comma_splices_fused_sentences") > 0) {
			thisItemElement = document.$("gs_comma_splices_fused_sentences");
		}
		else if(thisLocation.indexOf("gs_verbs") > 0) {
			thisItemElement = document.$("gs_verbs");
		}
		else if(thisLocation.indexOf("gs_subject_verb_agreement") > 0) {
			thisItemElement = document.$("gs_subject_verb_agreement");
		}
		else if(thisLocation.indexOf("gs_pronoun_case") > 0) {
			thisItemElement = document.$("gs_pronoun_case");
		}
		else if(thisLocation.indexOf("gs_pronoun_reference") > 0) {
			thisItemElement = document.$("gs_pronoun_reference");
		}
		else if(thisLocation.indexOf("gs_pronoun_antecedent_agreement") > 0) {
			thisItemElement = document.$("gs_pronoun_antecedent_agreement");
		}
		else if(thisLocation.indexOf("gs_adjectives_adverbs") > 0) {
			thisItemElement = document.$("gs_adjectives_adverbs");
		}
		else if(thisLocation.indexOf("gs_shifts") > 0) {
			thisItemElement = document.$("gs_shifts");
		}
		else if(thisLocation.indexOf("es_misplaced_dangling_modifiers") > 0) {
			thisItemElement = document.$("es_misplaced_dangling_modifiers");
		}
		else if(thisLocation.indexOf("es_incomplete_sentences") > 0) {
			thisItemElement = document.$("es_incomplete_sentences");
		}
		else if(thisLocation.indexOf("es_mixed_constructions_faulty_predication") > 0) {
			thisItemElement = document.$("es_mixed_constructions_faulty_predication");
		}
		else if(thisLocation.indexOf("es_parallel_structure") > 0) {
			thisItemElement = document.$("es_parallel_structure");
		}
		else if(thisLocation.indexOf("es_coordination_subordination") > 0) {
			thisItemElement = document.$("es_coordination_subordination");
		}
		else if(thisLocation.indexOf("es_sentence_variety") > 0) {
			thisItemElement = document.$("es_sentence_variety");
		}
		else if(thisLocation.indexOf("wc_appropriateness") > 0) {
			thisItemElement = document.$("wc_appropriateness");
		}
		else if(thisLocation.indexOf("wc_exact_words") > 0) {
			thisItemElement = document.$("wc_exact_words");
		}
		else if(thisLocation.indexOf("wc_bias_free_language") > 0) {
			thisItemElement = document.$("wc_bias_free_language");
		}
		else if(thisLocation.indexOf("wc_wordiness") > 0) {
			thisItemElement = document.$("wc_wordiness");
		}
		else if(thisLocation.indexOf("pu_end_punctuation") > 0) {
			thisItemElement = document.$("pu_end_punctuation");
		}
		else if(thisLocation.indexOf("pu_the_comma") > 0) {
			thisItemElement = document.$("pu_the_comma");
		}
		else if(thisLocation.indexOf("pu_the_semicolon") > 0) {
			thisItemElement = document.$("pu_the_semicolon");
		}
		else if(thisLocation.indexOf("pu_the_colon") > 0) {
			thisItemElement = document.$("pu_the_colon");
		}
		else if(thisLocation.indexOf("pu_the_apostrophe") > 0) {
			thisItemElement = document.$("pu_the_apostrophe");
		}
		else if(thisLocation.indexOf("pu_quotation_marks") > 0) {
			thisItemElement = document.$("pu_quotation_marks");
		}
		else if(thisLocation.indexOf("pu_the_dash") > 0) {
			thisItemElement = document.$("pu_the_dash");
		}
		else if(thisLocation.indexOf("pu_parentheses_brackes_ellipsis") > 0) {
			thisItemElement = document.$("pu_parentheses_brackes_ellipsis");
		}
		else if(thisLocation.indexOf("me_abbreviations") > 0) {
			thisItemElement = document.$("me_abbreviations");
		}
		else if(thisLocation.indexOf("me_capitol_letters") > 0) {
			thisItemElement = document.$("me_capitol_letters");
		}
		else if(thisLocation.indexOf("me_numbers") > 0) {
			thisItemElement = document.$("me_numbers");
		}
		else if(thisLocation.indexOf("me_italics") > 0) {
			thisItemElement = document.$("me_italics");
		}
		else if(thisLocation.indexOf("me_the_hyphen") > 0) {
			thisItemElement = document.$("me_the_hyphen");
		}
		else if(thisLocation.indexOf("me_spelling") > 0) {
			thisItemElement = document.$("me_spelling");
		}
	//end grammar guide
	
	//select the item
	if(thisItemElement) thisItemElement.className = "selected";
}
