Ext.BLANK_IMAGE_URL = '/libs/ext/resources/images/default/s.gif';
var hideInterval = 0;
var activeButton = 0;
Ext.onReady(function(){
    // Third Level Menus
    var productsSDMenu = new Ext.menu.Menu({
        id: 'productsSDMenu',
        cls: 'thrd_lvl_menu',
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        },
        items: [{
            id: 'sd_full_description',
            activeClass: 'menu_item_active',
            text: 'FULL DESCRIPTION',
            handler: onItemClick,
            link: '/page/pr_description'
        }, {
            id: 'sd_at_a_glance',
            activeClass: 'menu_item_active',
            text: 'AT A GLANCE',
            handler: onItemClick,
            link: '/page/sqldetective_at_a_glance'
        }, {
            id: 'sd_kits_at_a_glance',
            activeClass: 'menu_item_active',
            text: 'KITS AT A GLANCE',
            handler: onItemClick,
            link: '/page/kits_at_a_glance'
        }, {
            id: 'sd_screenshots',
            activeClass: 'menu_item_active',
            text: 'SCREENSHOTS',
            handler: onItemClick,
            link: '/page/screen_shots'
        }, {
            id: 'sd_online_tutorials',
            activeClass: 'menu_item_active',
            text: 'ONLINE TUTORIALS',
            handler: onItemClick,
            link: '/page/tutorial_sqldetective'
        }, {
            id: 'sd_faq',
            activeClass: 'menu_item_active',
            text: 'FAQ',
            handler: onItemClick,
            link: '/page/faq_marketing'
        }, {
            id: 'sd_system_requirements',
            activeClass: 'menu_item_active',
            text: 'SYSTEM REQUIREMENTS',
            handler: onItemClick,
            link: '/page/requirements'
        }]
    });
	
    var productsCSMenu = new Ext.menu.Menu({
        id: 'productsCSMenu',
        cls: 'thrd_lvl_menu',
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        },
        items: [{
            id: 'cs_full_description',
            activeClass: 'menu_item_active',
            text: 'FULL DESCRIPTION',
            handler: onItemClick,
            link: '/page/clearsql_pr_description'
        }, {
            id: 'cs_at_a_glance',
            activeClass: 'menu_item_active',
            text: 'AT A GLANCE',
            handler: onItemClick,
            link: '/page/clearsql_at_a_glance'
        }, {
            id: 'cs_why_clearsql',
            activeClass: 'menu_item_active',
            text: 'WHY <span style="font-weight: bold;"><span style="font-style: italic;">Clear</span>SQL</span>?',
            handler: onItemClick,
            link: '/page/clearsql_who_sould_you_use'
        }, {
            id: 'cs_screenshots',
            activeClass: 'menu_item_active',
            text: 'SCREENSHOTS',
            handler: onItemClick,
            link: '/page/clearsql_screen_shots'
        }, {
            id: 'cs_rules_for_audit',
            activeClass: 'menu_item_active',
            text: 'RULES FOR AUDIT',
            handler: onItemClick,
            link: '/page/clearsql_rules_plsql'
        }, {
            id: 'cs_faq',
            activeClass: 'menu_item_active',
            text: 'FAQ',
            handler: onItemClick,
            link: '/page/clearsql_faq_marketing'
        }, {
            id: 'cs_system_requirements',
            activeClass: 'menu_item_active',
            text: 'SYSTEM REQUIREMENTS',
            handler: onItemClick,
            link: '/page/clearsql_system_requirements'
        }]
    });
    var productsCDBMenu = new Ext.menu.Menu({
        id: 'productsCDBMenu',
        cls: 'thrd_lvl_menu',
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        },
        items: [{
            id: 'cdb_pr_description',
            activeClass: 'menu_item_active',
            text: 'FULL DESCRIPTION',
            handler: onItemClick,
            link: '/page/cleardb_pr_description'
        },{
            id: 'cdb_at_a_glance',
            activeClass: 'menu_item_active',
            text: 'AT A GLANCE',
            handler: onItemClick,
            link: '/page/cleardb_at_a_glance'
        }, {
            id: 'cdb_faq',
            activeClass: 'menu_item_active',
            text: 'FAQ',
            handler: onItemClick,
            link: '/page/cleardb_faq_marketing'
        }, {
            id: 'cdb_screenshots',
            activeClass: 'menu_item_active',
            text: 'SCREENSHOTS',
            handler: onItemClick,
            link: '/page/cleardb_screen_shots'
        }, {
            id: 'cdb_system_requirements',
            activeClass: 'menu_item_active',
            text: 'SYSTEM REQUIREMENTS',
            handler: onItemClick,
            link: '/page/cleardb_system_requirements'
        }]
    });
    var releaseHistoryMenu = new Ext.menu.Menu({
        id: 'releaseHistoryMenu',
        cls: 'thrd_lvl_menu',
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        },
        items: [{
            id: 'sd_release_history',
            activeClass: 'menu_item_active',
            text: '<span style="font-weight: bold;">SQL<span style="font-style: italic;">Detective</span> 4.3</span>',
            handler: onItemClick,
            link: '/page/release_history'
        }, {
            id: 'cs_release_history',
            activeClass: 'menu_item_active',
            text: '<span style="font-weight: bold;"><span style="font-style: italic;">Clear</span>SQL 5.6</span>',
            handler: onItemClick,
            link: '/page/clearsql_release_history'
        }, {
            id: 'cdb_release_history',
            activeClass: 'menu_item_active',
            text: '<span style="font-weight: bold;"><span style="font-style: italic;">Clear</span>DB Documenter 2.5</span>',
            handler: onItemClick,
            link: '/page/cleardb_release_history'
        }]
    });
	
	
    // Second Level Menus
    var productsMenu = new Ext.menu.Menu({
        id: 'products_menu',
        cls: 'scnd_lvl_menu',
        style: 'background-color: transparent',
        defaults: {
            handler: onItemClick,
            activeClass: 'menu_item_active'
        },
        items: [
        {
            xtype: 'panel',
            width: 780,
            baseCls: 'x-plain',
            frame: false,
            html: '' +
        '<table class="megamenu">' +
        '  <tr>' +
        '    <th><i>Clear</i>SQL ' + product_versions[1] + '</th>' +
        '    <th><i>Clear</i>DB ' + product_versions[2] + ' Documenter</th>' +
        '    <th><i>Clear</i>DB FREE Documenter</th>' +
        '    <th>SQL<i>Detective</i> ' + product_versions[0] + '</th>' +
        '  </tr>' +
        '  <tr>' +
        '    <td>' +
        '    	<ul class="">' +
        '          <li><a href="/page/clearsql_pr_description">FULL DESCRIPTION</a></li>' +
        '          <li><a href="/page/clearsql_at_a_glance">AT A GLANCE</a></li>' +
        '          <li><a href="/page/clearsql_kits_at_a_glance">KITS AT A GLANCE</a></li>' +
        '          <li><a href="/page/clearsql_who_sould_you_use">WHY <i>Clear</i>SQL?</a></li>' +
        '          <li><a href="/page/clearsql_screen_shots">SCREENSHOTS</a></li>' +
        '          <li><a href="/page/clearsql_rules_plsql">RULES FOR CODE AUDIT</a></li>' +
        '          <li><a href="/page/clearsql_faq_marketing">FAQ</a></li>' +
        '          <li><a href="/page/clearsql_system_requirements">SYSTEM REQUIREMENTS</a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td>' +
        '    	<ul class="">' +
        '          <li><a href="/page/cleardb_pr_description">FULL DESCRIPTION</a></li>' +
        '          <li><a href="/page/cleardb_at_a_glance">AT A GLANCE</a></li>' +
        '          <li><a href="/page/cleardb_kits_at_a_glance">KITS AT A GLANCE</a></li>' +
        '          <li><a href="/page/cleardb_screen_shots">SCREENSHOTS</a></li>' +
        '          <li><a href="/page/cleardb_faq_marketing">FAQ</a></li>' +
        '          <li><a href="/page/cleardb_system_requirements">SYSTEM REQUIREMENTS</a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td>' +
        '    	<ul class="">' +
        '          <li><a href="/page/cleardb_free_pr_description">FULL DESCRIPTION</a></li>' +
        '          <li><a href="/page/cleardb_free_at_a_glance">AT A GLANCE</a></li>' +
        '          <li><a href="/page/cleardb_free_screen_shots">SCREENSHOTS</a></li>' +
        '          <li><a href="/page/cleardb_free_faq_marketing">FAQ</a></li>' +
        '          <li><a href="/page/cleardb_free_system_requirements">SYSTEM REQUIREMENTS</a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td>' +
        '    	<ul class="">' +
        '          <li><a href="/page/pr_description">FULL DESCRIPTION</a></li>' +
        '          <li><a href="/page/sqldetective_at_a_glance">AT A GLANCE</a></li>' +
        '          <li><a href="/page/kits_at_a_glance">KITS AT A GLANCE</a></li>' +
        '          <li><a href="/page/screen_shots">SCREENSHOTS</a></li>' +
        '          <li><a href="/page/tutorial_sqldetective">ONLINE TUTORIALS</a></li>' +
        '          <li><a href="/page/faq_marketing">FAQ</a></li>' +
        '          <li><a href="/page/requirements">SYSTEM REQUIREMENTS</a></li>' +
        '        </ul>' +
        '    </td>' +
        '  </tr>' +
        '  <tr>' +
        '    <th style="padding-bottom: 15px;"><a href="/page/products">Overview</a></th>' +
        '    <th colspan="2" style="padding-bottom: 15px;">' + 
        '      <div style="padding-bottom: 0px;">Product Comparison Matrix</div>'+
        '      <div style="padding-top: 2px; font-size: 11px;"><a href="/page/comparison_matrix" style="font-weight: normal; "><i>Clear</i>SQL 6 - <i>Clear</i>DB 3 - SQL<i>Detective</i> 4</a></div>'+
        '      <div style="padding-top: 2px; font-size: 11px;"><a href="/page/comparison_matrix_cdb_free" style="font-weight: normal; "><i>Clear</i>DB FREE - <i>Clear</i>DB 3</a></div>'+
        '    </a></th>' +
        '  </tr>' +
        '</table>'
        }
        ],
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        }
    });
    var downloadsMenu = new Ext.menu.Menu({
        id: 'downloads_menu',
        cls: 'scnd_lvl_menu',
        style: 'background-color: transparent',
        defaults: {
            handler: onItemClick,
            activeClass: 'menu_item_active'
        },
        items: [
        {
            xtype: 'panel',
            width: 455,
            baseCls: 'x-plain',
            frame: false,
            html: '' +
        '<table class="megamenu">' +
        '  <tr>' +
        '       <th>Free Trial</th>' +
        '       <th>Free Updates</th>' +
        '       <th>Free License</th>' +
        '  </tr>' +
        '  <tr>' +
        '    <td style="padding-bottom: 10px;">' +
        '    	<ul class="">' +
        '          <li><a style="font-size: 11px;" href="/page/dl_trial?prod_id=1"><i>Clear</i>SQL ' + product_versions[1] + '</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/dl_trial?prod_id=2"><i>Clear</i>DB ' + product_versions[2] + ' Documenter</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/dl_trial?prod_id=0">SQL<i>Detective</i> ' + product_versions[0] + '</a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td style="padding-bottom: 10px;">' +
        '    	<ul class="">' +
        '          <li><a style="font-size: 11px;" href="/page/dl_upgrades?prod_id=1"><i>Clear</i>SQL</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/dl_upgrades?prod_id=2"><i>Clear</i>DB Documenter</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/dl_upgrades?prod_id=0">SQL<i>Detective</i></a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td style="padding-bottom: 10px;">' +
        '    	<ul class="">' +
        '          <li><a style="font-size: 11px;" href="/page/dl_free_products"><i>Clear</i>DB FREE</a></li>' +
        '        </ul>' +
        '    </td>' +
        '  </tr>' +
        '</table>'
        }],
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        }
    });
    var supportMenu = new Ext.menu.Menu({
        id: 'support_menu',
        cls: 'scnd_lvl_menu',
        style: 'background-color: transparent',
        defaults: {
            handler: onItemClick,
            activeClass: 'menu_item_active'
        },
        items: [
        {
            xtype: 'panel',
            width: 330,
            baseCls: 'x-plain',
            frame: false,
            html: '' +
        '<table class="megamenu" style="padding-top: 10px; padding-bottom: 10px;">' +
        '  <tr>' +
        '    <th style="vertical-align: top;">Support</th>' +
        '    <th style="vertical-align: top;">Release History</th>' +
        '  </tr>' +
        '  <tr>' +
        '    <td style="padding-bottom: 10px;">' +
        '    	<ul class="">' +
        '          <li><a href="/page/annual_maintenance_service">TECHNICAL SUPPORT</a></li>' +
//        '          <li><a href="/page/faq">FAQ</a></li>' +
        '          <li><a href="/page/forum">TECHNICAL FORUM</a></li>' +
        '          <li><a href="/page/resend_account_login">RESEND PASSWORD</a></li>' +
        '          <li><a href="/page/request_unlock_key">REQUEST KEY</a></li>' +
        '        </ul>' +
        '    </td>' +
        '    <td style="padding-bottom: 10px; vertical-align: top;">' +
        '    	<ul class="">' +
        '          <li><a style="font-size: 11px;" href="/page/clearsql_release_history"><i>Clear</i>SQL</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/cleardb_release_history"><i>Clear</i>DB Documenter</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/cleardb_free_release_history"><i>Clear</i>DB FREE</a></li>' +
        '          <li><a style="font-size: 11px;" href="/page/release_history">SQL<i>Detective</i></a></li>' +
        '        </ul>' +
        '    </td>' +
        '  </tr>' +
        '</table>'
        }],
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        }
    });
    var companyMenu = new Ext.menu.Menu({
        id: 'company_menu',
        cls: 'scnd_lvl_menu',
        style: 'background-color: transparent',
        defaults: {
            handler: onItemClick,
            activeClass: 'menu_item_active'
        },
        items: [
        {
            xtype: 'panel',
            width: 200,
            baseCls: 'x-plain',
            frame: false,
            html: '' +
        '<table class="megamenu">' +
        '  <tr>' +
        '    <td style="padding-top: 10px; padding-bottom: 10px;">' +
        '    	<ul class="">' +
        '          <li><a href="/page/contact_us">CONTACT US</a></li>' +
        '          <li><a href="/page/about_us">ABOUT US</a></li>' +
        '          <li><a href="/page/privacy">PRIVACY POLICY & COPYRIGHT</a></li>' +
        '          <li><a href="/page/reseller">RESELLER</a></li>' +
        '          <li><a href="/page/user_quotes">USER QUOTES</a></li>' +
        '        </ul>' +
        '    </td>' +
        '  </tr>' +
        '</table>'
        }],
        listeners: {
            mouseover: cancelHiding,
            mouseout: hideMenu
        }
    });
	
    // Top Level Menus
    var tb = new Ext.Toolbar({
        id: 'main_toolbar',
        defaults: {
            height: 29,
            overCls: 'toolbar_item_active'
        },
        items: [
        {
            text: '<span style="font-weight: bold;">HOME</span>',
            width: '80px',
            id: 'homeBtn',
            handler: onItemClick,
            link: '/index.php',
            listeners: {
                mouseover: deactivateButtons
            }
        },
        {
            text: '<span style="font-weight: bold;">PRODUCTS</span>',
            width: '100px',
            id: 'productsBtn',
            link: '/page/products',
            handler: onItemClick,
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            },
            menu: productsMenu
        },
        {
            text: '<span style="font-weight: bold;">DOWNLOADS</span>',
            width: '110px',
            id: 'downloadsBtn',
            handler: onItemClick,
            link: '/page/dl_trial',
            menu: downloadsMenu,
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            }
        },
        {
            text: '<span style="font-weight: bold;">BUY NOW</span>',
            width: '90px',
            id: 'buyNowBtn',
            menu: new Ext.menu.Menu({
                cls: 'scnd_lvl_menu',
                style: 'background-color: transparent',
                defaults: {
                    handler: onItemClick,
                    activeClass: 'menu_item_active'
                },
                items: [
                {
                    xtype: 'panel',
                    width: 320,
                    baseCls: 'x-plain',
                    frame: false,
                    html: '' +
                '<table class="megamenu">' +
                '   <tr>' +
                '       <th>Buy Now</th>' +
                '       <th>Rent Now</th>' +
                '  </tr>' +
                '  <tr>' +
                '    <td style="padding-bottom: 10px;">' +
                '    	<ul class="">' +
                '          <li><a style="font-size: 11px;" href="/page/buy_online&prod_id=1"><i>Clear</i>SQL ' + product_versions[1] + '</a></li>' +
                '          <li><a style="font-size: 11px;" href="/page/buy_online&prod_id=2"><i>Clear</i>DB ' + product_versions[2] + ' Documenter</a></li>' +
                '          <li><a style="font-size: 11px;" href="/page/buy_online">SQL<i>Detective</i> ' + product_versions[0] + '</a></li>' +
                '        </ul>' +
                '    </td>' +
                '    <td style="padding-bottom: 10px;">' +
                '    	<ul class="">' +
                '          <li><a style="font-size: 11px;" href="/page/rent_now?prod_id=1"><i>Clear</i>SQL ' + product_versions[1] + '</a></li>' +
                '          <li><a style="font-size: 11px;" href="/page/rent_now?prod_id=2"><i>Clear</i>DB ' + product_versions[2] + ' Documenter</a></li>' +
                '          <li><a style="font-size: 11px;" href="/page/rent_now?prod_id=0">SQL<i>Detective</i> ' + product_versions[0] + '</a></li>' +
                '          <li><a style="font-size: 10px;" href="/page/rent_now">OVERVIEW</a></li>' +
                '        </ul>' +
                '    </td>' +
                '  </tr>' +
                '</table>'
                }
                ]
            }),
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            }
        },{
            text: '<span class="crimson_text" style="font-weight: bold;">UPGRADES</span>',
            width: '90px',
            hidden: (has_upgrade.count == 0),
            id: 'buyUpgBtn',
            menu: new Ext.menu.Menu({
                cls: 'scnd_lvl_menu',
                style: 'background-color: transparent',
                defaults: {
                    handler: onItemClick,
                    activeClass: 'menu_item_active'
                },
                items: [
                {
                    xtype: 'panel',
                    width: 250,
                    baseCls: 'x-plain',
                    frame: false,
                    html: '' +
                '<table class="megamenu">' +
                '   <tr>' +
                '       <th>Upgrade proposal available:</th>' +
                '  </tr>' +
                '  <tr>' +
                '    <td style="padding-bottom: 10px;">' +
                '    	<ul class="">' +
                (has_upgrade.products != undefined && has_upgrade.products[1]?'<li><a style="font-size: 11px;" href="/page/buy_online&prod_id=1"><i>Clear</i>SQL</a></li>':'') +
                (has_upgrade.products != undefined && has_upgrade.products[2]?'<li><a style="font-size: 11px;" href="/page/buy_online&prod_id=2"><i>Clear</i>DB Documenter</a></li>':'') +
                (has_upgrade.products != undefined && has_upgrade.products[0]?'<li><a style="font-size: 11px;" href="/page/buy_online">SQL<i>Detective</i></a></li>':'') +
                '        </ul>' +
                '    </td>' +
                '  </tr>' +
                '</table>'
                }
                ]
            }),
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            }
        },
        {
            text: '<span style="font-weight: bold;">SUPPORT</span>',
            width: '90px',
            id: 'supportBtn',
            handler: onItemClick,
            link: '/page/annual_maintenance_service',
            menu: supportMenu,
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            }
        },
        {
            text: '<span style="font-weight: bold;">COMPANY</span>',
            width: '90px',
            id: 'companyBtn',
            handler: onItemClick,
            link: '/page/contact_us',
            menu: companyMenu,
            listeners: {
                mouseover: showMenu,
                mouseout: hideMenu
            }
        },
        {
            text: '<span style="font-weight: bold;">CHECKOUT</span>',
            id: 'checkoutBtn',
            iconCls: 'checkout_button',
            width: '90px',
            handler: onItemClick,
            link: '/page/basket',
            listeners: {
                mouseover: deactivateButtons
            }
        }
        ]
    });
    tb.cls = 'main_menu';
    tb.ctCls = 'main_menu_buttons';
    if (total_price > 0){
        enable_basket_menu();
    } else {
        disable_basket_menu();
    }
    tb.render('main_menu');
    
    var search_field = new Ext.ux.form.SearchField({
        id: 'text',
        width: 170,
        onTrigger2Click : function(){
            search_form.getForm().submit();
        }
    });
    
//    if (Ext.isIE8){
//        Ext.getDom('search_field').style.top = (index_page?'0px':'0px');
//    } else if (Ext.isIE){
//        Ext.getDom('search_field').style.top = (index_page?'0px':'0px');
//    } else if (Ext.isOpera){
//        Ext.getDom('search_field').style.top = (index_page?'19px':'12px');
//    } else {
//        Ext.getDom('search_field').style.top = (index_page?'2px':'1px');
//    }
    
    var search_form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        url: '/page/search',
        standardSubmit: true,
        method: 'get',
        hideLabels: true,
        width: 180,
        items: [search_field],
        renderTo: 'search_field'
    });
    
});

function showMenu(btn, e, item){
    cancelHiding();
    deactivateButtons(btn);
    var menuPosition = btn.getPosition();
    var btnSize = btn.getSize();
    menuPosition[1] += btnSize.height;
    btn.menu.showAt(menuPosition);
        
}

function deactivateButtons(obj){
    var tb = Ext.getCmp('main_toolbar');
    for (var i = 0; i < tb.items.length; i++){
        var item = tb.get(i);
        if (item != obj){
            item.removeClass('toolbar_item_active');
            if (item.menu) {
                item.menu.hide();
            }
        }
    }
}

function hideItem(item){
    item.hide();
    if (activeButton){
        activeButton.removeClass('toolbar_item_active');
    }
    if (item.parentMenu){
        item.parentMenu.hide();
    }
}

function hideMenu(obj, e, menuItem){
    var cursorPosition, elPosition, elSize;
    if (obj.menu){
        cursorPosition = e.xy;
        elPosition = obj.menu.getPosition();
        elSize = obj.menu.getSize();
        if ( cursorPosition[0] <= elPosition[0] - 10 || cursorPosition[0] >= elPosition[0] + elSize.width +10
            || cursorPosition[1] <= elPosition[1] - 10 || cursorPosition[1] >= elPosition[1] + elSize.height + 10 ) {
            hideInterval = window.setTimeout(function(){
                hideItem(obj.menu);
            }, 500);
        } else {
            obj.addClass('toolbar_item_active');
            activeButton = obj;
        }
    } else {
        cursorPosition = e.xy;
        elPosition = obj.getPosition();
        elSize = obj.getSize();
        if ( cursorPosition[0] <= elPosition[0] || cursorPosition[0] >= elPosition[0] + elSize.width
            || cursorPosition[1] <= elPosition[1] || cursorPosition[1] >= elPosition[1] + elSize.height ) {
            hideInterval = window.setTimeout(function(){
                hideItem(obj);
            }, 500);
        }
    }
	
}

function cancelHiding(){
    clearTimeout(hideInterval);
}

function onItemClick(item){
    //    window.location.href = 'http://www.conquestsoftwaresolutions.com' + item.link;
    window.location.href = item.link;
}
function disable_basket_menu(){
    var checkoutMenu = Ext.getCmp('checkoutBtn');
    if (checkoutMenu) {
        with (checkoutMenu) {
            setIconClass('checkout_button_disabled');
            setText('');
            width = 30;
            setDisabled(true);
            }
    }
}

function enable_basket_menu(){
    var checkoutMenu = Ext.getCmp('checkoutBtn');
    if (checkoutMenu) {
        with (checkoutMenu) {
            setIconClass('checkout_button');
            setText('<span style="font-weight: bold;">CHECKOUT</span>');
            setDisabled(false);
            }
    }
}


