﻿/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})



// open links in new wiindow (used in place of depreciated target="_blank")
function externalLinks() {
  if (!document.getElementsByTagName && document.getElementById) return;

  var anchors = document.getElementsByTagName("a");

  for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
       anchor.target = "_blank";
 }
}
window.onload = externalLinks;


/*
// open external links in a specified page
$(document).ready(function(event) {
  //$('a[rel=external]').click(function(){return !window.open(this.href, 'exLink');});
  //$('a[rel=external]').attr('target','exLink');
  $('a[rel=external]').click(function(){
		pageTracker._trackPageview('/outgoing/'+ $(this).attr('href'));
		if (exWin.opened){ exWin.close() };
		exWin=window.open($(this).attr('href'),'exLink');
    exWin.focus();
    return false;
	});
});
*/

// containerRight section accordions
$(document).ready(function() {
  $('div.section> div').hide();  
  $('div.section> h4').click(function() {
    $(this).siblings().children().removeClass('activeSection');
    $(this).children(":first").toggleClass('activeSection');
    $(this).next('div').slideToggle('slow')
    .siblings('div:visible').slideUp('slow');
  });
});

// popup window
function popup(mylink, windowname) {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
        href=mylink;
    else
        href=mylink.href;
    w=window.open(href, windowname, 'width=980,height=720,scrollbars=yes');
    w.focus();
    return false;
}
