//Add urls regular expressions and your message(any HTML Code) to the array
var msgs = [
//null url : to show a message for direct traffic (no referer, some one who remember your site url!)
{'url':null,                           'msg':''}
//My url! : show message for referrals from your own site or null so you do not annoy them
,{'url':/^http:\/\/(\w+\.)?petergallagher\.com\.au/,    'msg':''}
,{'url':/^http:\/\/(\w+\.)?inquit\.com/,    'msg':''}
//,{'url':/^http:\/\/(\w+\.)?pwgimac.local/,    'msg':'Greetings <span style="color:#A7691A">Peter!</span> This seems to be working satisfactorily</strong>'}

//Other urls
,{'url':/^http:\/\/(\w+\.)?google\.com/,	'msg':'Greetings <span style="color:#A7691A">Googler</span>! I hope this is the information you are searching for. But if not, please try these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?search\.live\.com/,	'msg':'Greetings <span style="color:#A7691A">Live</span> searcher! I hope this is the information you are looking for. But if not, please try these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?search\.yahoo\.com/,	'msg':'Hi there! I hope <span style="color:#A7691A">Yahoo</span> has sent you to the right place. But if not, please try these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?search\.msn\.com/,	'msg':'Hi there! If you don\'t find what you were looking for at <span style="color:#A7691A">MSN</span> on this page, please try these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?blogotariat\.com/,	'msg':'G\'day! If by any chance <span style="color:#A7691A">Blogotariat</span> has sent you to the wrong place, you might like to take a squiz at these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?altavista\.com/,	'msg':'Hello <span style="color:#A7691A">Altavista</span> searcher. If you don\'t find what you need on this page, please try some of these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?ask\.com/,	'msg':'Greetings <span style="color:#A7691A">Ask-er</span>! If you don\'t find what you need on this page, please try some of these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?search\.aol\.com/,	'msg':'Greetings, <span style="color:#A7691A">AOL\-er</span>, if this post is not what you were looking for, please consider these possibly related posts'}
,{'url':/^http:\/\/(\w+\.)?virgilio\.it/,	'msg':'saluti ai miei amici di <span style="color:#A7691A">Virgilio</span>!'}
//generic pattern: to show generic message for referrers that you did not specify one for
//You must keep it at the end of the list as it will match any non empty referrer
//,{'url':/^http:\/\//,	'msg':'<span class="blue"><span style="color:#A7691A">Greetings</span> and welcome! If this post is not what you were looking for, please consider these</span>'}
];
function DetectReferrer(){
	var header = $("div.sidebar_a h4:first");
   //if Div was not placed means , not to show message
   //if (!div.length) return;
   var ref = document.referrer.toLowerCase();
   var msg = findMatch(ref);
   // if not null msg found
	if(msg) {
      //Add Close Button and Show up message
	jQuery.noticeAdd({
	                        text: msg,
	                        stay: true
	                });
      }
}
function findMatch(ref) {
   for(var i=0; i<msgs.length; i++)
      if( ( ref=='' && msgs[i].url==null) || (ref>'' && ref.match(msgs[i].url) ) )
         return msgs[i].msg;
   return null;
}

function MyAccordion(){
	$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();

	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
}


