﻿function RestartCardsTimer_exclusive(Id,page) {
    clearInterval(CardIntervalId_exclusive);
    initCardsTimer_exclusive(groupInterval_exclusive,1,Id,page);
}

function initCardsTimer_exclusive(time,flag,Id,page) {
    if (flag!=0){time=groupInterval_exclusive;}
    if(CardIntervalId_exclusive)clearInterval(CardIntervalId_exclusive);
    CardIntervalId_exclusive = setInterval("setNext_exclusive(nextCard_exclusive);showAjax_exclusive(currentCard_exclusive,'"+Id+"','"+page+"');initCardsTimer_exclusive("+time+",1,'"+Id+"','"+page+"')",time); 
}
function showAjax_exclusive(groupNumber,Id,page) {
    var card_src=new String("");
    var card_desc=new String("");
    var card_text=new String("");
    var card_title=new String("");
    var url=new String("");
    if (page=='home'){       //* for Home Page *//
       url = site_url+"cards/get_card_group_exclusive.asp?groupNumber=" + groupNumber ;
    }
    change_pictureBig_exclusive(url);
}
function change_pictureBig_exclusive(page){
//alert(page);
 var card_src=new String("");
 var card_desc=new String("");
 var card_title=new String("");
 var card_text=new String("");
 var obj_picture="picture_exclusive";
 $.get(page,{},function(data){
 response_Results=new String(data);
 arr_Results=response_Results.split('_CARDPIC_');
 //applyFilter(obj_picture);
 //document.getElementById(obj_picture).src = arr_Results[0];
 if (arr_Results.length>=1){card_src=arr_Results[0];card_desc=arr_Results[1];card_text=arr_Results[2];}
 if (arr_Results.length>=3){card_title=arr_Results[3];}
 if (card_src.trim()!='' && document.getElementById(obj_picture)){document.getElementById(obj_picture).style.display="block"; applyFilter(obj_picture);document.getElementById(obj_picture).src = card_src;}else{document.getElementById(obj_picture).style.display="none";}
 $("#div_exclusive_card_desc").html(card_desc);
 $("#div_exclusive_card_text").html(card_text);
     if (document.getElementById("title_exclusive") && document.getElementById("img_exclusive")){
         document.getElementById("img_exclusive").href=document.getElementById("title_exclusive").href;
         document.getElementById("img_exclusive").title=card_title;
         document.getElementById("picture_exclusive").alt=card_title;
     }
 });
}

function setNext_exclusive(id){
    // alert(id)
    if (id < NumOfCards_exclusive + 1){
        if (id == NumOfCards_exclusive) {
            currentCard_exclusive = id;
            previousCard_exclusive = NumOfCards_exclusive - 1;
            nextCard_exclusive = 1;
        }else if (id == 1){
            currentCard_exclusive = id;
            previousCard_exclusive = NumOfCards_exclusive;
            nextCard_exclusive = 2;
        }else{
           currentCard_exclusive = id;
            previousCard_exclusive = id - 1;
            nextCard_exclusive = id + 1;
        }
    }else{
        currentCard_exclusive = NumOfCards_exclusive - 1;
        previousCard_exclusive = NumOfCards_exclusive - 2;
        nextCard_exclusive = 1;
    }
}

function setPrevious_exclusive(id) {
    if (id > 0) {
        if (id == 1) {
            currentCard_exclusive = id;
            previousCard_exclusive = NumOfCards_exclusive;
            nextCard_exclusive = 2;
        }else if (id == NumOfCards_exclusive){
                currentCard_exclusive = NumOfCards_exclusive;
                previousCard_exclusive = NumOfCards_exclusive - 1;
                nextCard_exclusive = 1;
        }else {
            currentCard_exclusive = id;
            previousCard_exclusive = id - 1;
            nextCard_exclusive = id + 1;
        }
    }
}










