Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

function toggle(containerId){
        var divC = document.getElementById(containerId);
        if (divC.style.display == 'none') {
            divC.style.display = 'block';
        } else if (divC.style.display == 'block'){
            divC.style.display = 'none';
        }
        else {
                divC.style.display = 'none';
        }
    }

$(function(){
        function CollapsibleWidget(container)   {
                
                this.widgetContainer = container;
                this.collapsbiles = $(container).children('.common-widget-control-bar, .common-widget-content-area');
                this.isCollapsed = null;
                
                this.collapse = function()      {
                        $(this.collapsbiles).each(function()    {
                                $(this).slideUp();
                        });
                        this.isCollapsed = true;
                };
                
                this.open = function()  {
                        $(this.collapsbiles).each(function()    {
                                $(this).slideDown();
                        });
                        this.isCollapsed = false;
                };
                
                this.test = function()  {
                };
        }
        
        ResearchWidget.prototype = new CollapsibleWidget();
        ResearchWidget.prototype.constructor = CollapsibleWidget;
        
        function ResearchWidget(container)      {
                CollapsibleWidget.call(this, container);
        }
        
        function updateCompareCount()   {
                $('#research_compare_count').html($('#myresearch input[type="checkbox"]:checked').length);
        }
        
        /** Sidebar Widgets **/
        
        $('#otg_know_more,.otg_know_more').click(function(){
                $.colorbox({
                width: "490px",
                height: "420px",
                inline: true,
                href: "<h3 style='text-align: center; margin: 18px; font-size: 14px;'>On Time Guarantee, We Pay if we Delay</h3>" +
                "<p style='text-align: justify; margin-left: 12px; margin-right: 12px; margin-bottom: 9px; line-height: 22px;'>Saholic stands for 100% on time delivery. We ensure all your orders reach your doorstep on or "+
        "before the promised delivery date. In the rare case that we deliver an order later than promised "+
        "we will compensate you.This Guarantee is Valid on"+
        "</p>" +
        "<ul style='list-style: disc none none; margin-left: 25px; text-align: justify; margin-right:12px; line-height: 22px;'><li>All Mobiles, Cameras, Laptops, Tablets and Accessories above Rs. 2000 in value."+
        "</li>"+
        "<li>Orders Placed using Credit/Debit Card, Net Banking, EMI, Prepaid Cash Cards."+
        "</li>"+
        "</ul>"+
        "<p style='text-align: justify; line-height: 22px; margin: 12px;'>Compensation for delay is in the form of Gift Vouchers at the rate of Rs. 50 per business day. " +
        "GV can be applied to ANY product on Saholic.com without limitation.</p>"+
        "<span class='right'><a target='_blank' href='/static/on-time-guarantee' style='margin-right: 12px; color: #006699';>Detailed Terms & Conditions</a></span>",
        onComplete: function(){
                trackEventWithGA('Widget', 'OTG Know More is clicked', '');
                        }
        });
        });
        
        $('#shoppingExpInfo').click(function(){
                $.colorbox({
                width: "550px",
                height: "320px",
                inline: true,
                href: "<h3>Shopping with Saholic.com is completely safe</h3><br />" +
                "<b>1.</b> We are part of Spice Group - India's # 1 Mobile retailer.<br /><br />" +
                "<b>2.</b> We procure directly from the Manufacturers - Hence we only sell genuine products with full Manufacturer Warranty.<br /><br />" +
                "<b>3.</b> We provide free Next Day Delivery to most locations - You can check the delivery time to your location by entering your pin code on the product page.<br /><br />" +
                "<b>4.</b> We use the best Internet Security technology - Your payment is 100% secure.<br />",
                        onComplete: function(){
                                trackEventWithGA('Widget', 'Safe shopping sticky banner is clicked', '');
                        }
        });
        });
        
        
        $('.insuranceInfo').click(function(){
                $.colorbox({
                width: "520px",
                height: "280px",
                inline: true,
                href: "<h3 style='font-size:15px; text-align:center; font-weight:bold; margin-left:15px; margin-top:5px;margin-bottom:10px'>Exclusively at Saholic</h3>" +
                "<ul style='text-align: justify; padding-right: 10px; width: 93%; padding-left: 16px; line-height: 25px;'>"+
                "<li>Only Saholic brings to you an option to protect your smartphone against theft and burglary.</li>"+
                "<li>While buying your favourite mobile from Saholic, you can opt for 1 year WorldWide theft insurance.</li>"+
                "<li>Introductory offer - You can opt for insurance by paying an all inclusive nominal fee of 1.5% of price of your mobile.</li>"+
                "<a target='_blank' href='/static/insurance-terms' style='float: right; text-decoration: none;color:#006699';>Detailed Terms and Conditions</a>"+
                "</ul>",
                        onComplete: function(){
                                trackEventWithGA('Widget', 'Insurance sticky banner is clicked', '');
                        }
        });
        });
        
        
        $('.emiInfo').click(function(){
                $.colorbox({
                width: "590px",
                height: "480px",
                inline: true,
                href: "<h3 style='font-size: 15px; text-align: center; font-weight: bold; margin-left: 15px; margin-bottom: 10px; margin-top: 7px;'>Completely Free EMI For 3 Months</h3>" +
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/hdfc-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9, 12 and 18 months.Completely free for 3 months<br><a onclick='toggle(\"emi-table-hdfc\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-hdfc' style='padding-left: 5px; display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>18 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>4.22%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>7.04%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>9.67%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>15.36%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/citi-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3 and 6 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-citi\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-citi' style='padding-left: 5px;display: none;'>"+
                "<table width='70%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='2'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 35%;'>3 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 35%;'>6 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray; text-align: center;'>4.22%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/icici-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 ,12 and 18 months.Completely free for 3 months<br><a  onclick='javascript:toggle(\"emi-table-icici\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-icici' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>18 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>11.53%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>16.72%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 1500.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/sbi-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 ,12 and 18 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-sbi\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-sbi' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>18 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>11.53%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>16.72%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 1000.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/hsbc-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 and 12 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-hsbc\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-hsbc' style='padding-left: 5px;display:none;'>"+
                "<table width='70%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>11.53%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 1500.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/std-chartered-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 and 12 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-std-chart\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-std-chart' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>11.53%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 2500.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/kotak-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 and 12 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-kotak\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-kotak' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>11.53%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 500.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/axis-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 3, 6, 9 ,12 and 18 months.Completely free for 3 months<br><a onclick='javascript:toggle(\"emi-table-axis\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-axis' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>3 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>18 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>Free</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>11.53%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>16.72%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li><br><li>Minimum payment amount required to convert into EMI is Rs 2500.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<div style='display: inline-block; padding-left: 5px;' class='bank-logo'><img src='/images/indusind-icon.png' style='vertical-align: middle;'></div>"+
                "<div class='emi-text' style='text-align: justify; height: 49px; padding-left: 3px; width: 397px; display: inline-block; vertical-align: top;'><p style='height: 38px; width: 420px;'>Available for 6, 9 and 12 months. <br><a onclick='javascript:toggle(\"emi-table-indus\");' style='cursor: pointer; text-decoration: none;color:#006699;'>See Full Details</a></p></div>"+
                "<div id='emi-table-indus' style='padding-left: 5px;display: none;'>"+
                "<table width='85%' cellspacing='0' cellpadding='0' border='0' id='emiwidget' style='padding-top: 2px; padding-bottom: 2px; border-top-width: 0px; border-left-width: 0px;padding-left: 5px'>"+
                "<thead>"+
            "<th style='border:1px solid gray;text-align: center;background-color: #F1F1F1;' colspan='5'>All Inclusive Processing Fee*</th>"+
            "</thead>"+
            "<tbody>"+
            "<tr>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>6 Months</th>"+
            "<td style='border-width: 0px 0px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>9 Months</th>"+
            "<td style='border-width: 0px 1px 1px 1px; border-style: solid; border-color: gray;text-align: center; width: 9%;'>12 Months</th>"+
            "</tr>"+
            "<tr>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>5.58%%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 0px solid gray; text-align: center;'>8.47%</td>"+
            "<td style='border-bottom: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid gray;text-align: center;'>11.53%</td>"+
            "</tr>"+
            "</tbody>"+
            "</table>"+
            "<br>"+
                "<ul style='list-style : disc none none; padding-left: 20px; text-align:justify; line-height: 13px; padding-right: 10px; width: 83%;'>"+
                "<li>Select EMI on Make Payment Page to see Monthly EMI payable and Total Amount Payable.</li>"+
                "<br>"+
                "<li>No charges will be levied by the bank.</li><br><li>Credit limit of full amount is needed and blocked at the time of buying on EMI.</li><br><li>As you pay the installments, correspondingly your credit limit increases.</li>"+
                "</ul>"+
                "<br>"+
                "</div>"+
                "<br><br>",
                        onComplete: function(){
                                trackEventWithGA('Widget', 'Emi info widget is clicked', '');
                        }
        });
        });
        
        $('a.mk_best_deal_detail').live('click', function(){
                var offerLinkHtml = '';
                if(OFFER_HELP_LINK!='$OFFER_DETAIL_LINK') {
                        offerLinkHtml = '<a target="_blank" href="' +OFFER_HELP_LINK + '" style="z-index: 1; float: right; bottom: 0px; right: 0px; margin: 15px; position: relative;">More</a></span>';
                }
                $.colorbox({
                        width: "550px",
                height: "300px",
                inline: true,
                href: '<h3 style="text-align: left; padding: 10px;">Offer Details</h3>' +
                        '<p style="text-align: justify; line-height: 22px; margin: 12px;">' + OFFER_HELP_TEXT +
                        '</p><span class="right">' + offerLinkHtml 
                });
        });
        
        
        $('#pickupstoreInfo').click(function(){
                $.colorbox({
                width: "550px",
                height: "370px",
                inline: true,
                href: "<h3>Frequently Asked Questions</h3><br />" +
                "<b style='color: black; cursor: default;'>Q)</b> What is 'Buy Online & Pickup in Store' ?<br /><br />" +
                "<b style='color: black; cursor: default;'>A)</b> Buy Online from Saholic.Com and pickup your product from the nearest Spice Hotspot Retail Store.<br /><br />" +
                "<b style='color: black; cursor: default;'>Q)</b> How do i avail this facility ?<br /><br />" +
                "<b style='color: black; cursor: default;'>A)</b> Simply select Pickup In Store On the Shipping Page and select your nearest store. Please note this facility is available only in Delhi/NCR.</a><br /><br />"+
                "<b style='color: black; cursor: default;'>Q)</b> When will the product be available for pickup ?<br /><br />" +
                "<b style='color: black; cursor: default;'>A)</b> You can enter your pin code on the Product Page to find estimated time to deliver. After placing the order we will also give you the estimated date for pickup.</a><br /><br />",
                
                        onComplete: function(){
                                var ev = "Product Page";
                                var label = window.location.pathname;
                                if (label=="" || label=="#")
                                {
                                        label = "";
                                        ev = "Home Page";
                                }
                                else if (label.indexOf("shipping") != -1){
                                        ev = "Shipping Page";
                                        var blkstr = [];
                                        jQuery("#cartDetail").find("span.cart-item-name").each(function(key,str){
                                                blkstr.push(str);
                                        });
                                        label = blkstr.join(", ");
                                } else if (label.substr(label.lastIndexOf('/') + 1).length==5 && typeof label.substr(label.lastIndexOf('/') + 1) =="number") {
                                        ev = "Category Page";
                                } else if (label.substr(label.lastIndexOf('-') + 1).length==7  && typeof label.substr(label.lastIndexOf('-') + 1) =="number") {
                                        ev = "Product Page";
                                }
                                trackEventWithGA('Pickup in Store LightBox', ev, label);
                        }
        });
        });

        $('.common-widget-top-bar').live('click', function(e, callback){
                var isColapsed = $(this).data('is_colapsed') == true ? true : false;
                var widgetBox = $(this).siblings('.common-widget-content-area');
                var controlBox = $(this).siblings('.common-widget-control-bar');
                var controlBoxArrowImg = $(this).find('img');
                
                if (isColapsed) {
                        if(controlBox.length > 0)       {
                                $(controlBox).slideDown('fast', function(){
                                        $(widgetBox).slideDown('fast', callback);
                                        $(controlBoxArrowImg).attr('src', '/images/IconDownArrow_UnselectedTab.png');
                                });
                        } else  {
                                $(widgetBox).slideDown();
                                $(controlBoxArrowImg).attr('src', '/images/IconDownArrow_UnselectedTab.png');
                        }
                } else  {
                        $(widgetBox).slideUp(function(){
                                $(controlBox).slideUp('fast');
                                $(controlBoxArrowImg).attr('src', '/images/IconRightArrow_UnselectedTab.png');
                        });
                }
                $(this).data('is_colapsed', !isColapsed);
        });
        
        /**
         * Update count of products checked for comparison
         **/
        $('#myresearch input[type="checkbox"]').live('click', function(){
                updateCompareCount();
        });
        
        $("#research_compare").live('click', function(){
                var seldata = "";
                var prodnames = "";
                var tot = 1;
                var saprt = "";
                var par = $('#myresearch').find('input[type=checkbox]:checked');
                var haveSameProductType = true;
                var productType = null;
                
                $(par).each(function(){
                        
                        if(productType != null && productType != $(this).attr('producttype'))   {
                                haveSameProductType = false;
                        }
                        productType = $(this).attr('producttype');
                        
                        if(tot == 1)    {
                                prodnames += $(this).attr("title").replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
                                seldata += "p" + tot + "=" + $(this).val();
                        } else  {
                                seldata += "&p" + tot + "=" + $(this).val();
                                prodnames += "-vs-" + $(this).attr("title").replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
                        }
                        tot ++;
                });
                
                if(! haveSameProductType)       {
                        alert("Only products of same category can be compared");
                } else if(tot > 6)      {
                        alert("Can compare upto five products only.");
                } else if(tot > 2)      {
                        window.location = "/compare-" + productType.replace(/ +/g, '-').toLowerCase() + "/" + prodnames + "?" + seldata+"&fromsrc=comparison_widget";
                } else  {
                        alert("Please select atleast two products");
                }
        });
        
        $("#research_delete").live('click', function(){
                var research_tot = $("#research_total").val();
                var seldata = [];
                var tot = 0;
                var saprt = "";
                var par = $('#myresearch').find('input[type=checkbox]:checked');

                $(par).each(function(){
                        seldata.unshift($(this).val());
                        tot ++;
                });

                if(tot > 0)     {
                        var t = (research_tot * 1) - (tot * 1);
                        $("#research_total").val(t);

                        jQuery.ajax({
                                type: "GET",
                                url: "/deletefromresearch/[" + seldata + "]?_method=delete",
                                success: function(msg)  {
                                        jQuery.each(seldata, function(intIndex, objValue){
                                                delete_from_storage_set("resitems", objValue);
                                                $("#myresearch").find("#" + objValue).fadeOut('slow', function() {
                                                        $(this).remove();
                                                        if(t === 0)     {
                                                                $("#research_default").css("display", "block");
                                                        }
                                                });
                                        });
                                        
                                        //Updating the count
                                        $('#research_compare_count').html($('#myresearch input[type="checkbox"]:checked').length - seldata.length);
                                        
                                        if ($('#myresearch input[type="checkbox"]').length - seldata.length <= 0)       {
                                                $("#myresearch").children(".common-widget-top-bar").trigger('click');
                                        }
                                }
                        });
                } else  {
                        alert("Please select atleast one product");
                }
        });
        
        // No uid cookie
        if (!$.cookie("uid"))   {
                // No uid in storage
                if (!$.Storage.get("uid"))      {
                        if (!$.Storage.get("resitems")) {
                                $.Storage.set("resitems", "[]");
                        }
                        if (!$.Storage.get("histitems"))        {
                                $.Storage.set("histitems", "[]");
                        }
                }
                else    {                       // uid in storage : logout
                        $.Storage.remove("uid");
                        $.Storage.set("resitems", "[]");
                        $.Storage.set("histitems", "[]");
                }
                load_research_widget();
                load_history_widget();
        }
        else    {                               // With uid cookie
                var cookie = $.cookie("uid");
                // Just logged in merge storage items
                if (!$.Storage.get("uid"))      {
                        $.Storage.set("uid", cookie);
                        merge_history_items();
                        load_research_items();
                }
                else    {
                        // UID changed
                        if ( cookie != $.Storage.get("uid"))    {
                                $.Storage.set("uid", cookie);
                                $.Storage.set("resitems", "[]");
                                $.Storage.set("histitems", "[]");
                                merge_history_items();
                                load_research_items();
                        }
                        else    {               // Uid is same
                                if (!$.Storage.get("resitems")) {
                                        $.Storage.set("resitems", "[]");
                                        load_research_items();
                                }
                                else    {
                                        load_research_widget();
                                }
                                
                                if (!$.Storage.get("histitems"))        {
                                        $.Storage.set("histitems", "[]");
                                        merge_history_items();
                                }
                                else    {
                                        load_history_widget();
                                }
                        }
                }
        }
        
        function load_research_items(){
                jQuery.ajax({
                        type: "GET",
                        url: "/myresearch",
                        cache: false,
                        success: function(json) {
                            $.Storage.set("resitems", json);
                            load_research_widget();
                    }
                });
        }

        function load_research_widget(){
                var myResearchWidgetContainer = $("#myresearch");
                
                if($(myResearchWidgetContainer).length == 0) {
                        return;
                }
                var resitems = $.Storage.get("resitems");
                
                if (resitems == "[]") {
                        var emptyResWidgetHtml = '<table border="0" width="100%" cellspacing="1" cellpadding="0" id="research_default">\
                      <tbody>\
                        <tr><td align="center"><b>Add items to compare list</b></td></tr>\
                       </tbody>\
                      </table>';
                        $(myResearchWidgetContainer).find(".common-widget-content-area").html(emptyResWidgetHtml);
                        $(myResearchWidgetContainer).children(".common-widget-top-bar").trigger('click');
                        return;
                }
                var params = "/" + resitems;
                
                jQuery.ajax({
                        type : "GET",
                        url : "/myresearch" + params,
                        cache: true,
                        success : function(html) {
                            $("#myresearch").html(html);
                                updateCompareCount();

                            // Product Title
                            $("#myresearch table td div a.truncate").each(function() {
                                                $(this).truncate({addtitle : true});
                            });

                            // Product Price
                            $("#myresearch table td div div.price").each(function() {
                                                $(this).truncate({addtitle : true});
                                });

                            // Product Details
                            $("#myresearch table td div div.text").each(function() {
                                                $(this).truncate( {addtitle : true});
                                });
                    }
                });
        }
});