/*****************************************************
 File       : NewWindow.js
 Project    : kajames.com
 Author     : Kevin James
 Copyright (c) 2005, 2006 Kevin James, kajames.com
*****************************************************/

// Function to create new window icons beside links with the rel="external" attribute
function UpdateExternalLinks() {
   // Get all the links
   var arrLinks = document.getElementsByTagName("a");
   for (var i=0;i<arrLinks.length;i++) {
      if (arrLinks[i].rel == "external") {
         try {
            // Clear the rel attribute so we don't go into an infinite loop
            arrLinks[i].rel = "";
            
            // Clone the link
            var newWin = arrLinks[i].cloneNode(true);
            
            // Since we're going to insert the clone in front of the original, we actually want to change the original to the icon
            arrLinks[i].target = "_blank";
				//arrLinks[i].href = "javascript:window.open('" + arrLinks[i].href + "');";
            arrLinks[i].className = "LinkExternal";
            arrLinks[i].innerHTML = "<img class=\"ImgExternal\" src=\"/images/External.gif\" alt=\"Open " + newWin.innerHTML + " In Window\" title=\"Open " + newWin.innerHTML + " in a new window\" />";

            // Now insert the clone in front of the original link
            arrLinks[i].parentNode.insertBefore(newWin, arrLinks[i]);
         } catch (e) {
            // We won't do anything here, just ignore the error and continue
         }
      }
   }
}

function ClientLogin() {
	window.open("http://clients.kajames.ca/Login.php", "ClientLogin", "width=1000,height=750,toolbar=no,location=no,menubar=no,directories=no");
}