﻿//------------------------------------------------------------------------------
// <copyright company="DotArrow">
//  The contents of this file are subject to the DotShoppingCart Commercial LICENSE AGREEMENT 1.0 ("License"); you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at http://www.dotshoppingcart.com/Page/DotShoppingCart%20Commercial%20LICENSE.aspx.
// </copyright>
//------------------------------------------------------------------------------

function OpenNewPopupWindow(url, width, height) {
    window.open(url, '_blank', 'toolbar=no, location=yes, directories=no, status=no, menubar=no, copyhistory=yes, width=' + width + ', height=' + height);
}

function OpenResizablePopupWindow(url, width, height) {
    window.open(url, '_blank', 'toolbar=no, location=yes, directories=no, status=no, menubar=no, copyhistory=yes, scrollbars=yes, resizable=yes, width=' + width + ', height=' + height);
}

function loadjscssfile(filename, filetype){
    if (filetype=="js"){ //if filename is a external JavaScript file
        var fileref=document.createElement('script')
        fileref.setAttribute("type","text/javascript")
        fileref.setAttribute("src", filename)
    }
    else if (filetype=="css"){ //if filename is an external CSS file
        var fileref=document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("href", filename)
    }
    if (typeof fileref!="undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref)
}

//check if the next sibling node is an element node
function get_nextsibling(n) {
    x = n.nextSibling;
    while (x.nodeType != 1) {
        x = x.nextSibling;
    }
    return x;
}

