﻿// JScript File


function styleCells(table) 
{
    if(document.getElementsByTagName){ 
    
        //load table from page into variable
        var tbl = document.getElementById(table);
        
        //load cells from table into array
        var cells = tbl.getElementsByTagName("td");
        
        //loop through array, set cells with even # index to 
        //css class "left," odd to css class "right."
        for (i=0; i<cells.length; i++) {
            if(i % 2 == 0){
               cells[i].className = "left";
             }else{
               cells[i].className = "right";
             }    
        }
    }
}  


function delayer(page){
    window.location.href = "http://www.techknowsolve.com/" + page + ".php";
}


//Enable pages to open in new window
function externalLinks() 
{
    if (!document.getElementsByTagName) return;
    
    //load anchors from page into array
        var anchors = document.getElementsByTagName("a");
        
        //loop through array - if anchor is hyperlink and ref = external, 
        //set hyperlink target to blank (open in new window)
        for (var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
            anchor.target = "_blank";
    }
}
//call function when window loads
window.onload = externalLinks;


