

/* LOCAL
var pathRoot = 'http://localhost/AutomotiveFleet';
*/
/* TEST
var pathRoot = 'http://test.automotive-fleet.com';
*/
/* SERVER */
var pathRoot = 'http://www.automotive-fleet.com';

var axel = Math.random() + "";
var ord = axel * 1000000000000000000;

/*************************************************************************
This code is from Dynamic Web Coding at www.dyn-web.com
Copyright 2001-4 by Sharon Paine 
See Terms of Use at www.dyn-web.com/bus/terms.html
regarding conditions under which you may use this code.
This notice must be retained in the code as is!
*************************************************************************/
//function initScrollLayer() {
//// Channel Tabs
//  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
//  // if horizontal scrolling, id of element containing scrolling content (table?)
//  var wndo1 = new dw_scrollObj('wn1', 'lyr1', 't1');
//  // pass id('s) of scroll area(s) if inside table(s)
//  dw_scrollObj.GeckoTableBugFix('wn1'); 
//// Channel Box
//  var wndo2 = new dw_scrollObj('wn2', 'lyr2', 'imgTbl');
//  dw_scrollObj.GeckoTableBugFix('wn2'); 
//}

function PopUpWindow(page, window_name, window_width, window_height, window_features) {
    window_features = window_features + ", width=" + window_width + ", height=" + window_height;
    //document.CtrlWindow.close;
    OpenWin = window.open(page, window_name, window_features);
}

function PrintPopUp(page) {
    PopUpWindow(page, 'Print', 700, 600, 'toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
}

function NotePopUp(page) {
    PopUpWindow(page, 'Note', 600, 450, 'toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
}

function ChannelToolsPopUp(page) {
    PopUpWindow(page, 'ChannelTool', 800, 620, 'toolbar=yes,menubar=yes,location=no,scrollbars=no,resizable=no');
}

function ArticleImageViewer(image, title) {
    PopUpWindow(pathRoot + '/Article/ImageViewer.aspx?title=' + title + '&image=' + image, 'ArticleImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function NewsImageViewer(image, title) {
    PopUpWindow(pathRoot + '/News/ImageViewer.aspx?title=' + title + '&image=' + image, 'NewsImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function ProductImageViewer(image, title) {
    PopUpWindow(pathRoot + '/Product/ImageViewer.aspx?title=' + title + '&image=' + image, 'ProductImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function photoGalleryImageViewer(image, title) {
    PopUpWindow(pathRoot + '/photoGallery/ImageViewer.aspx?title=' + title + '&image=' + image, 'photoGalleryImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function FeaturedCompanyImageViewer(image, title) {
    PopUpWindow(pathRoot + '/Channel/FeaturedCompany/ImageViewer.aspx?title=' + title + '&image=' + image, 'FeaturedCompanyImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function BlogPostImageViewer(image, title) {
    PopUpWindow(pathRoot + '/Blog/ImageViewer.aspx?title=' + title + '&image=' + image, 'BlogImage', 950, 650, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function OpenPageFromPopUp(URL) {
    if (window.opener && !window.opener.closed) {
        window.opener.location = URL;
        window.close();
    }
    else {
        window.open(URL);
        window.close();
    }
    window.open(URL);
}

function BookmarkPage(pageName, url) {
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(pageName, url, '');
    } else if (window.external) { // IE Favorite
        window.external.AddFavorite(url, pageName);
    }
    else if (window.opera && window.print) { // Opera Hotlist
        return true;
    }
    else {
        alert("Sorry! Your browser doesn't support this function.");
    }
}