﻿//This script is to update the H1 of a ukpokerbuddies page with an icon of the section that is it in.
//So we need to check the page
//And then alter the CSS

//First check page to determine which image to display
var imgH1;
var blnFoundPage = false;
var strDomain = "http://drupal5b.ukpokerbuddies.com/";

//Find Buddies and Poker Groups
if (location.href == strDomain+"og" || location.href == strDomain+"user/map" || location.href == strDomain+"og/my" || location.href == strDomain+"og/activity" || location.href == strDomain+"invite") {
    imgH1 = "find-buddies-chip.jpg";
    blnFoundPage = true;
};
//My Poker Pages
if (location.href == strDomain+"user") {
    imgH1 = "notes.jpg";
    blnFoundPage = true;
};
//Live Poker Games & Tournaments
if (location.href == strDomain+"event" || location.href == strDomain+"node/add/event" || location.href == strDomain+"casinos/map" || location.href == strDomain+"node/add/pokerroom" || location.href == strDomain+"blog/657") {
    imgH1 = "livegames-add.jpg";
    blnFoundPage = true;
};
//Poker News & Guides
if (location.href == strDomain+"guide/ask-a-poker-professional" || location.href == strDomain+"blog" || location.href == strDomain+"guide/howtoplay" || location.href == strDomain+"aggregator/categories/2") {
    imgH1 = "pokerplayersguide.jpg";
    blnFoundPage = true;
};

//now alter the CSS
if (blnFoundPage == true){
    document.write ("<style type=\"text/css\">H1.pageTitle {background-image: url(/images/"+imgH1+");background-repeat: no-repeat;height: 70px;text-indent: 70px;}</style>");
};
