﻿var currentTabId = 'tab1';
    var bRotate = true;
    function clearBox(element, value){
        if(element){
            if(element.value == value){
                element.value = "";
            }
        }
    }
    
    function rotateDivs(){
       
        if(bRotate){
            if(currentTabId == 'tab1'){
                tabClick('tab2');
            }else if (currentTabId == 'tab2'){
                 tabClick('tab3');
            }else if (currentTabId == 'tab3'){
                 tabClick('tab1');
            }
        }
    }
    
    function tabClick(tabId){
        var currentTab = document.getElementById(currentTabId);
       
        //alert(currentTab.id);
        if(currentTab){
            currentTab.setAttribute('className', '');
            currentTab.className = '';
            currentTab.setAttribute('class', '');
           
        }
        var newTab = document.getElementById(tabId);
        if(newTab){
            newTab.setAttribute('className', 'current');
            newTab.setAttribute('class', 'current');
            newTab.className = 'current';
           
        }
        currentTabId = tabId;
        switchTabs();
        return false;
    }

    function switchTabs() {
        if (currentTabId) {
            var div;
            div = document.getElementById('what_tab');
            if (div) {div.style.display = 'none';}
            div = document.getElementById('how_tab');
            if (div) { div.style.display = 'none'; }
            div = document.getElementById('no_junk_tab');
            if (div) { div.style.display = 'none'; }
            if (currentTabId == 'tab1') {
                div = document.getElementById('what_tab');
                if (div) { div.style.display = 'block'; }
            } else if (currentTabId == 'tab2') {
                div = document.getElementById('how_tab');
                if (div) { div.style.display = 'block'; }
            } else if (currentTabId == 'tab3') {
                div = document.getElementById('no_junk_tab');
                if (div) { div.style.display = 'block'; }
            }
        }
    }

    setInterval('rotateDivs()', 15000);
    var imgArray = new Array();
    function preloadImages() {
        
        var img;
        
        //always indicate the index number and the purpose of each image getting preloaded
        
        
        //index 0 - loading animated gif
        img = new Image();
        img.src = "../../themes/images/offerclickimages/ani.gif";
        imgArray.push(img);
        
        
    }
    preloadImages();
    function showAnimation(stepCarouselId, narrow) {
        var div = document.getElementById(stepCarouselId);
        if (div) {
            if (narrow) {
                div.innerHTML = "<div class='loading_narrow'>&nbsp;<img alt='' src='" + imgArray[0].src + "'/></div>";
            } else {
                div.innerHTML = "<div class='loading'>&nbsp;<img alt='' src='" + imgArray[0].src + "'/></div>";
            }
            
        }
        return true;

    }

    function associateIndicationText(textDivId) {
        //return;
        var control;
        var div = document.getElementById('captcha_container');
        if (div) {
            var inputs = div.getElementsByTagName('input');
            if (inputs) {
                if (inputs.length > 0) {
                    control = inputs[0];
                }
            }
        }
        var indText = document.getElementById(textDivId);
        if (control) {
            if (control.style.backgroundColor != 'undefined') {
                control.style.backgroundColor = '#F9F2CC';
            }
            if (control.style.border != 'undefined') {
                control.style.border = '0.09em solid #BEC58D';
            }
            if (control.style.color != 'undefined') {
                control.style.color = '#888888';
            }

            //control.onkeypress = function(event) { skipEnterKey(event); };
            if (indText) {
                control.onfocus = function() { indText.style.display = 'block' };
                control.onblur = function() { indText.style.display = 'none' };
            }
        }

        var wizContainer = document.getElementById('dvWizContainer');
        if (wizContainer) {
            var inputControls = wizContainer.getElementsByTagName('input');
            if (inputControls) {
                for (var i = 0; i < inputControls.length; i++) {
                    var inputControl = inputControls[i];
                    if (inputControl.type == 'text') {
                        inputControl.onkeypress = function(event) { skipEnterKey(event); };
                    }
                }
            }
        }

    }

    function skipEnterKey(e) {
        if (e == null || e == 'undefined') {
            e = window.event;
        }
        if (e.which != 'undefined' && e.which > 0) {
            if (e.which == 13) {
                e.returnValue = false;
                if (e.preventDefault) {
                    e.preventDefault();
                }
                return false;
            }
        }else if (e.keyCode != 'undefined' && e.keyCode > 0) {
            if (e.keyCode == 13) {
                e.returnValue = false;
                if (e.preventDefault) {
                    e.preventDefault();
                }
                return false;
            }
        }
    }
    
    //Validation Function for Location in OCHome.aspx
    function validateLocation(sender, args) {        
        var location = args.Value;
        var objRegExp = /(,)/;  //Check for comma in the entered text    
        if (!objRegExp.test(location)) {
            var objRegEx = /(^\d{5}$)/;    //Check for 5 digit integer
            if (objRegEx.test(location))
                args.IsValid = true;    //Valid zip code               
            else
                args.IsValid = false;
        }
        else    //If there is comma in the entered text
        {
            var arrayLoc = location.split(/\s*,\s*/);
            if (parseInt(arrayLoc.length) == 2) {
                if (arrayLoc[1].length == 2) {
                    var objRegEx2 = /(^\d{2}$)/;
                    if (!objRegEx2.test(arrayLoc[1]))   //If second part is not numeric
                        args.IsValid = true;
                    else
                        args.IsValid = false;
                }
                else
                    args.IsValid = false;
            }
            else
                args.IsValid = false;
        }
    }

    //Validation Function for Location in LocationBar.ascx
    function validateLocation_LocBarControl(sender, args) {
        var location = args.value;
        var objRegExp = /(,)/;  //Check for comma in the entered text    
        if (!objRegExp.test(location)) {
            var objRegEx = /(^\d{5}$)/;    //Check for 5 digit integer
            if (objRegEx.test(location))
                return true;    //Valid zip code               
            else
                return false;
        }
        else    //If there is comma in the entered text
        {
            var arrayLoc = location.split(/\s*,\s*/);
            if (parseInt(arrayLoc.length) == 2) {
                if (arrayLoc[1].length == 2) {
                    var objRegEx2 = /(^\d{2}$)/;
                    if (!objRegEx2.test(arrayLoc[1]))   //If second part is not numeric
                        return true;
                    else
                        return false;
                }
                else
                    return false;
            }
            else
                return false;
        }
    }
    //Validation function for additional zip codes
    function validateZipCode(sender, args) {

        var val = args.Value;
        if (val == null) {
            args.IsValid = true;
        }
        else if (val == '') {
            args.IsValid = true;
        }
        else {
            var regZipCode1 = new RegExp('^[0-9]{5}$');
            if (regZipCode1.exec(val) == null) {
                args.IsValid = false;
            }
            else {
                args.IsValid = true;
            }
        }
    }
    //validation function to validate first ZIP CODE
    function validateFirstZipCode(sender, args) {
        var div = document.getElementById('chkZipCodeContainer');
        if (div) {
            var chkboxes = div.getElementsByTagName('input');
            if (chkboxes) {
                if (chkboxes.length > 0) {
                    var chk = chkboxes[0];
                    if (!chk.checked) {
                        args.IsValid = true;
                    } else {
                        validateZipCode(sender, args);
                    }
                }
            }
        }
    }

    //validation function to compare dates
    //returns text if first date is less than current date
    //return text if second date is less than current date
    //return text if current date is not between first date and second date
    //returns blank if everything is okay
    //assumes the text box objects and date format of mm/dd/yyyy
    function compareDateValidator(firstDate, secondDate) {
        var st = firstDate.value;
        var end = secondDate.value;
        if (st.length <= 0) {
            return "Start date cannot be empty.";
        }
        if (end.length <= 0) {
            return "End date cannot be empty.";
        }
        if (!compareToCurrentDate(st)) {
            return "Start date cannot be less than current date.";
        }

        if (!compareToCurrentDate(end)) {
            return "End date cannot be less than current date.";
        }


        var startDate = convertToJSDate(st);
        var endDate = convertToJSDate(end);
        var temp = new Date();
        var currentDate = new Date(temp.getFullYear(), temp.getMonth, temp.getDate, 0, 0, 0);


        if (startDate.getTime() > endDate.getTime()) {
            return "Start date cannot be greater than end date.";
        }

        return "";
    }

    //custom validator to check if the given date is >= current date or not
    function customCurrentDateValidator(sender, args) {
        args.IsValid = compareToCurrentDate(args.Value);
    }
    
    //validates if a date is greater than the current date
    //returns true if date is greater than or equal to the current date
    function compareToCurrentDate(argDate) {
        var dt = convertToJSDate(argDate);
        if (dt != null) {
            var temp = new Date();
            var currentDate = new Date(temp.getFullYear(), temp.getMonth(), temp.getDate(), 0, 0, 0);
            if (dt.getTime() >= currentDate.getTime()) {
                return true;
            }
        }
        return false;    

    }

    //converts a date of mm/dd/yyyy into actual javascript date object
    // the argument must be a value and not the control
    //returns null if not a valid date object
    function convertToJSDate(argDate) {
        var arDate = argDate.split("-");

        if (arDate.length != 3) {
            return null;
        }


        var stDay = arDate[1];
        var stMonth = arDate[0];
        var stYear = arDate[2];
        return new Date(stYear, stMonth-1, stDay, 0, 0, 0);
    }

    //in future, this function must be used for associating a text box with enter key
    //by LSA on Feb 25, 2010
    function associateButtonClick(e, buttonid) {
        var bt = document.getElementById(buttonid);
        if (bt) {
            if (navigator.appName.indexOf("Netscape") > (-1)) {
                if (e.keyCode == 13) {
                    if (typeof (bt.onclick) == 'function') {
                        bt.onclick.apply();
                    } else if (typeof (bt.click) == 'object') {
                        bt.click();
                    }  
                    return false;
                }
            }
            if (navigator.appName.indexOf("Microsoft Internet Explorer") > (-1)) {
                if (event.keyCode == 13) {
                    if (typeof (bt.onclick) == 'function') {
                        var obj = new Array();
                        obj.push('');
                        bt.onclick.apply(this, obj);
                    } else if (typeof (bt.click) == 'object') {
                        bt.click();
                    }
                    return false;
                }
            }
        }
    }

    //For Opening the Modal windows for Change Password and Change User Name
    function openModalWindow(pagType) {
        var winType = "m"; //m for modal and n for non modal
        var retVal;
        if (pagType == 'changePassword') {
            if (window.showModalDialog) {
                retVal = window.showModalDialog("../Common/ChangePassword.aspx", "name", "dialogWidth:850px;dialogHeight:400px");
            }
            else {
                winType = "n";
                retVal = window.open('../Common/ChangePassword.aspx', 'name', 'height=255,width=260,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            }
        }
        else if (pagType == 'changeUserName') {
            if (window.showModalDialog) {
                retVal = window.showModalDialog("../Common/ChangeUserName.aspx", "name", "dialogWidth:850px;dialogHeight:400px");
            }
            else {
                winType = "n";
                retVal = window.open('../Common/ChangeUserName.aspx', 'name', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            }
        }
        else if (pagType == 'Rules') {
            if (window.showModalDialog) {
                retVal = window.showModalDialog("../Promotions/rules.html", "name", "dialogWidth:745px;dialogHeight:400px");
            }
            else {
                winType = "n";
                retVal = window.open('../Promotions/rules.html', 'name', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            }
        }
        if (winType == 'm') {
            if (retVal != undefined || retVal == null) {
                window.location.reload(true);
            }
        } 
    }

    /*
    The section below is to handle the dynamic menu on Menu control
    **** START ****
    */

    var hoverDelay = 100; 

    var myTimeoutID;

    var myNode, myData;

    var ref_Menu_HoverStatic;

    var ref_Menu_Unhover;

    var ref_overrideMenu_HoverStatic;





    // This function is called in <body onload="...">

    function initMenuMouseHoverInterceptors() {

   

        if ((typeof (Menu_HoverStatic) != 'undefined')) {

            ref_Menu_HoverStatic = Menu_HoverStatic;

            Menu_HoverStatic = My_Menu_HoverStatic;



          

            ref_Menu_Unhover = Menu_Unhover;

            Menu_Unhover = My_Menu_Unhover;



          

            ref_overrideMenu_HoverStatic = Menu_HoverStatic; //corrected by skynyrd

            Menu_HoverStatic = My_overrideMenu_HoverStatic;

        }

    }



    function My_Menu_HoverStatic(item) {

        My_overrideMenu_HoverStatic(item);

    }



    function My_overrideMenu_HoverStatic(item) {

        var node = Menu_HoverRoot(item);

        var data = Menu_GetData(item);

        myNode = node;

        myData = data;

        if (!data) return;

        

        myTimeoutID = setTimeout("My_DelayExpandMenu(myNode,myData)", hoverDelay); //COnfigurable

    }



    function My_DelayExpandMenu(node, data) {


        try {
            var child = My_Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
            var top = findTop(node);
            var left = findLeft(node);
            child.style.top = top + node.clientHeight + 'px';
            //child.style.left = left + 'px';
            child.style.visibility = 'visible';
            child.style.display = 'inline';
        } catch (Error) {
            //throw Error;
        }
        //WebForm_SetElementY(child, top + node.clientHeight);
    }



    function My_Menu_Unhover(item) {

        clearTimeout(myTimeoutID);

        ref_Menu_Unhover(item);

    }

    function findPos(obj) {
        var curleft = curtop = 0;
        if (obj.offsetParent) {
            do {
                curleft += obj.offsetLeft;
                curtop += obj.offsetTop;
            } while (obj = obj.offsetParent);
        }
        return [curleft, curtop];

    }

    function findTop(obj) {
        var pos = findPos(obj);
        return pos[1];
    }

    function findLeft(obj) {
        var pos = findPos(obj);
        return pos[0];
    }

    function My_Menu_Expand(item, horizontalOffset, verticalOffset, hideScrollers) {
        Menu_ClearInterval();
        var tr = item.parentNode.parentNode.parentNode.parentNode.parentNode;
        var horizontal = true;
        if (!tr.id) {
            horizontal = false;
            tr = tr.parentNode;
        }
        var child = Menu_FindSubMenu(item);
        if (child) {
            var data = Menu_GetData(item);
            if (!data) {
                return null;
            }
            child.rel = tr.id;
            child.x = horizontalOffset;
            child.y = verticalOffset;
            if (horizontal) child.pos = "bottom";
            My_PopOut_Show(child.id, hideScrollers, data);
        }
        Menu_SetRoot(item);
        if (child) {
            if (!document.body.__oldOnClick && document.body.onclick) {
                document.body.__oldOnClick = document.body.onclick;
            }
            if (__rootMenuItem) {
                document.body.onclick = Menu_HideItems;
            }
        }
        Menu_ResetSiblings(tr);
        return child;
    }

    function My_PopOut_Show(panelId, hideScrollers, data) {
        var panel = WebForm_GetElementById(panelId);
        if (panel && panel.tagName.toLowerCase() == "div") {
            //panel.style.visibility = "visible";
            panel.style.display = "inline";
            
            if (!panel.offset || hideScrollers) {
                panel.scrollTop = 0;
                panel.offset = 0;
                var table = WebForm_GetElementByTagName(panel, "TABLE");
                if (table) {
                    WebForm_SetElementY(table, 0);
                }
            }
            My_PopOut_Position(panel, hideScrollers);
            var z = 1;
            var isIE = window.navigator && window.navigator.appName == "Microsoft Internet Explorer" && !window.opera;
            if (isIE && data) {
                var childFrameId = panel.id + "_MenuIFrame";
                var childFrame = WebForm_GetElementById(childFrameId);
                var parent = panel.offsetParent;
                if (!childFrame) {
                    childFrame = document.createElement("iframe");
                    childFrame.id = childFrameId;
                    childFrame.src = (data.iframeUrl ? data.iframeUrl : "about:blank");
                    childFrame.style.position = "absolute";
                    childFrame.style.display = "none";
                    childFrame.scrolling = "no";
                    childFrame.frameBorder = "0";
                    if (parent.tagName.toLowerCase() == "html") {
                        document.body.appendChild(childFrame);
                    }
                    else {
                        parent.appendChild(childFrame);
                    }
                }
                var pos = WebForm_GetElementPosition(panel);
                var parentPos = WebForm_GetElementPosition(parent);
                WebForm_SetElementX(childFrame, pos.x - parentPos.x);
                WebForm_SetElementY(childFrame, pos.y - parentPos.y);
                WebForm_SetElementWidth(childFrame, pos.width);
                WebForm_SetElementHeight(childFrame, pos.height);
                childFrame.style.display = "block";
                if (panel.currentStyle && panel.currentStyle.zIndex) {
                    z = panel.currentStyle.zIndex;
                }
                else if (panel.style.zIndex) {
                    z = panel.style.zIndex;
                }
            }
            panel.style.zIndex = z;
        }
    }

    function My_PopOut_Position(panel, hideScrollers) {
        if (window.opera) {
            panel.parentNode.removeChild(panel);
            document.forms[0].appendChild(panel);
        }
        var rel = WebForm_GetElementById(panel.rel);
        var relTable = WebForm_GetElementByTagName(rel, "TABLE");
        var relCoordinates = WebForm_GetElementPosition(relTable ? relTable : rel);
        var panelCoordinates = WebForm_GetElementPosition(panel);
        var panelHeight = ((typeof (panel.physicalHeight) != "undefined") && (panel.physicalHeight != null)) ?
        panel.physicalHeight :
        panelCoordinates.height;
        panel.physicalHeight = panelHeight;
        var panelParentCoordinates;
        if (panel.offsetParent) {
            panelParentCoordinates = WebForm_GetElementPosition(panel.offsetParent);
        }
        else {
            panelParentCoordinates = new Object();
            panelParentCoordinates.x = 0;
            panelParentCoordinates.y = 0;
        }
        var overflowElement = WebForm_GetElementById("__overFlowElement");
        if (!overflowElement) {
            overflowElement = document.createElement("img");
            overflowElement.id = "__overFlowElement";
            WebForm_SetElementWidth(overflowElement, 1);
            document.body.appendChild(overflowElement);
        }
        WebForm_SetElementHeight(overflowElement, panelHeight + relCoordinates.y + parseInt(panel.y ? panel.y : 0));
        overflowElement.style.visibility = "visible";
        overflowElement.style.display = "inline";
        var clientHeight = 0;
        var clientWidth = 0;
        if (window.innerHeight) {
            clientHeight = window.innerHeight;
            clientWidth = window.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight) {
            clientHeight = document.documentElement.clientHeight;
            clientWidth = document.documentElement.clientWidth;
        }
        else if (document.body && document.body.clientHeight) {
            clientHeight = document.body.clientHeight;
            clientWidth = document.body.clientWidth;
        }
        var scrollTop = 0;
        var scrollLeft = 0;
        if (typeof (window.pageYOffset) != "undefined") {
            scrollTop = window.pageYOffset;
            scrollLeft = window.pageXOffset;
        }
        else if (document.documentElement && (typeof (document.documentElement.scrollTop) != "undefined")) {
            scrollTop = document.documentElement.scrollTop;
            scrollLeft = document.documentElement.scrollLeft;
        }
        else if (document.body && (typeof (document.body.scrollTop) != "undefined")) {
            scrollTop = document.body.scrollTop;
            scrollLeft = document.body.scrollLeft;
        }
        overflowElement.style.visibility = "hidden";
        overflowElement.style.display = "none";
        var bottomWindowBorder = clientHeight + scrollTop;
        var rightWindowBorder = clientWidth + scrollLeft;
        var position = panel.pos;
        if ((typeof (position) == "undefined") || (position == null) || (position == "")) {
            position = (WebForm_GetElementDir(rel) == "rtl" ? "middleleft" : "middleright");
        }
        position = position.toLowerCase();
        var y = relCoordinates.y + parseInt(panel.y ? panel.y : 0) - panelParentCoordinates.y;
        var borderParent = (rel && rel.parentNode && rel.parentNode.parentNode && rel.parentNode.parentNode.parentNode
        && rel.parentNode.parentNode.parentNode.tagName.toLowerCase() == "div") ?
        rel.parentNode.parentNode.parentNode : null;
        WebForm_SetElementY(panel, y);
        PopOut_SetPanelHeight(panel, panelHeight, true);
        var clip = false;
        var overflow;
        if (position.indexOf("top") != -1) {
            y -= panelHeight;
            WebForm_SetElementY(panel, y);
            if (y < -panelParentCoordinates.y) {
                y = -panelParentCoordinates.y;
                WebForm_SetElementY(panel, y);
                if (panelHeight > clientHeight - 2) {
                    clip = true;
                    PopOut_SetPanelHeight(panel, clientHeight - 2);
                }
            }
        }
        else {
            if (position.indexOf("bottom") != -1) {
                y += relCoordinates.height;
                WebForm_SetElementY(panel, y);
            }
            //overflow part was commented
            /*
            overflow = y + panelParentCoordinates.y + panelHeight - bottomWindowBorder;
            if (overflow > 0) {
                y -= overflow;
                WebForm_SetElementY(panel, y);
                if (y < -panelParentCoordinates.y) {
                    y = 2 - panelParentCoordinates.y + scrollTop;
                    WebForm_SetElementY(panel, y);
                    clip = true;
                    PopOut_SetPanelHeight(panel, clientHeight - 2);
                }
            }
            */
        }
        if (!clip) {
            PopOut_SetPanelHeight(panel, panel.clippedHeight, true);
        }
        var panelParentOffsetY = 0;
        if (panel.offsetParent) {
            panelParentOffsetY = WebForm_GetElementPosition(panel.offsetParent).y;
        }
        var panelY = ((typeof (panel.originY) != "undefined") && (panel.originY != null)) ?
        panel.originY :
        y - panelParentOffsetY;
        panel.originY = panelY;
        if (!hideScrollers) {
            PopOut_ShowScrollers(panel);
        }
        else {
            PopOut_HideScrollers(panel);
        }
        var x = relCoordinates.x + parseInt(panel.x ? panel.x : 0) - panelParentCoordinates.x;
        if (borderParent && borderParent.clientLeft) {
            x += 2 * borderParent.clientLeft;
        }
        WebForm_SetElementX(panel, x);
        if (position.indexOf("left") != -1) {
            x -= panelCoordinates.width;
            WebForm_SetElementX(panel, x);
            if (x < -panelParentCoordinates.x) {
                WebForm_SetElementX(panel, -panelParentCoordinates.x);
            }
        }
        else {
            if (position.indexOf("right") != -1) {
                x += relCoordinates.width;
                WebForm_SetElementX(panel, x);
            }
            overflow = x + panelParentCoordinates.x + panelCoordinates.width - rightWindowBorder;
            if (overflow > 0) {
                if (position.indexOf("bottom") == -1 && relCoordinates.x > panelCoordinates.width) {
                    x -= relCoordinates.width + panelCoordinates.width;
                }
                else {
                    x -= overflow;
                }
                WebForm_SetElementX(panel, x);
                if (x < -panelParentCoordinates.x) {
                    WebForm_SetElementX(panel, -panelParentCoordinates.x);
                }
            }
        }
    }

    /*
    The section above is to handle the dynamic menu on Menu control
    **** END ****
    */



    /*
    *********Start************
    Function for showing timer for Today's Deal on Promotions.aspx page
    */
    function ticker(argInterval, argDays, argHours, argMinutes, argSeconds) {
        var days;
        var hours;
        var minutes;
        var seconds;
        var remainder;
        var residue;

        var element = document.getElementById(argInterval);
        if (element) {
            residue = parseInt(element.value);
            remainder = residue % 86400000;
            days = (residue - remainder) / 86400000;
            residue = remainder;

            remainder = residue % 3600000;
            hours = (residue - remainder) / 3600000;
            residue = remainder;

            remainder = residue % 60000;
            minutes = (residue - remainder) / 60000;
            residue = remainder;

            remainder = residue % 1000;
            seconds = (residue - remainder) / 1000;

            var currMS = new Date().valueOf();
            var diff = currMS - startup;
            startup = currMS
            element.value = parseInt(element.value) - diff;

            element = document.getElementById(argDays);
            if (element && parseInt(element.innerText) != days) {
                element.innerHTML = days;
            }
            if (element.innerHTML.length < 2)
                element.innerHTML = "0" + element.innerHTML;

            element = document.getElementById(argHours);
            if (element && parseInt(element.innerText) != hours) {
                element.innerHTML = hours;
            }
            if (element.innerHTML.length < 2)
                element.innerHTML = "0" + element.innerHTML;
            element = document.getElementById(argMinutes);

            if (element && parseInt(element.innerText) != minutes) {
                element.innerHTML = minutes;
            }
            if (element.innerHTML.length < 2)
                element.innerHTML = "0" + element.innerHTML;

            element = document.getElementById(argSeconds);
            if (element && parseInt(element.innerText) != seconds) {
                element.innerHTML = seconds;
            }
            if (element.innerHTML.length < 2)
                element.innerHTML = "0" + element.innerHTML;
        }
    }
    /**********End*************/


    function managePlusMinus(objImage, objDiv) {
        var img = document.getElementById(objImage);
        var div = document.getElementById(objDiv);
        if (div.style.display == "block") {
            div.style.display = "none";
            img.src = "../../Themes/Images/OfferClickImages/close_icon.png";
        }
        else {
            div.style.display = "block";
            img.src = "../../Themes/Images/OfferClickImages/open_icon.png";
        }
    }

    /*********Function for pointing to Google Map***********/
    function showInfoWindow(index) {
        if (GoogleMapStore) {
            if (GoogleMapStore.Markers && GoogleMapStore.Markers != null) {
                var marker = GoogleMapStore.Markers[index];
                marker.openDefaultInfoWindow();
            }
        }
    }
