function WizardParamEG30c72b0cfb514b708dfa001946eba9fd()
{
this.EG_padding=0;
this.EG_pageNumber='1';
this.EG_imageDefaultExpert='/images/Affiliates/ExpertGrid/manLarge_1.gif';
this.EG_expertUnitHeight=97;
this.EG_expertUnitWidth=498;
this.EG_headerUnitHeight=58;
this.EG_headerUnitWidth=498;
this.EG_footerUnitHeight=38;
this.EG_navigationUnitHeight=28;
this.EG_navigationUnitWidth=-1;
this.EG_bannerGridShape=1;
this.EG_layoutType=1;
this.EG_imageExpert='/images/small/{ExpertID}.jpeg';
this.EG_Version='1.00';
this.EG_def_titleFontFamily='Tahoma';
this.EG_def_titleFontSize='16pt';
this.EG_def_subtitleFontFamily='Tahoma';
this.EG_def_subtitleFontSize='14pt';
this.EG_def_footerFontFamily='Tahoma';
this.EG_def_footerFontSize='12pt';
this.EG_categoryUrl= WizardParam.EG_categoryUrl;
this.EG_url= WizardParam.EG_url;
this.EG_LP_Url= WizardParam.EG_LP_Url;
this.EG_imageUrl= WizardParam.EG_imageUrl;
this.EG_height= WizardParam.EG_height;
this.EG_width= WizardParam.EG_width;
this.EG_CatID= WizardParam.EG_CatID;
if (typeof(WizardParam.EG_params) == 'undefined') this.EG_params=''; else this.EG_params= WizardParam.EG_params;
if (typeof(WizardParam.EG_profileMode) == 'undefined') this.EG_profileMode='Wizard'; else this.EG_profileMode= WizardParam.EG_profileMode;
this.EG_PID='0';
this.EG_AID='0';
this.EG_AffliateID='';
this.EG_SubDomainURL='http://Psychics.liveperson.com';
this.EG_CategoryName='Spirituality & Religion';
this.EG_expertsOutput = "";this.EG_phoneEnabled = false;this.EG_NextShowPicture = false;this.EG_125X125TimerRunning = false;this.EG_125X125RefreshTime = 3000;this.EG_UniqeKey = "WizardParamEG30c72b0cfb514b708dfa001946eba9fd";
this.EG_ExpertGridShortCodeUniqeKey = "EG30c72b0cfb514b708dfa001946eba9fd" ;
this.EG_RefToGrid = new KasambaExpertsGrid_WizardParamEG30c72b0cfb514b708dfa001946eba9fd();
this.EG_ExpertGridDiv = "EG30c72b0cfb514b708dfa001946eba9fd" ;
this.EG_numExpertInPage  = 0 ;
this.EG_totalNumOfExperts  = 0 ;
this.EG_output = '';
if (typeof(WizardParam.EG_titleColor) == 'undefined') this.EG_titleColor='469A21';else this.EG_titleColor= WizardParam.EG_titleColor;
if (typeof(WizardParam.EG_titleFontSize) == 'undefined') this.EG_titleFontSize='16pt';else this.EG_titleFontSize= WizardParam.EG_titleFontSize;
if (typeof(WizardParam.EG_subtitleColor) == 'undefined') this.EG_subtitleColor='469A21';else this.EG_subtitleColor= WizardParam.EG_subtitleColor;
if (typeof(WizardParam.EG_ViewAllUrl) == 'undefined') this.EG_ViewAllUrl='//';else this.EG_ViewAllUrl= WizardParam.EG_ViewAllUrl;
if (typeof(WizardParam.EG_subtitleFontSize) == 'undefined') this.EG_subtitleFontSize='14pt';else this.EG_subtitleFontSize= WizardParam.EG_subtitleFontSize;
if (typeof(WizardParam.EG_imageContactLive) == 'undefined') this.EG_imageContactLive='/images/Affiliates/ExpertGrid/Buttons/size1_a_orange1.gif';else this.EG_imageContactLive= WizardParam.EG_imageContactLive;
if (typeof(WizardParam.EG_SubSubCatID) == 'undefined') this.EG_SubSubCatID=0; else this.EG_SubSubCatID= WizardParam.EG_SubSubCatID; 
if (typeof(WizardParam.EG_header) == 'undefined') this.EG_header=4; else this.EG_header= WizardParam.EG_header; 
if (typeof(WizardParam.EG_imageSpecialOffer) == 'undefined') this.EG_imageSpecialOffer='/images/Affiliates/ExpertGrid/SpecialOffers/ready_500_green4black.gif';else this.EG_imageSpecialOffer= WizardParam.EG_imageSpecialOffer;
if (typeof(WizardParam.EG_subtitleItalic) == 'undefined') this.EG_subtitleItalic='normal';else this.EG_subtitleItalic= WizardParam.EG_subtitleItalic;
if (typeof(WizardParam.EG_footerBold) == 'undefined') this.EG_footerBold='normal';else this.EG_footerBold= WizardParam.EG_footerBold;
if (typeof(WizardParam.EG_titleFontFamily) == 'undefined') this.EG_titleFontFamily='Tahoma';else this.EG_titleFontFamily= WizardParam.EG_titleFontFamily;
if (typeof(WizardParam.EG_onlineStatusColor) == 'undefined') this.EG_onlineStatusColor='fe4f00';else this.EG_onlineStatusColor= WizardParam.EG_onlineStatusColor;
if (typeof(WizardParam.EG_titleUnderline) == 'undefined') this.EG_titleUnderline='none';else this.EG_titleUnderline= WizardParam.EG_titleUnderline;
if (typeof(WizardParam.EG_SubCatID) == 'undefined') this.EG_SubCatID=0; else this.EG_SubCatID= WizardParam.EG_SubCatID; 
if (typeof(WizardParam.EG_subtitleBold) == 'undefined') this.EG_subtitleBold='normal';else this.EG_subtitleBold= WizardParam.EG_subtitleBold;
if (typeof(WizardParam.EG_titleText) == 'undefined') this.EG_titleText='Get advice today!';else this.EG_titleText= WizardParam.EG_titleText;
if (typeof(WizardParam.EG_imageSendRequest) == 'undefined') this.EG_imageSendRequest='/images/Affiliates/ExpertGrid/Buttons/size1_req_orange1.gif';else this.EG_imageSendRequest= WizardParam.EG_imageSendRequest;
if (typeof(WizardParam.EG_specialOfferType) == 'undefined') this.EG_specialOfferType=3; else this.EG_specialOfferType= WizardParam.EG_specialOfferType; 
if (typeof(WizardParam.EG_specialOfferLayout) == 'undefined') this.EG_specialOfferLayout=3; else this.EG_specialOfferLayout= WizardParam.EG_specialOfferLayout; 
if (typeof(WizardParam.EG_screenNameColor) == 'undefined') this.EG_screenNameColor='336699';else this.EG_screenNameColor= WizardParam.EG_screenNameColor;
if (typeof(WizardParam.EG_linksColor) == 'undefined') this.EG_linksColor='336699';else this.EG_linksColor= WizardParam.EG_linksColor;
if (typeof(WizardParam.EG_bgColor2) == 'undefined') this.EG_bgColor2='E5F3D9';else this.EG_bgColor2= WizardParam.EG_bgColor2;
if (typeof(WizardParam.EG_MainCatID) == 'undefined') this.EG_MainCatID=0; else this.EG_MainCatID= WizardParam.EG_MainCatID; 
if (typeof(WizardParam.EG_ShowRating) == 'undefined') this.EG_ShowRating=true;else this.EG_ShowRating= WizardParam.EG_ShowRating;
if (typeof(WizardParam.EG_subtitleUnderline) == 'undefined') this.EG_subtitleUnderline='none';else this.EG_subtitleUnderline= WizardParam.EG_subtitleUnderline;
if (typeof(WizardParam.EG_titleItalic) == 'undefined') this.EG_titleItalic='normal';else this.EG_titleItalic= WizardParam.EG_titleItalic;
if (typeof(WizardParam.EG_paramID) == 'undefined') this.EG_paramID=1; else this.EG_paramID= WizardParam.EG_paramID; 
if (typeof(WizardParam.EG_footerColor) == 'undefined') this.EG_footerColor='000000';else this.EG_footerColor= WizardParam.EG_footerColor;
if (typeof(WizardParam.EG_numExperts) == 'undefined') this.EG_numExperts=5; else this.EG_numExperts= WizardParam.EG_numExperts; 
if (typeof(WizardParam.EG_footerFontSize) == 'undefined') this.EG_footerFontSize='12pt';else this.EG_footerFontSize= WizardParam.EG_footerFontSize;
if (typeof(WizardParam.EG_headerBgColor) == 'undefined') this.EG_headerBgColor='E5F3D9';else this.EG_headerBgColor= WizardParam.EG_headerBgColor;
if (typeof(WizardParam.EG_subtitleText) == 'undefined') this.EG_subtitleText='Click below to get started now!';else this.EG_subtitleText= WizardParam.EG_subtitleText;
if (typeof(WizardParam.EG_footerFontFamily) == 'undefined') this.EG_footerFontFamily='Tahoma';else this.EG_footerFontFamily= WizardParam.EG_footerFontFamily;
if (typeof(WizardParam.EG_bgColor1) == 'undefined') this.EG_bgColor1='FFFFFF';else this.EG_bgColor1= WizardParam.EG_bgColor1;
if (typeof(WizardParam.EG_subtitleFontFamily) == 'undefined') this.EG_subtitleFontFamily='Tahoma';else this.EG_subtitleFontFamily= WizardParam.EG_subtitleFontFamily;
if (typeof(WizardParam.EG_borderColor) == 'undefined') this.EG_borderColor='C1DFAB';else this.EG_borderColor= WizardParam.EG_borderColor;
if (typeof(WizardParam.EG_titleBold) == 'undefined') this.EG_titleBold='normal';else this.EG_titleBold= WizardParam.EG_titleBold;
if (typeof(WizardParam.EG_textColor) == 'undefined') this.EG_textColor='000000';else this.EG_textColor= WizardParam.EG_textColor;
if (typeof(WizardParam.EG_footerText) == 'undefined') this.EG_footerText='Give one of our experts a try today!';else this.EG_footerText= WizardParam.EG_footerText;
if (typeof(WizardParam.EG_footerUnderline) == 'undefined') this.EG_footerUnderline='none';else this.EG_footerUnderline= WizardParam.EG_footerUnderline;
if (typeof(WizardParam.EG_footer) == 'undefined') this.EG_footer=3; else this.EG_footer= WizardParam.EG_footer; 
if (typeof(WizardParam.EG_footerItalic) == 'undefined') this.EG_footerItalic='normal';else this.EG_footerItalic= WizardParam.EG_footerItalic;
if (typeof(WizardParam.EG_ShowFee) == 'undefined') this.EG_ShowFee=true;else this.EG_ShowFee= WizardParam.EG_ShowFee;
}


function KasambaExpertsGrid_WizardParamEG30c72b0cfb514b708dfa001946eba9fd()
{
this.EG_id = new Array("761797","731958","425649","726927","500133","818940","606201","575016","166467","850629","225003","227883","482809","678559","194118");
this.EG_fullname = new Array("Love Psychic Delphi","Love Readings by Jeenifer","The Silent Strider","Spiritual Love Solutions","Spiritual Predictor","Mystic Knight","Spark n Aura","love psychic sara","Jaye","Blue Lagoon","Genuine Spiritual Master","AERIS","Psychic Love Readings","Stefans Psychic Soul","SHARAD KUMAR SONI");
this.EG_description = new Array("Present , future or past, get insightful,intuitive reading.fast honest and accurate answers from Psychic Advisor,I Specialize in Love relation,carrier and spells.","i will help you with the help of the spirit,and see into the future and control your present and make better decisions problems in every life.","No one is 100% accurate; I&#39;m about 85%-90% accurate. No matter what the situation, I&#39;ll try my very best to help.","Need guidance to find the kind of relationship that you've only been dreaming of? Then contact me for answers to all your problems.Very detailed and accurate reading.","Accurate insightful readings for your journey to peace and happiness, Come for the spiritual guidance to reap your future happiness.","I am a fifth generation God-gifted master psychic. I have helped countless people find their destiny, I can do the same for you.No sugar coating, you just need to contact me.","A Clairvoyant!I will compassionately foretell your fortune and spiritually uplift you.No sugar coating only honest answers!","99.9%accurate* Clairvoyant*Empathic* Truthful* Ethical* Experienced* Reliable* tarot*crystal*Compassionate* honest* Fast-Typer!","I use various skills to cater to many questions involving love and life. I give honest answers without judging to provide a significant psychic/spiritual experience.","Accurate,honest answers to any questions and discover your destiny. I am born Gifted psychic. I don't do free trials.","****** Hurry up!! Reduced price till CHRISTMAS *****   !Authentic Insight/NO Generic Bogus! Genuine Spiritual Master offers direction, solutions,spiritual guidance and blessin","Let me guild you to a BETTER tomarow find out what there realy THINKING and how to attain the blessings you deserve.FREE CONECTION AND MED","Clairvoyant, Honest, Genuine, Fast Psychic Reader. Straight to the point answers! Contact me only if u want to hear the TRUTH! Clear & Accurate.","Give me a chance to prove my PSYCHIC abilities. I will guide you through your problems and give you honesty an insight for the future in love,relationships and careers.","[15+ Years Experience] I am here visible the things that hard to be visible & Answer the questions that hard to Answered with the help of Spirituality & Religion.");
this.EG_picid = new Array("761797","731958","425649","726927","500133","818940","606201","575016","166467","850629","225003","227883","482809","678559","194118");
this.EG_ratingpic = new Array("9","9","9","9","9","10","10","8","10","9","9","9","9","10","9");
this.EG_ratersnumber = new Array("2466","1099","1422","1601","1830","2308","2541","436","3811","2563","7989","3570","2054","1688","6702");
this.EG_rating = new Array("4.708029","4.559599","4.47398","4.722673","4.64918","4.79766","4.766233","4.09633","4.880346","4.574717","4.636375","4.569467","4.464946","4.90699","4.474932");
this.EG_status = new Array("1","1","1","1","1","4","1","1","1","1","1","1","1","1","1");
this.EG_onlinefee = new Array("3.99","2.51","1.99","1.99","1.99","2.99","1.99","1.99","3.95","1.99","2.99","1.99","1.99","1.99","3.99");
this.EG_title = new Array("Mrs","","","","","","","","","","","","","","");
}

var WizardParam =  new EG30c72b0cfb514b708dfa001946eba9fd();
var ExpertGridObject_WizardParamEG30c72b0cfb514b708dfa001946eba9fd=  new WizardParamEG30c72b0cfb514b708dfa001946eba9fd();
var expertgrid_WizardParamEG30c72b0cfb514b708dfa001946eba9fd ;
function Start_WizardParamEG30c72b0cfb514b708dfa001946eba9fd(){if (typeof(ExpertGridObject_WizardParamEG30c72b0cfb514b708dfa001946eba9fd.EG_Disable_Render)== 'undefined') { EGrender(ExpertGridObject_WizardParamEG30c72b0cfb514b708dfa001946eba9fd,expertgrid_WizardParamEG30c72b0cfb514b708dfa001946eba9fd);}}
 Start_WizardParamEG30c72b0cfb514b708dfa001946eba9fd();


//Importent when changing this file the file \Affiliates\ShowExpertGrid.aspx on WEB Kasammba project need to be change too!!!!!

var Tel = "";

var noExpertsHtmlMsg; 
var noExpertsHtmlMsgHeight = 66;
//accumulated is the height of the non experts area in pixels. 
var accumulated=0; 

function EGgetExpertPicture(ExpertGridObject,expid, picID )
{
    var expPic = "";
    var imageURL = ExpertGridObject.EG_imageExpert.replace('{ExpertID}',expid);
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    expPic += "<a href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/professional/expert-profile.aspx?CatID=" + ExpertGridObject.EG_CatID +"&ExpID=" + expid +"\")' style='text-decoration:none; border-width:0px;' >";   
    expPic+=  "<img border='0' src='" + ExpertGridObject.EG_LP_Url + imageURL +"'></a>";
    return expPic;
}

function EGgetExperName (ExpertGridObject,expid, fullName, title,flglineHeight, numberOfChars)
{
    var expName = "";  
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;              
    expName += "<div style='padding-top:0px! important;margin-top:0px! important;'><a style='color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/professional/expert-profile.aspx?CatID=" + ExpertGridObject.EG_CatID +"&ExpID=" + expid +"\")'>";    
    if ((title != "") && (parseInt(ExpertGridObject.EG_MainCatID) == 10341)) //Professional Counseling
    {
        var nameAndTitle = fullName + " , " + title;
        if (numberOfChars != null)
        {
            nameAndTitle = cutString(ExpertGridObject,nameAndTitle, numberOfChars);  
        }      
        if (flglineHeight ==1) { expName += "<span style='line-height: 8pt;font-family:Arial; font-weight:bold; font-size:8pt;'>" + nameAndTitle +"</span></a><div/>";}
        if (flglineHeight ==0) { expName += "<span style='font-family:Arial; font-weight:bold; font-size:8pt;'>" + nameAndTitle +"</span></a><div/>";}
    }
    else
    {
         if (numberOfChars != null)
         {
            fullName = cutString(ExpertGridObject,fullName, numberOfChars);
         }
         
         if (flglineHeight ==1) { expName += "<span style='line-height: 8pt;font-family:Arial; font-weight:bold; font-size:8pt;'>"+ fullName +"</span></a></div>";}
         if (flglineHeight ==0) { expName += "<span style='font-family:Arial; font-weight:bold; font-size:8pt;'>"+ fullName +"</span></a></div>";}
    }
    return expName;
}

function EGgetExpertRating(ExpertGridObject,expid, rating, ratingPic, ratingNumber,flgNewLine)
{
    var ratingStr ="";
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
    if ( (ExpertGridObject.EG_ShowRating) && (parseInt(ratingNumber) > 0) )
    {       
        
        if ( flgNewLine == 1)
        {
            ratingStr += "<div><a  style='line-height: 1em;text-decoration:none; border-width:0px;'  href=javascript:KasambaEGopenRating(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + expid + ")>";
            ratingStr += "<img title=' "+ KasambaCurrencyFormatted(ExpertGridObject,rating , "")  +"' src='" + ExpertGridObject.EG_imageUrl + "/images/rating/rate" + ratingPic + ".gif'  style='text-decoration:none; border-width:0px;'  border='0' WIDTH='64' HEIGHT='12' align='absmiddle'></a></div>";
        }
         if ( flgNewLine == 0)
        {
            ratingStr += "<a  style='line-height: 1em;text-decoration:none; border-width:0px;'  href=javascript:KasambaEGopenRating(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + expid + ")>";
            ratingStr += "<img title=' "+ KasambaCurrencyFormatted(ExpertGridObject,rating , "")  +"' src='" + ExpertGridObject.EG_imageUrl + "/images/rating/rate" + ratingPic + ".gif'  style='text-decoration:none; border-width:0px;'  border='0' WIDTH='64' HEIGHT='12' align='absmiddle'></a>";
        } 
            
        
         if (parseInt(ratingNumber) == 1)
        {           
            ratingStr +=  "<span ><a style='line-height: 1.5em;font-family:Verdana; font-size:7pt;color:#"+ExpertGridObject.EG_linksColor+";' href=javascript:KasambaEGopenRating(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + expid + ")>(1 review)</a></span>";
        }
        else
        {            
            ratingStr +=  "<span ><a style='line-height: 1.5em;font-family:Verdana; font-size:7pt;color:#"+ExpertGridObject.EG_linksColor+";' href=javascript:KasambaEGopenRating(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + expid + ")>(" + ratingNumber + " reviews)</a></span>";
        }
    }
    return ratingStr;
}

function EGgetExpertDescription (ExpertGridObject,description)
{    
    return "<div style='line-height: 8pt;font-family:Verdana; font-size:7pt;color:#"+ExpertGridObject.EG_textColor+"'>" + description + "</div>";
}

function EGGetContactElement(ExpertGridObject,status, memberID)
{
    var contact ="";
    switch (parseInt(status))
    {
        case 0:
            contact +=EGgetOfflineContent(ExpertGridObject,memberID);
            break;
        case 1:
            contact +=EGgetOnlineContent(ExpertGridObject,memberID, false);
            break;
        case 2:
            contact +=EGgetBusyContent(ExpertGridObject,memberID);
            break;
        case 3:
            contact +=EGgetOfflineContent(ExpertGridObject,memberID);
            break;
        case 4:
            contact +=EGgetOnlineContent(ExpertGridObject,memberID, true);
            break;
        default:
            contact +=EGgetOfflineContent(ExpertGridObject,memberID);
            break; 
    }
    return contact;
}

function EGgetOfflineContent(ExpertGridObject,memberID)
{
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
    var offlineContent ="";   
    offlineContent += "<span style='text-decoration:none; border-width:0px;'><a href='javascript:KasambaEGOpenAskByMail(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + ExpertGridObject.EG_CatID + "," + memberID + ")' title='Send a request' style='text-decoration:none; border-width:0px;'><img src='"+ ExpertGridObject.EG_url + ExpertGridObject.EG_imageSendRequest +"' border='0' style='text-decoration:none; border-width:0px;'></a></span>";
    return offlineContent;
}

function EGgetOnlineContent(ExpertGridObject,memberID, phoneAndChat)
{
    var onlineContent ="";
    
    if (parseInt(ExpertGridObject.EG_paramID) == 1)
    {        
        onlineContent += "<span style='font-family:arial; font-weight:bold; font-size:14px; color:#"+ExpertGridObject.EG_onlineStatusColor+";text-decoration:none; border-width:0px;'>Online</span>";
    }
    if (ExpertGridObject.EG_phoneEnabled)
    {        
        onlineContent += "<div><img src='" + ExpertGridObject.EG_imageUrl + "/images/view1/Status/OnlineChat.gif' alt='Available for chat' title='Available for chat' border='0'></div>";
        if (phoneAndChat)
        {            
            onlineContent += "<div><img src='text-decoration:none; border-width:0px;'" + ExpertGridObject.EG_imageUrl + "/images/view1/Status/OnlinePhone.gif' alt='Available for phone' title='Available for phone' border='0'></div>";
        }
    }
    
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    onlineContent += "<span><a style='text-decoration:none; border-width:0px;' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/session/session-selector.aspx?ExpID=" + memberID + "&catID=" + ExpertGridObject.EG_CatID+ "\")' title='Contact Live!'><img style='text-decoration:none; border-width:0px;' src='"+ ExpertGridObject.EG_url + ExpertGridObject.EG_imageContactLive +"'  border='0'></a></span>";
    return onlineContent;
}

function EGgetonlineFee(ExpertGridObject,fee, status)
{
    if ((parseInt(status) == 1) || (parseInt(status) == 4)) 
    {
        if (ExpertGridObject.EG_ShowFee)
        {
            return "<span style='font-family:Tahoma; font-size:7pt;color:#"+ExpertGridObject.EG_textColor+"'>" + KasambaCurrencyFormatted(ExpertGridObject,fee, "$") + "/minute";
        }
        else
        {
            return "";
        }
    }
    else
    {
       return ""; 
    }
}

function EGgetBusyContent(ExpertGridObject,memberID)
{
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
    var busyContent ="";
    if (parseInt(ExpertGridObject.EG_paramID) == 1)
    {
        busyContent += "<span style='FONT-WEIGHT: bold; FONT-SIZE: 9pt;font-family:arial;color:#"+ExpertGridObject.EG_textColor+"'>Busy</span>";
    }    
    busyContent += "<span style='text-decoration:none; border-width:0px;'><a href='javascript:KasambaEGOpenAskByMail(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + "," + ExpertGridObject.EG_CatID + "," + memberID + ")' title='Send a request' style='text-decoration:none; border-width:0px;'><img src='" + ExpertGridObject.EG_LP_Url + "/images/view1/Status/Status_0.gif' border='0' WIDTH='122' HEIGHT='21' style='text-decoration:none; border-width:0px;'></a></span>";
    return busyContent;
}

function KasambaEGopenRating (UniqeKey,EG_ExpertGridShortCodeUniqeKey,memberID)
{
   var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
   var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
        
    }
    var ratingUrl = ExpertGridObject.EG_LP_Url + "/rating/expert-rating.aspx?i_MemID=" + memberID
	window.open(ratingUrl, 'rating', 'scrollbars=yes,height=400,width=450,menubar=no,resizable=yes,titlebar=no,toolbar=no,status=no');
}

function KasambaEGOpenAskByMail (UniqeKey,EG_ExpertGridShortCodeUniqeKey,categoryID, memberID)
{
   var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
   var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
        
    }
    
    var mailUrl = "";
    if(parseInt(ExpertGridObject.EG_specialOfferType)==2)
    {
        mailUrl = ExpertGridObject.EG_LP_Url + "/registration/send-email.aspx?CatID=" + categoryID +"&ExpID=" + memberID + "&twid=2&fm=yes&" + ExpertGridObject.EG_params;	   
    } 
    else
    {
	    mailUrl = ExpertGridObject.EG_LP_Url + "/registration/send-email.aspx?CatID=" + categoryID +"&ExpID=" + memberID + "&twid=2&" + ExpertGridObject.EG_params;	
	}
	
	if (ExpertGridObject.EG_AffliateID == 'CJ')
    {
        mailUrl = "http://www.jdoqocy.com/click-" + ExpertGridObject.EG_PID + "-" 
              + ExpertGridObject.EG_AID + "?URL=" + escape(mailUrl + "&accountRef=liveperson");
    }
    
	window.open(mailUrl);
}

function KasambaCurrencyFormatted(ExpertGridObject,amount, currencyStr)
{
	var kasamba_index = parseFloat(amount);
	if(isNaN(kasamba_index)) { kasamba_index = 0.00; }
	var kasamba_minus = '';
	if(kasamba_index < 0) { kasamba_minus = '-'; }
	kasamba_index = Math.abs(kasamba_index);
	kasamba_index = parseInt((kasamba_index + .005) * 100);
	kasamba_index = kasamba_index / 100;
	kasamba_str = new String(kasamba_index);
	if(kasamba_str.indexOf('.') < 0) { kasamba_str += '.00'; }
	if(kasamba_str.indexOf('.') == (kasamba_str.length - 2)) { kasamba_str += '0'; }
	kasamba_str = kasamba_minus + kasamba_str;
	return currencyStr + kasamba_str;
}

function EGrender(ExpertGridObject,expertgrid)
{   
    //In 125X125 first time show expert details
     var UniqeKey =   ExpertGridObject.EG_UniqeKey;
     var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
     
    if (parseInt(ExpertGridObject.EG_CatID) > 0) 
    {
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            EGrenderData(ExpertGridObject,expertgrid);
        }
        else
        {
            var sortBy = GetSortByValue(ExpertGridObject)
            var expertDataUrl = ExpertGridObject.EG_url + "/Affiliates/GetExpertsStringJS.aspx?CatID=" + ExpertGridObject.EG_CatID + "&SortBy=" + sortBy + "&PageNumber=1&PageSize=" + ExpertGridObject.EG_numExperts *3;
            var ifarmoutput =  '<iframe id="KasambaIframe" name="KasambaIframe" onload="EGrenderData(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")" width="1" height="1" frameborder="0" src="' + expertDataUrl + '"></iframe>';
            document.getElementById("output2").innerHTML = ifarmoutput;
        }
     }      
     else
     {
        EGrenderData(ExpertGridObject,expertgrid);
     } 
}


function EGrenderData(ExpertGridObject,expertgrid)
{       
    var header='';
    var footer='';
    var experts='';      
    
    var noExperts =false;
    var paddingHeight=0;      
   
    if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
    {
        expertgrid = ExpertGridObject.EG_RefToGrid;
    }  
    else if (parseInt(ExpertGridObject.EG_CatID) > 0) 
    {
        expertgrid=document.getElementById('KasambaIframe').contentWindow;        
    }   
     
    if (expertgrid!=null) 
    {       
        if (expertgrid.EG_id!=null)
        {          
            ExpertGridObject.EG_totalNumOfExperts = expertgrid.EG_id.length; 
        }
        else
        {
            noExperts =true;
        }      
    }       
   
    switch(ExpertGridObject.EG_header)
    {
        case 1 :
                    //do nothing- no header
                break;
        case 2:
                    header=getHeader500X618NoText(ExpertGridObject);        
                break; 
        case 3:
                    header=getHeader500X618WithText(ExpertGridObject); 
                break;
        case 4:
                    header=getHeader500X618TextWithIcon(ExpertGridObject,false);                          
                break;
        case 5:       
                    header=getHeader728X90WithIcon(ExpertGridObject,false);                          
                break;  
        case 6:       
                    header=getHeader728X90WithText(ExpertGridObject,false);                          
                break;
        case 7 :
                     header=getHeader120X600WithIcon(ExpertGridObject);  
                 break;
        case 8 :
                     header=getHeader468X60WithText(ExpertGridObject);  
                 break; 
        case 9 :
                     header=getHeader468X60NoText(ExpertGridObject);  
                 break;          
    }        

    ExpertGridObject.EG_expertsOutput = "";
    noExpertsHtmlMsg = "";
    
    switch(parseInt(ExpertGridObject.EG_paramID))
    {
        case 1 :                   
                calcExperts(ExpertGridObject);
                paddingHeight = calcPadding(ExpertGridObject,noExperts);             
                
                if (!noExperts)
                {                    
                    getExpertRows1(ExpertGridObject);   
                    experts= ExpertGridObject.EG_expertsOutput;                  
                }
                else 
                {
                    experts = getNoExpertMessageRow(ExpertGridObject);                   
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight; 
                }                     
                
                break;
        case 2:     
                calcExperts(ExpertGridObject);  
                paddingHeight = calcPadding(ExpertGridObject,noExperts);                       
                 if (!noExperts)
                {
                    
                    getExpertRows2(ExpertGridObject);   
                    experts= ExpertGridObject.EG_expertsOutput;                  
                }
                else 
                {
                    experts = getNoExpertMessageRow(ExpertGridObject);
                 
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight; 
                }                      
                break; 
        case 3:
                ExpertGridObject.EG_numExpertInPage = 1 ;
                if (!noExperts)
                {
                    if (ExpertGridObject.EG_NextShowPicture)
                    {
                        getExpertRows3Picture(ExpertGridObject);
                        ExpertGridObject.EG_NextShowPicture = false;     
                    }
                    else
                    {
                        getExpertRows3Details(ExpertGridObject);
                        ExpertGridObject.EG_NextShowPicture = true;
                    }
                    experts= ExpertGridObject.EG_expertsOutput;
                }
                else
                {
                    experts = getNoExpertMessageRow(ExpertGridObject);
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight;
                }
                
                
                if (!ExpertGridObject.EG_125X125TimerRunning)
                {
                    
                    ExpertGridObject.EG_125X125TimerRunning = true;
                    
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                    var strSetInterval = "setInterval("+"'Start_"+UniqeKey+"()',"+ExpertGridObject.EG_125X125RefreshTime+");";
                    eval (strSetInterval);
                    
                }
                break;
        case 4:    
                
                ExpertGridObject.EG_numExpertInPage = 2;       
                if (!noExperts)
                {
                    getExpertColumns1(ExpertGridObject); 
                    experts= ExpertGridObject.EG_expertsOutput;                
                }    
                else
                {
                    experts = getNoExpertsColumn1(ExpertGridObject,2*ExpertGridObject.EG_expertUnitWidth)                
                }      
                
                break;
        case 5:
                ExpertGridObject.EG_numExpertInPage = 1;
                if (!noExperts)
                {
                    getExpertColumns2(ExpertGridObject); 
                    experts= ExpertGridObject.EG_expertsOutput;                
                }    
                else
                {
                    experts = getNoExpertsColumn2(ExpertGridObject,ExpertGridObject.EG_expertUnitWidth)                
                }                                
                
                break;
        case 6:             
             
                calcExperts(ExpertGridObject);  
                paddingHeight = calcPadding(ExpertGridObject,noExperts);                       
                 if (!noExperts)
                {
                    
                    getExpertRows4(ExpertGridObject);   
                    experts= ExpertGridObject.EG_expertsOutput;                  
                }
                else 
                {
                    experts = getNoExpertMessageRow(ExpertGridObject);
                   
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight; 
                }      
                                     
               break;
        case 7:              
                
                calcExperts(ExpertGridObject);  
                paddingHeight = calcPadding(ExpertGridObject,noExperts);                       
                 if (!noExperts)
                {                   
                    getExpertRows5(ExpertGridObject);   
                    experts= ExpertGridObject.EG_expertsOutput;                  
                }
                else 
                {
                    
                    experts = getNoExpertMessageRow(ExpertGridObject);                   
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight; 
                }
                break;
        case 8:         
                calcExperts(ExpertGridObject);        
                paddingHeight = calcPadding(ExpertGridObject,noExperts);                       
                 if (!noExperts)
                {                   
                    getExpertRows6(ExpertGridObject);   
                    experts= ExpertGridObject.EG_expertsOutput;                  
                }
                else 
                {
                    experts = getNoExpertMessageRowByExpertHeight(ExpertGridObject);                   
                    paddingHeight = paddingHeight-noExpertsHtmlMsgHeight; 
                }                    
                break;
    }        
   
    switch(ExpertGridObject.EG_footer)
    { 
        case 1:
            //do nothing- no footer                                 
             break;         
        case 2:             
             footer=getFooter500X618NoText(ExpertGridObject);                      
             break;
        case 3: 
             footer=getFooter500X618WithText(ExpertGridObject);    
             break;
        case 4:
             footer=getFooter500X618Navigation(ExpertGridObject);  
             break; 
        case 5:
             footer=getFooter728X90(ExpertGridObject); 
             break;    
        case 6:
             footer=getFooter125X125(ExpertGridObject);       
             break;          
    }        
   
    if (paddingHeight>0)      
    {         
       footer+=getPadding(ExpertGridObject,paddingHeight);
    }      
    
    
    var output ="<table style='border-collapse: collapse; width:" + ExpertGridObject.EG_width + "px;height:" + ExpertGridObject.EG_height +"px;' cellpadding='0'  cellspacing='0'>";     
    output+=header + experts + footer;
    output+="</table>";     

    ExpertGridObject.EG_output = output;
    
    if (typeof(ExpertGridObject.EG_Disable_Render)== 'undefined')
    {
            document.getElementById(ExpertGridObject.EG_ExpertGridDiv).innerHTML  = ExpertGridObject.EG_output;
    }
    else
    {
        document.getElementById("output").innerHTML  = ExpertGridObject.EG_output;
    }
   
}

function getNoExpertsColumn1(ExpertGridObject,width)
{
    var message =""
    var textStyle="text-align:center;font-size:12px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "width:"+ width +"px;border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
       
    message = "<td valign='center' style='" + tdStyle + "'  >";
    message+= "No experts are registered in this sub-category. Please select another sub-category.</td>" 
    return message
}

function getNoExpertsColumn2(ExpertGridObject,width)
{
    var message =""
    var textStyle="text-align:center;font-size:12px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "width:"+ width +"px;background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
       
     //ExpertGridObject.EG_expertsOutput closes the html TR, Table, TD  that was started in the header function  Header468X60WithText or Header468X60NoText     
    message+=    "<td valign='center' style='" + tdStyle + "'  >No experts are registered in this sub-category. Please select another sub-category.</td>";
    message+=        "</tr>";
    message+=        "</table>";
    message+=    "</td>";  
    
    return message;      
}


function getNoExpertMessageRow(ExpertGridObject)
{
    var message =""
    var textStyle="text-align:center;font-size:12px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
       
    message= "<tr><td style='"+textStyle+";border:1px solid #"+ExpertGridObject.EG_borderColor+";height:65px;background-color:#"+ExpertGridObject.EG_bgColor1+";' >No experts are registered in this sub-category. Please select another sub-category.</td></tr>"
    
    return message;
}

function getNoExpertMessageRowByExpertHeight(ExpertGridObject)
{
    var message =""
    var textStyle="height:"+ ExpertGridObject.EG_expertUnitHeight +"px;text-align:center;font-size:12px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
       
    message= "<tr><td style='"+tdStyle+";' >No experts are registered in this sub-category. Please select another sub-category.</td></tr>"
    
    return message;
}

function calcExperts(ExpertGridObject)
{      
    accumulated = 0;
    if (ExpertGridObject.EG_headerUnitHeight>0)
        accumulated+=ExpertGridObject.EG_headerUnitHeight+1;           

    if (ExpertGridObject.EG_footerUnitHeight>0)
        accumulated+=ExpertGridObject.EG_footerUnitHeight+1 ;        

    if (ExpertGridObject.EG_navigationUnitHeight>0)
        accumulated+= ExpertGridObject.EG_navigationUnitHeight+ 1;  

    //the -1 is for the base border of the grid
    accumulated = ExpertGridObject.EG_height - accumulated -1 ; 
     //calculating how many experts are to be shown 
    //we add 1 pixel for the border of the expert unit.          
    calculatedNumberExperts = Math.floor( accumulated / (ExpertGridObject.EG_expertUnitHeight +1 ) )           
    
    if (ExpertGridObject.EG_totalNumOfExperts < calculatedNumberExperts && parseInt(ExpertGridObject.EG_CatID) > 0)
    {
       calculatedNumberExperts = ExpertGridObject.EG_totalNumOfExperts        
    }        
     
    //this parameter is crucial for this page   
    ExpertGridObject.EG_numExpertInPage = calculatedNumberExperts;
    
    //if no header and footer, add one expert.    
    if (ExpertGridObject.EG_header==1 && ( parseInt(ExpertGridObject.EG_paramID) == 1 || parseInt(ExpertGridObject.EG_paramID) == 2) )
    {    
          ExpertGridObject.EG_numExpertInPage += 1;
          accumulated = ExpertGridObject.EG_height - ExpertGridObject.EG_navigationUnitHeight-1  ;           
    }      
}

function calcPadding(ExpertGridObject,noExperts)
{                
  
    //-1 is for the base of the grid          
    ExpertGridObject.EG_padding = accumulated - ExpertGridObject.EG_numExpertInPage*(ExpertGridObject.EG_expertUnitHeight+1) - 1;           
    if ( parseInt(ExpertGridObject.EG_CatID) > 0)   
    { 
       
        if (noExperts)
        {
            
           if (parseInt(ExpertGridObject.EG_paramID) ==8 ) 
           {
                ExpertGridObject.EG_padding = 0; 
           }
           else
           {
           ExpertGridObject.EG_padding = accumulated;
           }
             
        }       
        else if (getActualNumberExperts(ExpertGridObject)<ExpertGridObject.EG_numExpertInPage )
        {                   
            ExpertGridObject.EG_padding =  accumulated - (getActualNumberExperts(ExpertGridObject))*(ExpertGridObject.EG_expertUnitHeight+1) - 1;    
        }   
    } 
   
   if (ExpertGridObject.EG_padding<0)
       ExpertGridObject.EG_padding=0;    
 
    return ExpertGridObject.EG_padding;   
}


function getFooter500X618Navigation(ExpertGridObject)
{    
    if (ExpertGridObject.EG_paramID==1 || ExpertGridObject.EG_paramID==2)     
    {   
        return getNavigation(ExpertGridObject);
    }
    else
    { 
        return getNavigation2Lines(ExpertGridObject);
    }
    return getNavigation2Lines(ExpertGridObject);
}

function getFooter500X618WithText(ExpertGridObject)
{        
     
     var footerOutput ="";       
     footerOutput+=getNavigation(ExpertGridObject);
     footerOutput+=getFooter(ExpertGridObject,false);      
     
     return footerOutput;
}

function getFooter500X618NoText(ExpertGridObject)
{      
    var footerOutput ="";  
    if (ExpertGridObject.EG_paramID==1 || ExpertGridObject.EG_paramID==2)     
    {   
        footerOutput+=getNavigation(ExpertGridObject);
    }
    else
    { 
        footerOutput+=getNavigation2Lines(ExpertGridObject);
    }
    footerOutput+=getFooter(ExpertGridObject,true);
    return footerOutput;            
}
       
function getExpertRowsCommon(ExpertGridObject,expertPicStyle, expertItemStyle)
{                                                                                
   
    
    for(var i=0;i<ExpertGridObject.EG_numExpertInPage;i++)
        {
            var tdStyleFixed = getExpertUnitSize(ExpertGridObject)+ "; font-family:arial; font-size:11px; font-weight:bold; text-align:center;color:#"+ExpertGridObject.EG_textColor+";";
            var tdStyle;
            if (i%2==0)
            {
                tdStyle ="border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";"+ tdStyleFixed;
            }
            else
            {
                tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor2+";"+ tdStyleFixed;
            } 
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td valign='center'  style='" + tdStyle +"' >";
            ExpertGridObject.EG_expertsOutput+=       "<table width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\"  >";
            ExpertGridObject.EG_expertsOutput+=            "<tr>";
            ExpertGridObject.EG_expertsOutput+=                   "<td style='"+ expertPicStyle +"'>";
            ExpertGridObject.EG_expertsOutput+=                        "<img src='" + ExpertGridObject.EG_url +"/" + ExpertGridObject.EG_imageDefaultExpert + "' border='0'/>";
            ExpertGridObject.EG_expertsOutput+=                   "</td>";
            ExpertGridObject.EG_expertsOutput+=                   "<td style='"+ expertItemStyle +"'>"
            ExpertGridObject.EG_expertsOutput+=                        "Expert's name and description will appear here."
            ExpertGridObject.EG_expertsOutput+=                   "</td>"
            ExpertGridObject.EG_expertsOutput+=              "</tr>"                               
            ExpertGridObject.EG_expertsOutput+=        "</table>"                          
            ExpertGridObject.EG_expertsOutput+=   "</td>"
            ExpertGridObject.EG_expertsOutput+= "</tr>"
        }
}



function  getExpertRows1(ExpertGridObject)
{
    
    ExpertGridObject.EG_expertsOutput = "";
   
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px;";
    var expertItemStyle = "border-width:0px; text-align:left;";
    
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {
        getExpertRowsCommon(ExpertGridObject,expertPicStyle, expertItemStyle)
    }
    else
    {       
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
       
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,expertgrid.EG_id.length)        
        
        
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  =  expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic =  expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  =  expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  =  expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status =  expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee =  expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title =  expertgrid.EG_title[i];
                   
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 120);
                  
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);
            } 
            
            ExpertGridObject.EG_expertsOutput+= "\n<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='middle' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table width='100%'  cellpadding='0' cellspacing='0' border='0'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr>";
            ExpertGridObject.EG_expertsOutput+=                   "<td width='93'><table cellpadding='0' cellspacing='0' border='0'>";
            ExpertGridObject.EG_expertsOutput+=                           "<tr><td  width='93' height='93' valign='middle' align='center' nowrap>";
            ExpertGridObject.EG_expertsOutput+=                                   EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID);       
            ExpertGridObject.EG_expertsOutput+=                               "</td><td><img SRC='" + ExpertGridObject.EG_LP_Url +"/images/trans.gif' width='4'></td>";
            ExpertGridObject.EG_expertsOutput+=                   "</tr></table></td>";
            ExpertGridObject.EG_expertsOutput+=                   "<td><table cellpadding='0' cellspacing='0' border='0'>";
            ExpertGridObject.EG_expertsOutput+=                                       "<tr><td align='left'>";
            ExpertGridObject.EG_expertsOutput+=                                           EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,0);           
            ExpertGridObject.EG_expertsOutput+=                                       "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=                                       "<tr><td align='left'>";
            ExpertGridObject.EG_expertsOutput+=                                           EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,0);
            ExpertGridObject.EG_expertsOutput+=                                       "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=                                       "<tr><td style=''>";
            ExpertGridObject.EG_expertsOutput+=                                           EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description);
            ExpertGridObject.EG_expertsOutput+=                                       "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=                                     "</table>";
            ExpertGridObject.EG_expertsOutput+=                   "</td>";
            ExpertGridObject.EG_expertsOutput+=                   "<td width='132' align='center' style='PADDING-RIGHT: 4px; PADDING-LEFT: 4px; VISIBILITY: visible;'>";
            ExpertGridObject.EG_expertsOutput+=                       EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID);
            ExpertGridObject.EG_expertsOutput+=                       "<br>" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status);
            ExpertGridObject.EG_expertsOutput+=                   "</td>";
            ExpertGridObject.EG_expertsOutput+=              "</tr>" ;                              
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>\n";
	    }  
	    expertgrid = null;
    }          
}

function  getExpertRows2(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";
    
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px;";    
    var expertItemStyle = "border-width:0px; text-align:left;padding-left:4px;";
    
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {
       getExpertRowsCommon(ExpertGridObject,expertPicStyle, expertItemStyle)
    }
    else
    {
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage; 
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,expertgrid.EG_id.length);                        
                               
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 60);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);
            } 
            
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='middle' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' width='100%'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td rowspan='5'  width='69' height='69' valign='middle' align='center' nowrap>";
            ExpertGridObject.EG_expertsOutput+=                 EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID);       
            ExpertGridObject.EG_expertsOutput+=            "</td>"; 
            ExpertGridObject.EG_expertsOutput+=            "<td rowspan='5' colspan='2' width='3'></td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='left' colspan='2'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,0) + "</td></tr>";    
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='left' colspan='2'>" + EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,0) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='left' colspan='2'>" + EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description) + "</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=            "<tr><td style='padding-left:30px;'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td><td  align='left' valign='middle'>" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>";   
	    }   
    }    
}

function getExpertTextOnly(ExpertGridObject,expertPicStyle, expertItemStyle)
{
    textStyle="font-size:11px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
     
    ExpertGridObject.EG_expertsOutput+= "<tr>";
    ExpertGridObject.EG_expertsOutput+=   "<td style='"+ tdStyle + ";" + getExpertUnitSize(ExpertGridObject)+ ";' valign='center' align='center' >";
    ExpertGridObject.EG_expertsOutput+=      "Expert's name and description will appear here.";                      
    ExpertGridObject.EG_expertsOutput+=   "</td>";
    ExpertGridObject.EG_expertsOutput+= "</tr>"; 
}

function getExpertPictureOnly(ExpertGridObject,expertPicStyle, expertItemStyle)
{
    textStyle="font-size:11px;font-family:arial;font-weight:bold;color:#"+ExpertGridObject.EG_textColor+";";
    var tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + textStyle ;
     
    ExpertGridObject.EG_expertsOutput+= "<tr>";
    ExpertGridObject.EG_expertsOutput+=   "<td style='"+ tdStyle + ";" + getExpertUnitSize(ExpertGridObject)+ ";' valign='center' align='center' >";
    ExpertGridObject.EG_expertsOutput+=      "<img src='" + ExpertGridObject.EG_url + "/images/Affiliates/ExpertGrid/man63X69_1.gif'/>";                     
    ExpertGridObject.EG_expertsOutput+=   "</td>";
    ExpertGridObject.EG_expertsOutput+= "</tr>"; 
}

function  getExpertRows3Details(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px; ";
    var expertItemStyle = "border-width:0px; text-align:left;";
    
    if (parseInt(ExpertGridObject.EG_CatID)== 0) 
    {
        getExpertTextOnly(ExpertGridObject,expertPicStyle, expertItemStyle);
    }
    else
    {        
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        
        endPoint = Min(endPoint,expertgrid.EG_id.length)
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 20);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode =" border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject) ;
            }
            else
            {
                styleCode =" border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject) ;            
            } 
            
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='top' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' width='100%' height='100%'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1, 10) + "</td></tr>";    
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,1) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='left' style='padding-left:3px;'>" + EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description) + "</td></tr>";           
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "   "  + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>";   
	    } 
    }
}

function  getExpertRows3Picture(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px; ";
    var expertItemStyle = "border-width:0px; text-align:left;";
    
    if (parseInt(ExpertGridObject.EG_CatID)== 0) 
    {
        getExpertPictureOnly(ExpertGridObject,expertPicStyle, expertItemStyle);
    }
    else
    {    
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,expertgrid.EG_id.length);
        
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];

            var styleCode ="";
            if (i%2==0)
            {
                styleCode =" border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject) ;
            }
            else
            {
                styleCode =" border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject) ;            
            } 
    
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='top' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' width='100%'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1, 10) + "</td></tr>";               
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>"; 
        }
    } 
}

function getVerticalRows(ExpertGridObject,expertPicStyle, expertItemStyle)
{
    
    
    for(var i=0;i<ExpertGridObject.EG_numExpertInPage;i++)
        {
            var tdStyleFixed = getExpertUnitSize(ExpertGridObject)+ ";font-family:tahoma; font-size:15px; font-weight:bold; text-align:center;color:#"+ExpertGridObject.EG_textColor+";";
            
            var tdStyle;
            if (i%2==0)
            {
                tdStyle ="border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + tdStyleFixed;
            }
            else
            {
                tdStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor2+";" + tdStyleFixed;
            }             
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td valign='top'  style='" + tdStyle +"' >";
            ExpertGridObject.EG_expertsOutput+=       "<table  width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\"  >";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td height='12px'></td></tr>";            
            ExpertGridObject.EG_expertsOutput+=            "<tr>";
            ExpertGridObject.EG_expertsOutput+=                   "<td style='"+ expertPicStyle +"'>";
            ExpertGridObject.EG_expertsOutput+=                        "<img src='" + ExpertGridObject.EG_url +"/" + ExpertGridObject.EG_imageDefaultExpert + "' border='0'/>";
            ExpertGridObject.EG_expertsOutput+=                   "</td>";
            ExpertGridObject.EG_expertsOutput+=            "</tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr>";
            ExpertGridObject.EG_expertsOutput+=                   "<td style='"+ expertItemStyle +"'>"
            ExpertGridObject.EG_expertsOutput+=                        "Expert's name and description will appear here."
            ExpertGridObject.EG_expertsOutput+=                   "</td>"
            ExpertGridObject.EG_expertsOutput+=              "</tr>"                               
            ExpertGridObject.EG_expertsOutput+=        "</table>"                          
            ExpertGridObject.EG_expertsOutput+=   "</td>"
            ExpertGridObject.EG_expertsOutput+= "</tr>"
        }
}

function  getExpertRows4(ExpertGridObject)
{
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px; width:86px;";
    var expertItemStyle = "border-width:0px; text-align:left;padding-left:11px;"; 
    
    ExpertGridObject.EG_expertsOutput = ""
    if (parseInt(ExpertGridObject.EG_CatID)== 0) 
    {
        getVerticalRows(ExpertGridObject,expertPicStyle, expertItemStyle)
    }
    else
    {
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
                         endPoint = Min(endPoint,expertgrid.EG_id.length)
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 70);
            ExpertGridObject.EG_description = SplitLargeWord(ExpertGridObject,ExpertGridObject.EG_description,11);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);           
            } 
            
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='top' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' width='100%' height='100%'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1, 20) + "</td></tr>";    
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,0) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr>";
            ExpertGridObject.EG_expertsOutput+=                "<td  width='69' height='69' valign='middle' align='center' nowrap>" + EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID);  +"</td>";
            ExpertGridObject.EG_expertsOutput+=                "<td width='3'></td>";
            ExpertGridObject.EG_expertsOutput+=                "<td>" + EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description) + "</td>";
            ExpertGridObject.EG_expertsOutput+=            "</tr>"; 
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>";  
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>";   
	    } 
    }
}

function  getExpertRows5(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";
 
    var expertPicStyle = "text-align:left; padding-left:11px; ";
    var expertItemStyle = "text-align:center;"; 
       
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {
        getVerticalRows(ExpertGridObject,expertPicStyle, expertItemStyle)
    }
    else
    {
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
                        endPoint = Min(endPoint,expertgrid.EG_id.length)
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 80);
            ExpertGridObject.EG_description = SplitLargeWord(ExpertGridObject,ExpertGridObject.EG_description,18);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);           
            } 
            
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='top'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' height='100%'>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'  height='85' colspan='3'>" + EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID) + "</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1, 15) + "</td></tr>";    
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,1) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td colspan='3'>"+ EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center' colspan='3'>" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>";  
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>";   
	    } 
    }
    
}

function  getExpertRows6(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";
    
    var expertPicStyle = "text-align:center;";
    var expertItemStyle = "text-align:center;padding-top:10px";  
    
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {
         getVerticalRows(ExpertGridObject,expertPicStyle, expertItemStyle)
    }
    else
    {        
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,expertgrid.EG_id.length)        
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 50);
            ExpertGridObject.EG_description = SplitLargeWord(ExpertGridObject,ExpertGridObject.EG_description,18);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);       
            } 
            
            ExpertGridObject.EG_expertsOutput+= "<tr>";
            ExpertGridObject.EG_expertsOutput+=   "<td style='"+ styleCode + "' valign='top' align='left'>";
            ExpertGridObject.EG_expertsOutput+=       "<table cellpadding='0' cellspacing='0' width='100%' borde='1' height='99%'>";
            
            
            ExpertGridObject.EG_expertsOutput+=            "<tr><td  height='85' valign='middle' align='center' nowrap>" + EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID);  +"</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'  style='padding-top:0px! important;margin-top:0px! important;'>" + EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1,15) + "</td></tr>";    
            
            
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,1) + "</td></tr>";
            
            
            ExpertGridObject.EG_expertsOutput+=            "<tr><td style='padding-left:3px;'>"+ EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description) + "</td></tr>";
            
            
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=            "<tr><td align='center'>" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>";  
            ExpertGridObject.EG_expertsOutput+=        "</table>";                          
            ExpertGridObject.EG_expertsOutput+=   "</td>";
            ExpertGridObject.EG_expertsOutput+= "</tr>";   
	    }
    }
}

function getHeaderUnitSize(ExpertGridObject)
{
    return "width: "+ ExpertGridObject.EG_headerUnitWidth + "px;height:" + ExpertGridObject.EG_headerUnitHeight+"px";
}

function getExpertUnitSize(ExpertGridObject)
{
    var unitSize = "";
    //ExpertGridObject.EG_width - 2: 2 for the 2 pixels of the border
    if (parseInt(ExpertGridObject.EG_paramID) == 1)
    {
       unitSize = "height:" + ExpertGridObject.EG_expertUnitHeight +"px;width:" + (ExpertGridObject.EG_width - 2) +"px"; 
    }
    else
    {
        unitSize = "height:" + ExpertGridObject.EG_expertUnitHeight +"px;width:" + ExpertGridObject.EG_expertUnitWidth +"px";
    }
    return unitSize
}    


function getHeader728X90WithIcon(ExpertGridObject)
{
    var output="";
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    
    var URL = URLFormat(ExpertGridObject);
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }
    var SpecialOfferURL = ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID ;        
    var link = "<a style='font-family:tahoma;font-size:9px;border-width:0px;border-width:0px;  text-decoration:none;color:#"+ExpertGridObject.EG_titleColor+";' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' >Powered by <span style='font-family:arial black;font-size:9px;color:#"+ExpertGridObject.EG_titleColor+";'>LivePerson</span></a>"  
        
    output+="<td nowrap valign='top' style='line-height:1em;border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_headerBgColor+";"+ getHeaderUnitSize(ExpertGridObject) +"' align='center'><div><a  href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ SpecialOfferURL + "\")' style='text-decoration:none; border-width:0px;'><img  src=\"" + ExpertGridObject.EG_url + ExpertGridObject.EG_imageSpecialOffer + "\" /></a></div>";
    
    output+="<span>" + link + "</span>";
    output+="</td>";
    
    return output;
}

function getHeader728X90WithText(ExpertGridObject)
{  
    var headerTextStyle = "color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +";border-width:0px;text-decoration:" + ExpertGridObject.EG_titleUnderline + ";";
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    var categoryLink = "<a style='" + headerTextStyle +"' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID +"\")'>" + ExpertGridObject.EG_titleText + "</a>";
    var output="";
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;   

    var URL = URLFormat(ExpertGridObject);  
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }         
    var link = "<a style='border-width:0px;font-family:tahoma;font-size:9px;text-decoration:none;color:#"+ExpertGridObject.EG_titleColor+";' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' >Powered by <span style='font-family:arial black;font-size:9px;color:#"+ExpertGridObject.EG_titleColor+";'>LivePerson</span></a>"         
    
    output+="<tr><td style='border:1px solid #"+ExpertGridObject.EG_borderColor+";"+ getHeaderUnitSize(ExpertGridObject) + ";background-color:#"+ExpertGridObject.EG_headerBgColor+"' ><table style='" + getHeaderUnitSize(ExpertGridObject)+";' border='0' cellpadding='0' cellspacing='0' >";
    output+=          "<tr><td valign='center' style='border-width:1px;text-align:center;'>" + categoryLink +"</td></tr>";
    output+=          "</tr><td valign='bottom'><span>" + link + "</span><td></tr>";
    output+=          "</table></td>";
    return output;        
}

function  getExpertColumns1(ExpertGridObject)
{
    ExpertGridObject.EG_expertsOutput = "";    
    var expertPicStyle = "border-width:0px; text-align:left; padding-left:11px; width:86px;";
    var expertItemStyle = "border-width:0px; text-align:left;";
    
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {        
        
        for(var i=0;i<ExpertGridObject.EG_numExpertInPage;i++)
        {
            if (i%2==0)
            {
                ExpertGridObject.EG_expertsOutput+=   "<td valign='center'  style='border:1px solid #"+ExpertGridObject.EG_borderColor+";vertical-align:center;text-align:center;font-weight:bold;font-size:15px;font-family:tahoma;color:#"+ExpertGridObject.EG_textColor+";background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject) + "'  >";
                ExpertGridObject.EG_expertsOutput+=       "<table width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\"  >";
                ExpertGridObject.EG_expertsOutput+=            "<tr>";
                ExpertGridObject.EG_expertsOutput+=                   "<td style='" + expertPicStyle + "'>";
                ExpertGridObject.EG_expertsOutput+=                        "<img src='" + ExpertGridObject.EG_url +"/" + ExpertGridObject.EG_imageDefaultExpert + "' border='0'/>";
                ExpertGridObject.EG_expertsOutput+=                   "</td>";
                ExpertGridObject.EG_expertsOutput+=                   "<td style='border-width:0px;text-align:left;'>"
                ExpertGridObject.EG_expertsOutput+=                        "Expert's name and description will appear here."
                ExpertGridObject.EG_expertsOutput+=                   "</td>"
                ExpertGridObject.EG_expertsOutput+=              "</tr>"                               
                ExpertGridObject.EG_expertsOutput+=        "</table>"                          
                ExpertGridObject.EG_expertsOutput+=   "</td>"
            }
            else
            {
                ExpertGridObject.EG_expertsOutput+=   "<td valign=\"center\" style='border:1px solid #"+ExpertGridObject.EG_borderColor+";border-right-width:0px; vertical-align:center;text-align:center;font-weight:bold;font-size:15px;font-family:tahoma;color:#"+ExpertGridObject.EG_textColor+";background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject)+ "' >";
                ExpertGridObject.EG_expertsOutput+=       "<table width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\"  >";
                ExpertGridObject.EG_expertsOutput+=            "<tr>";
                ExpertGridObject.EG_expertsOutput+=                   "<td style='" + expertPicStyle + "'>";
                ExpertGridObject.EG_expertsOutput+=                        "<img src='" + ExpertGridObject.EG_url +"/" + ExpertGridObject.EG_imageDefaultExpert + "' border='0'/>";
                ExpertGridObject.EG_expertsOutput+=                   "</td>";
                ExpertGridObject.EG_expertsOutput+=                   "<td style='border-width:0px;text-align:left;'>"
                ExpertGridObject.EG_expertsOutput+=                        "Expert's name and description will appear here."
                ExpertGridObject.EG_expertsOutput+=                   "</td>"
                ExpertGridObject.EG_expertsOutput+=              "</tr>"                               
                ExpertGridObject.EG_expertsOutput+=        "</table>"                          
                ExpertGridObject.EG_expertsOutput+=   "</td>"  
            }
        }
    }
    else
    {
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
                
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,ExpertGridObject.EG_totalNumOfExperts)    ;
    
        
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_fullName = cutString(ExpertGridObject,ExpertGridObject.EG_fullName, 20);
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 50);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+";border-right: none 0px; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject) 
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+";border-right: none 0px; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject) 
            } 
            
            ExpertGridObject.EG_expertsOutput+=   "<td valign='center' style='" + styleCode +"' >";
            ExpertGridObject.EG_expertsOutput+=       "<table width='100%' cellpadding='0' cellspacing='0'>";
            ExpertGridObject.EG_expertsOutput+=          "<tr><td rowspan='5'  width='88' height='88' valign='middle' align='center' nowrap>"
            ExpertGridObject.EG_expertsOutput+=                     EGgetExpertPicture(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_picID);            
            ExpertGridObject.EG_expertsOutput+=              "</td>";
            ExpertGridObject.EG_expertsOutput+=              "<td rowspan='5' width='1' colspan='2'></td></tr>";
            ExpertGridObject.EG_expertsOutput+=              "<td align='left' colspan='2'>";
            ExpertGridObject.EG_expertsOutput+=                   EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1);         
            ExpertGridObject.EG_expertsOutput+=           "</td></tr>"; 
            ExpertGridObject.EG_expertsOutput+=           "<tr><td align='left' colspan='2'>";
            ExpertGridObject.EG_expertsOutput+=                   EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,0);
            ExpertGridObject.EG_expertsOutput+=           "</td></tr>"
            ExpertGridObject.EG_expertsOutput+=           "<tr><td align='left' colspan='2'>";
            ExpertGridObject.EG_expertsOutput+=                    EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description);
            ExpertGridObject.EG_expertsOutput+=           "</td></tr>" ;
            ExpertGridObject.EG_expertsOutput+=           "<tr><td align='center'>" + EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td><td align='middle' align='left'>"  + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) + "</td></tr>";
            ExpertGridObject.EG_expertsOutput+=        "</table>";
            ExpertGridObject.EG_expertsOutput+=   "</td>"; 
	    }  
    }    
}

function getHeader468X60WithText(ExpertGridObject)
{
        var UniqeKey =   ExpertGridObject.EG_UniqeKey;
        var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
        var headerTextStyle = "color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +"; text-decoration:" + ExpertGridObject.EG_titleUnderline + ";";
        var categoryLink = "<span style='" + headerTextStyle +"'>" + ExpertGridObject.EG_titleText + "</span>";
        var header ="";
        header+=   "<td valign='center' style='border:1px solid #"+ExpertGridObject.EG_borderColor+"' >";
        header+=       "<table width='100%'   cellpadding='0' cellspacing='0'>"; 
        header+=        "<tr>"        
        header+=        "<td valign='top' style='text-align:center;cursor:pointer;border-right:1px solid #"+ExpertGridObject.EG_borderColor+";" + getHeaderUnitSize(ExpertGridObject)+ ";background-repeat:no-repeat; background-image:url("+ ExpertGridObject.EG_url + "/images/Affiliates/ExpertGrid/man191X60lpsn.JPG)' onclick='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID +"\")'>" + categoryLink + "</td>";         
        return header; 
}

function getHeader468X60NoText(ExpertGridObject)
{
        var UniqeKey =   ExpertGridObject.EG_UniqeKey;
        var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
        var header ="";
        header+=   "<td valign='center' style='border:1px solid #"+ExpertGridObject.EG_borderColor+"' >";
        header+=       "<table width='100%'   cellpadding='0' cellspacing='0'>"; 
        header+=        "<tr>"        
        header+=        "<td valign='top' style='border-right:1px solid #"+ExpertGridObject.EG_borderColor+";cursor:pointer;" + getHeaderUnitSize(ExpertGridObject)+ ";background-repeat:no-repeat; background-image:url("+ ExpertGridObject.EG_url + "/images/Affiliates/ExpertGrid/man191X60lpsn.JPG)' onclick='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/default.aspx\")'>&nbsp;</td>";         
        return header;
        
}

function  getExpertColumns2(ExpertGridObject)
{   
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    var headerTextStyle = "color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +"; text-decoration:" + ExpertGridObject.EG_titleUnderline + ";";
    var categoryLink = "<a style='" + headerTextStyle +"' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID +"\")'>" + ExpertGridObject.EG_titleText + "</a>";
    ExpertGridObject.EG_expertsOutput ="";     
    if (parseInt(ExpertGridObject.EG_CatID) == 0) 
    {                   
        //ExpertGridObject.EG_expertsOutput closes the html TR, Table, TD  that was started in the header function  Header468X60WithText or Header468X60NoText     
        ExpertGridObject.EG_expertsOutput+=    "<td style='width:" + ExpertGridObject.EG_expertUnitWidth + "px;background-color:#"+ExpertGridObject.EG_bgColor2+";color:#"+ExpertGridObject.EG_textColor+";' align='center'>Expert's name and description will appear here.</td>";
        ExpertGridObject.EG_expertsOutput+=        "</tr>";
        ExpertGridObject.EG_expertsOutput+=        "</table>";
        ExpertGridObject.EG_expertsOutput+=    "</td>";  
                  
	     
    }
    else
    {        
        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        
        var startPoint = (ExpertGridObject.EG_pageNumber-1) * ExpertGridObject.EG_numExpertInPage;
        
        var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
        endPoint = Min(endPoint,expertgrid.EG_id.length)
        for(var i=startPoint;i<endPoint;i++)
        {
            ExpertGridObject.EG_expID  = expertgrid.EG_id[i];
            ExpertGridObject.EG_fullName = expertgrid.EG_fullname[i];
            ExpertGridObject.EG_description  = expertgrid.EG_description[i];
            ExpertGridObject.EG_picID  = expertgrid.EG_picid[i];
            ExpertGridObject.EG_ratingPic  = expertgrid.EG_ratingpic[i];
            ExpertGridObject.EG_rating  = expertgrid.EG_rating[i];
            ExpertGridObject.EG_ratingNumber  = expertgrid.EG_ratersnumber[i];
            ExpertGridObject.EG_status  = expertgrid.EG_status[i];
            ExpertGridObject.EG_onlineFee  = expertgrid.EG_onlinefee[i];
            ExpertGridObject.EG_title  = expertgrid.EG_title[i];
            
            ExpertGridObject.EG_description = cutString(ExpertGridObject,ExpertGridObject.EG_description, 40);
            
            var styleCode ="";
            if (i%2==0)
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor1+";" + getExpertUnitSize(ExpertGridObject);
            }
            else
            {
                styleCode ="border:1px solid #"+ExpertGridObject.EG_borderColor+"; background-color:#"+ExpertGridObject.EG_bgColor2+";" + getExpertUnitSize(ExpertGridObject);
            }
            
            //ExpertGridObject.EG_expertsOutput closes the html TR, Table, TD  that was started in the header function  Header468X60WithText or Header468X60NoText     
            
            ExpertGridObject.EG_expertsOutput+= "<td style='height:" + ExpertGridObject.EG_expertUnitHeight + "px;width:" + ExpertGridObject.EG_expertUnitWidth + "px;background-color:#"+ExpertGridObject.EG_bgColor2+";color:#"+ExpertGridObject.EG_textColor+";' align='center'>";  
            ExpertGridObject.EG_expertsOutput+= EGgetExperName(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_fullName, ExpertGridObject.EG_title,1);
            ExpertGridObject.EG_expertsOutput+= EGgetExpertRating(ExpertGridObject,ExpertGridObject.EG_expID, ExpertGridObject.EG_rating, ExpertGridObject.EG_ratingPic, ExpertGridObject.EG_ratingNumber,0) +" " + EGgetExpertDescription(ExpertGridObject,ExpertGridObject.EG_description);
            ExpertGridObject.EG_expertsOutput+= "<table border=0 cellspacing=0 cellpadding=0><tr><td>"
            ExpertGridObject.EG_expertsOutput+= EGGetContactElement(ExpertGridObject,ExpertGridObject.EG_status, ExpertGridObject.EG_expID) + "</td>" ;
            ExpertGridObject.EG_expertsOutput+= "<td>&nbsp;" + EGgetonlineFee(ExpertGridObject,ExpertGridObject.EG_onlineFee, ExpertGridObject.EG_status) +" &nbsp;&nbsp;";
            
            
            if (parseInt(ExpertGridObject.EG_CatID) > 0)
            {
                ExpertGridObject.EG_expertsOutput +=    "&nbsp;&nbsp;&nbsp;&nbsp;";
                
                if (ExpertGridObject.EG_pageNumber==2 ||ExpertGridObject.EG_pageNumber==3)
                {   
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                    var PageNum = ExpertGridObject.EG_pageNumber;
                    ExpertGridObject.EG_expertsOutput +=    "<a style='font-family:tahoma; font-size:8px;' href='javascript:PreviousPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&lt;</a>&nbsp;&nbsp;";
                }
                else
                {
                    ExpertGridObject.EG_expertsOutput +=    "&nbsp;&nbsp;&nbsp;&nbsp;";
                }
                
                var expertgrid;
                if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
                {                    
                    expertgrid = ExpertGridObject.EG_RefToGrid;
                }  
                else
                {
                    expertgrid=document.getElementById('KasambaIframe').contentWindow;
                }
                
                if (ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage < expertgrid.EG_id.length && ExpertGridObject.EG_pageNumber<3)                              
                {
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                    var PageNum = ExpertGridObject.EG_pageNumber;
                    ExpertGridObject.EG_expertsOutput +=    "&nbsp;<a style='font-family:tahoma; font-size:10px;' href='javascript:NextPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&gt;</a>";              
                }
                else
                {  
                    if (ExpertGridObject.EG_ViewAllUrl!='')
                    {
                        var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                        var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                        ExpertGridObject.EG_expertsOutput +=    "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>See all&gt;</a>";             
                    }
                    else
                    {
                        ExpertGridObject.EG_expertsOutput +=    "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='' >See all&gt;</a>";             
                    }
                }
            }         
            ExpertGridObject.EG_expertsOutput+="</td></tr></table>"
            ExpertGridObject.EG_expertsOutput+="</td></tr>";
            ExpertGridObject.EG_expertsOutput+=        "</table>";
            ExpertGridObject.EG_expertsOutput+=   "</td>"; 
	    }  
    } 
}

function getFooter728X90(ExpertGridObject)
{       
    var column ="";                  
    column+= "<td valign=\"bottom\"  style='border:1px solid #"+ExpertGridObject.EG_borderColor+";background-color:#"+ExpertGridObject.EG_bgColor2+";border-left-width:0px; width:" + ExpertGridObject.EG_navigationUnitWidth +"px;height:"+ ExpertGridObject.EG_navigationUnitHeight + ";'  nowrap>" 
    if (parseInt(ExpertGridObject.EG_CatID) > 0)
    {
        if (ExpertGridObject.EG_pageNumber==2 ||ExpertGridObject.EG_pageNumber==3)
        {
            var UniqeKey =   ExpertGridObject.EG_UniqeKey;
            var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
            var PageNum = ExpertGridObject.EG_pageNumber;
            column+=    "<a style='color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:PreviousPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&lt;</a>&nbsp;&nbsp;";
        }
        else
        {
         column+=    "&nbsp;&nbsp;&nbsp;&nbsp;";
        }

        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
       
        if (ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage < ExpertGridObject.EG_totalNumOfExperts&& ExpertGridObject.EG_pageNumber<3)
        {
            var UniqeKey =   ExpertGridObject.EG_UniqeKey;
            var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
            var PageNum = ExpertGridObject.EG_pageNumber;
            column+=    "<a style='color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:NextPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&gt;</a>";              
        }
        else
        {   
            if (ExpertGridObject.EG_ViewAllUrl!='')
            {
                var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                column+=    "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>See all</a>";             
            } 
            else
            {
                column+=    "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href=''>See all</a>";             
            }
        }
    }
    column+= "</td>";
    
    return column
}

function getFooter125X125(ExpertGridObject)
{
    var  navigation="";
    
    var  navigationStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";height:" + ExpertGridObject.EG_navigationUnitHeight + "px; background-color:#"+ExpertGridObject.EG_bgColor2+";width:1125px";
    
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;   
    var URL = URLFormat(ExpertGridObject);
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }
    var link = "<a style='line-height: 11px;color:#"+ExpertGridObject.EG_screenNameColor+"; font-family:tahoma; font-size:8px;border-width:0px;text-decoration:none;' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' >Powered by <span style='line-height: 11px;font-family:arial black; font-size:8px;'>LivePerson</span></a>";  
  
    navigation+= "<tr>"
    navigation+=    "<td  style='" + navigationStyle + "' align='center' >";   
    if ((parseInt(ExpertGridObject.EG_CatID) > 0)&& (ExpertGridObject.EG_profileMode=='Wizard'))
    {
       var UniqeKey =   ExpertGridObject.EG_UniqeKey;
       var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;                     
       navigation+=  "<div><a style='line-height: 8px;font-family:tahoma; font-size:8px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'> View all experts</a></div>"
       
    }       
    navigation+=         link;            
    navigation+=     "</td>";
    navigation+= "</tr>";      
    
    return navigation;      
}

function getPadding(ExpertGridObject,paddingHeight)
{

    var padding = "";
    padding = "<tr>";          
    padding+="<td style='border:1px solid #"+ExpertGridObject.EG_borderColor+";height:" + paddingHeight + "px'>";    
    padding+="</td></tr>";   
  
    return padding;     

}

function getHeader500X618WithText(ExpertGridObject)
{  
    var header ="" 
    var headerStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";" + getHeaderUnitSize(ExpertGridObject) + "; background-color:#"+ExpertGridObject.EG_headerBgColor+";text-align:center; border-width:1px;";
    var headerTextStyle = "color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +";border-width:0px; text-decoration:" + ExpertGridObject.EG_titleUnderline + ";";
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    var categoryLink = "<a style='" + headerTextStyle +"' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID +"\")'>" + ExpertGridObject.EG_titleText + "</a>";
    
    header+= "<tr><td  style='" + headerStyle + "'>";   
    header+= categoryLink;
    if ((parseInt(ExpertGridObject.EG_paramID) == 1) || (parseInt(ExpertGridObject.EG_paramID) == 2))
    {
          var subtitleStyle = "color:#"+ExpertGridObject.EG_subtitleColor+"; font-family:" + ExpertGridObject.EG_subtitleFontFamily + "; font-size:" + ExpertGridObject.EG_subtitleFontSize +"; font-style:"+ ExpertGridObject.EG_subtitleItalic +"; font-weight:" + ExpertGridObject.EG_subtitleBold +"; text-decoration:" + ExpertGridObject.EG_subtitleUnderline + ";" ;
          header+= "<br/><span style='" + subtitleStyle + "'>" + ExpertGridObject.EG_subtitleText;
    } 
    
    header+= "</td></tr>"; 
     
    return header;                   
}


function getHeader500X618NoText(ExpertGridObject)
    {
    var header = "";
    var headerStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";" + getHeaderUnitSize(ExpertGridObject) + "; background-color:#"+ExpertGridObject.EG_headerBgColor+"; color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +"; text-decoration:" + ExpertGridObject.EG_titleUnderline + "; text-align:center; border-width:1px;";
    header = "<tr>";          
         
    header+="<td  style='" + headerStyle + "'>&nbsp;";   
    header+="</td></tr>";   
  
    return header;                    
}

function getHeader120X600WithIcon(ExpertGridObject)
{   
     var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
    var header = "";
    var headerStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";" + getHeaderUnitSize(ExpertGridObject) + ";";
    var SpecialOfferURL = ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID ;
    header = "<tr>";          
   
    header+="<td  style='" + headerStyle + "'>";
     
    header+="<a  href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ SpecialOfferURL + "\")' style='text-decoration:none; border-width:0px;'><img src=\"" + ExpertGridObject.EG_url + ExpertGridObject.EG_imageSpecialOffer + "\" border=\"0\" /></a>";                  
         
    header+="</td></tr>";   
  
    return header;                    
}

function getNavigationColor(ExpertGridObject)
{
    var navigationColor = ExpertGridObject.EG_bgColor2;
    if (ExpertGridObject.EG_numExpertInPage%2 == 0)
    {
        navigationColor = ExpertGridObject.EG_bgColor1;
    }   
     return navigationColor;
}

function getFooterBgColor(ExpertGridObject)
{
    var footerBgColor = ExpertGridObject.EG_bgColor1;
    if (ExpertGridObject.EG_numExpertInPage%2 == 0)
    {
        footerBgColor = ExpertGridObject.EG_bgColor2;
    }   
     return footerBgColor;
}

function getNavigation(ExpertGridObject)
{      
    var navigationColor = getNavigationColor(ExpertGridObject);
    var navigation="";
    var navigationStyle = "height:" + ExpertGridObject.EG_navigationUnitHeight + "px; background-color:#"+navigationColor+";font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor;
    var logoStyle = "display:inline;font-family:arial black; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor;
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey; 
    
    var URL = URLFormat(ExpertGridObject);
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }
                     
    var link = "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor +";border-width:0px;text-decoration:none;' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' nowrap>Powered by <span style='" +logoStyle + "'>LivePerson</span></a>";       
    
    navigation+= "<tr><td style='border:1px #"+ ExpertGridObject.EG_borderColor+ " solid'>\n<table width='100%' cellpadding='0' cellspacing='0'><tr>"
    if (parseInt(ExpertGridObject.EG_CatID) > 0)
    {
        if ((ExpertGridObject.EG_pageNumber==2 ||ExpertGridObject.EG_pageNumber==3)&&ExpertGridObject.EG_paramID!=8)
        {
            var PageNum = ExpertGridObject.EG_pageNumber;                        
            navigation+=    "<td  width='70' style='" + navigationStyle + "' align='center' >&nbsp;<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:PreviousPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&lt;&lt;Previous</a></td>";              
        }
        else 
        {            
            navigation+=    "<td width='70' style='" + navigationStyle + "'>&nbsp;</td>"
        }
    }

    navigation+=    "<td  style='" + navigationStyle + "' align='center' >";          
    navigation+=         link;            
    navigation+=    "</td>";

    if (parseInt(ExpertGridObject.EG_CatID) > 0)
    {

        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
     
        if (ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage < ExpertGridObject.EG_totalNumOfExperts && ExpertGridObject.EG_pageNumber<3 && ExpertGridObject.EG_paramID!=8)
        {
            var UniqeKey =   ExpertGridObject.EG_UniqeKey;
            var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
            var PageNum = ExpertGridObject.EG_pageNumber;
            navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:NextPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>Next&gt;&gt;</a>&nbsp;</td>";              
        }
        else
        {  
       
            if ((ExpertGridObject.EG_ViewAllUrl!='')&&(ExpertGridObject.EG_profileMode=='Wizard'))
            {
                var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>View all experts</a></td>";             
            }
            else if (ExpertGridObject.EG_profileMode=='Wizard')
            {
                navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";'>View all experts</a></td>";             
            }   
            else
            {
                navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ></td>";             
            }
        }
    }
    navigation+= "</tr></td></table>\n</tr>";      
    
    return navigation;            
}

function getNavigation2Lines(ExpertGridObject)
{   
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;    
    var navigationColor = getNavigationColor(ExpertGridObject);
    var navigation="";    //height:" + ExpertGridObject.EG_navigationUnitHeight + "px;
    
    
    var navigationStyle = "line-height: 1.5em; background-color:#"+navigationColor+";font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor;
    
    
    var logoStyle = "line-height: 1em;font-family:arial black; font-size:9px;color:#"+ExpertGridObject.EG_screenNameColor;
    
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }
    
    var URL = URLFormat(ExpertGridObject);  
    var link = "<a style='line-height: 1.5em;font-family:tahoma; font-size:9px;color:#"+ExpertGridObject.EG_screenNameColor +";border-width:0px;text-decoration:none;' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' >Powered by <span style='" +logoStyle + "'>LivePerson</span></a>";       
    
    navigation+= "<tr><td style='border:1px #"+ ExpertGridObject.EG_borderColor+ " solid'>\n<table width='100%' cellpadding='0' cellspacing='0' style='height:" + ExpertGridObject.EG_navigationUnitHeight + "px;'><tr>"
    if (parseInt(ExpertGridObject.EG_CatID) > 0)
    {
        //8 doesnt need next and back
        if (ExpertGridObject.EG_paramID!=8)  
        {
            //handle back
            if (ExpertGridObject.EG_pageNumber==2 ||ExpertGridObject.EG_pageNumber==3)
            {
                var PageNum = ExpertGridObject.EG_pageNumber;
                navigation+=    "<td  width='70' style='" + navigationStyle + "' align='center' >&nbsp;<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:PreviousPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&lt;&lt;Previous</a></td>";              
                
            }
            else 
            {               
                navigation+=    "<td width='70' style='" + navigationStyle + "'>&nbsp;</td>"
            }
        }

        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }

        if (ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage < ExpertGridObject.EG_totalNumOfExperts && ExpertGridObject.EG_pageNumber<3 && ExpertGridObject.EG_paramID!=8)
        {
            //handle next
            var UniqeKey =   ExpertGridObject.EG_UniqeKey;
            var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
            var PageNum = ExpertGridObject.EG_pageNumber;
            navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:NextPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>Next&gt;&gt;</a>&nbsp;</td>";              
        }
        else
        {   
            //handle view all
            if (ExpertGridObject.EG_ViewAllUrl!='')
            {
                //in 6 and 7 are shorter so we omit the word 'expert'
                if (ExpertGridObject.EG_paramID==6)
                {
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                    navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>View all</a></td>";             
                }
                else if (ExpertGridObject.EG_paramID==7)
                {
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
                    navigation+=    "<td width='90' style='" + navigationStyle + "' align='center'><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>View all</a></td>";             
                }
                else
                {
                    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
                    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;   
                    if (ExpertGridObject.EG_profileMode=='Wizard')                                 
                        navigation+=    "<td width='100%' nowrap style='line-height:13px! important," + navigationStyle + "' align='center'><a style='line-height:13px! important,font-family:tahoma; font-size:9px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>View all experts</a></td>";             
                    
                }
            }
            else
            {   
                if (ExpertGridObject.EG_profileMode=='Wizard')                
                 navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";'>View all experts</a></td>";             
            }   
        }
    }
    navigation+= "</tr><tr>"
    navigation+=    "<td colspan='2' style='" + navigationStyle + "' align='center' >";          
    navigation+=         link;            
    navigation+=    "</td></tr></table>\n</td></tr>";      
    
    return navigation;            
}

function getNavigation4(ExpertGridObject)
{    
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;
    var navigationColor = getNavigationColor(ExpertGridObject);
    var navigation="";
    var navigationStyle = "height:" + ExpertGridObject.EG_navigationUnitHeight + "px; background-color:#"+navigationColor+";font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor;
    var logoStyle = "font-family:arial black; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor;  
    var URL = URLFormat(ExpertGridObject);
    if (ExpertGridObject.EG_CategoryName==null)                
    {
        ExpertGridObject.EG_CategoryName ="";
    }
    var link = "<a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";border-width:0px;text-decoration:none;' title='" + ExpertGridObject.EG_CategoryName + "' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ URL + "\")' >Powered by <span style='" + logoStyle +"'>LivePerson</span></a>";
    
      
    navigation+= "<tr><td style='border:1px #"+ ExpertGridObject.EG_borderColor+ " solid'><table width='100%' cellpadding='0' cellspacing='0' ><tr>"
    
    if (parseInt(ExpertGridObject.EG_CatID) > 0)
    {
        if (ExpertGridObject.EG_pageNumber==2 ||ExpertGridObject.EG_pageNumber==3)
        {
            var PageNum = ExpertGridObject.EG_pageNumber;
            navigation+=    "<td style='font-family:tahoma; font-size:10px;' width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:PreviousPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>&lt;&lt;Previous</a></td>";              
        }
        else 
        {
            navigation+=    "<td style='font-family:tahoma; font-size:10px;' width='90' style='" + navigationStyle + "'>&nbsp;</td>"
        }

        var expertgrid;
        if (typeof(ExpertGridObject.EG_Disable_Render) == 'undefined')
        {
            expertgrid = ExpertGridObject.EG_RefToGrid;            
        }  
        else
        {
            expertgrid=document.getElementById('KasambaIframe').contentWindow;
        }
        
        if (ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage < expertgrid.EG_id.length && ExpertGridObject.EG_pageNumber<3)
        {
            var PageNum = ExpertGridObject.EG_pageNumber;
            navigation+= "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:NextPage(" + PageNum + "," + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'>Next&gt;&gt;</a></td>";              
        }
        
        else
        {   
            if (ExpertGridObject.EG_ViewAllUrl!='')
            {
                navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href='javascript:ViewAllExperts(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ")'> View all</a></td>";             
            }
            else
            {
                navigation+=    "<td width='90' style='" + navigationStyle + "' align='center' ><a style='font-family:tahoma; font-size:10px;color:#"+ExpertGridObject.EG_screenNameColor+";' href=''> View all</a></td>";             
            }
        }
        navigation+= "</tr><tr>"
    }   
    
    navigation+=    "<td  style='" + navigationStyle + "' align='center' colspan='2'>";          
    navigation+=        link;            
    navigation+=    "</td>";
    navigation+= "</tr></td></table></tr>";  
    
    return navigation;            
}

function getFooter(ExpertGridObject,empty)
{   
    var footerBgColor = getFooterBgColor(ExpertGridObject)
    var footer="";
    var footerStyle = "border:1px solid #"+ExpertGridObject.EG_borderColor+";height:" + ExpertGridObject.EG_footerUnitHeight + "px; font-family:"+ ExpertGridObject.EG_footerFontFamily +";font-size:"+ ExpertGridObject.EG_footerFontSize +";font-style:"+ ExpertGridObject.EG_footerItalic +"; font-weight:" + ExpertGridObject.EG_footerBold +"; text-decoration:" + ExpertGridObject.EG_footerUnderline +";text-align:center;color:#"+ExpertGridObject.EG_footerColor+";background-color:#"+footerBgColor+";";
             
    if (parseInt(ExpertGridObject.EG_footerUnitHeight) > 0)
    {
        footer+= "<tr>";  
        if (!empty)
        {
            footer+=    "<td style='" + footerStyle + "'>" + ExpertGridObject.EG_footerText +"</td>";
        }
        else
        {
            footer+=    "<td  style='" + footerStyle + "'>&nbsp;</td>";
        }
            
        footer+= "</tr>"; 
    }   
    
    return footer
}

function getHeader500X618TextWithIcon(ExpertGridObject)
{   
    var UniqeKey =   ExpertGridObject.EG_UniqeKey;
    var EG_ExpertGridShortCodeUniqeKey =  ExpertGridObject.EG_ExpertGridShortCodeUniqeKey;   
    var SpecialOfferURL  = ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID ;
    var header ="" 
    var headerLeftStyle = "width:100%; background-color:#"+ExpertGridObject.EG_headerBgColor+"; text-align:center; border-width:0px;" ;        
    var headerTextStyle = "color:#"+ExpertGridObject.EG_titleColor+"; font-family:" + ExpertGridObject.EG_titleFontFamily + "; font-size:" + ExpertGridObject.EG_titleFontSize +"; font-style:"+ ExpertGridObject.EG_titleItalic +"; font-weight:" + ExpertGridObject.EG_titleBold +"; border-width:0px; text-decoration:" + ExpertGridObject.EG_titleUnderline + ";";    
    var categoryLink = "<a style='" + headerTextStyle +"' href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\"" + ExpertGridObject.EG_LP_Url +"/Categories/ViewCategory.aspx?CatID=" + ExpertGridObject.EG_CatID +"\")'>" + ExpertGridObject.EG_titleText + "</a>";
    var headerRightStyle = "background-color:#"+ExpertGridObject.EG_headerBgColor+"; border-width:0px; text-align:right;";
    var subtitleStyle = "width:100%; background-color:#"+ExpertGridObject.EG_headerBgColor+"; color:#"+ExpertGridObject.EG_subtitleColor+"; font-family:" + ExpertGridObject.EG_subtitleFontFamily + "; font-size:" + ExpertGridObject.EG_subtitleFontSize +"; font-style:"+ ExpertGridObject.EG_subtitleItalic +"; font-weight:" + ExpertGridObject.EG_subtitleBold +"; text-decoration:" + ExpertGridObject.EG_subtitleUnderline + "; text-align:center; border-width:0px;" ;
    header = "<tr>";
    header+= "<td  style='border:1px solid #"+ExpertGridObject.EG_borderColor+";height:" + ExpertGridObject.EG_headerUnitHeight + "px'>\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"
    header+= "<tr>";
    header+= "<td style='" + headerLeftStyle +"'>" + categoryLink +"</td>";
    header+= "<td style='" + headerRightStyle +"' rowspan='2'><a  href='javascript:setHref(" + UniqeKey + "," + EG_ExpertGridShortCodeUniqeKey + ",\""+ SpecialOfferURL + "\")' style='text-decoration:none; border-width:0px;'><img src=\"" + ExpertGridObject.EG_url + ExpertGridObject.EG_imageSpecialOffer + "\" border=\"0\" /></a></td></tr>";
    header+= "<tr><td style='" + subtitleStyle +"'>" + ExpertGridObject.EG_subtitleText + "</td></tr>";
    header+= "</table>\n</td></tr>";    
        
    return header;     
}      

function getActualNumberExperts(ExpertGridObject)
{ 
    var startPoint = (ExpertGridObject.EG_pageNumber-1) *ExpertGridObject.EG_numExpertInPage;    
    var endPoint = ExpertGridObject.EG_pageNumber * ExpertGridObject.EG_numExpertInPage;
    endPoint = Min(endPoint,ExpertGridObject.EG_totalNumOfExperts)        
    
    return endPoint-startPoint;
}


function cutString(ExpertGridObject,stringToCut, numOfChars)  
{
    if (stringToCut.length > numOfChars)
    {
        stringToCut = stringToCut.substr(0,numOfChars) 
        stringToCut += "...";      
    }
    return  stringToCut;
}                                                                                                         

function NextPage(PageNum,UniqeKey,EG_ExpertGridShortCodeUniqeKey)
{ 
   var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
   var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
        
    }
  
    if (PageNum<3)
    {
        ExpertGridObject.EG_pageNumber= parseInt(PageNum)+1;
    }
    EGrender(ExpertGridObject,ExpertGridObject.EG_RefToGrid);
}

function PreviousPage(PageNum,UniqeKey,EG_ExpertGridShortCodeUniqeKey)
{
    var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
    var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
        
    }
    
    ExpertGridObject.EG_pageNumber= parseInt(PageNum)-1;
    EGrenderData(ExpertGridObject,ExpertGridObject.EG_RefToGrid);
}


function ViewAllExperts(UniqeKey,EG_ExpertGridShortCodeUniqeKey)
{
    var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
    var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
    }
    setHref(UniqeKey,EG_ExpertGridShortCodeUniqeKey,ExpertGridObject.EG_LP_Url + ExpertGridObject.EG_ViewAllUrl);
} 

function Min(num1,num2)
{
    if (num1>num2)
    {
        return num2;
    }
    else
    { 
        return num1;
    }
}

//this function clears the three titles of the grid. It is called when we change a category
function ClearTitles(ExpertGridObject)
{
    ExpertGridObject.EG_titleText = 'Text for Header'
    ExpertGridObject.EG_subtitleText = ''
    ExpertGridObject.EG_footerText = 'Text for Footer'
}

//this function add fm=yes where needed and restOfParams to the url
function setHref(UniqeKey,EG_ExpertGridShortCodeUniqeKey,url)
{
    var strWizardParam = "var WizardParam =  new " + EG_ExpertGridShortCodeUniqeKey + "();\n"
    var strExpertGridObject = "var ExpertGridObject = " + "new "+UniqeKey+"()";
   
   
    if (typeof(ExpertGridObject) == 'undefined')
    {
        eval (strWizardParam); 
        eval (strExpertGridObject);                
    }
    
    
    var delimeter = "?";
    if (url.indexOf("?") >= 0)
    {
       delimeter = "&"; 
    }
   
    if(parseInt(ExpertGridObject.EG_specialOfferType)==2)
    {
        url += delimeter + "fm=yes";
        if (delimeter == "?")
        {
            delimeter = "&";
        }
    } 
    
    
    url += delimeter + "twid=2";
    
    if (ExpertGridObject.EG_params != "")
    {
       url += delimeter + ExpertGridObject.EG_params;
       
       if (ExpertGridObject.EG_AffliateID == 'CJ')
       {
            url = "http://www.jdoqocy.com/click-" + ExpertGridObject.EG_PID + "-" 
                  + ExpertGridObject.EG_AID + "?URL=" + escape(url + "&accountRef=liveperson");
       } 
    }     
    window.open(url)
}

function SplitLargeWord(ExpertGridObject,str,MaxWordLen)
{
    var arr = str.split(" ");
    var result = "";

    for (i = 0; i < arr.length; i++)
    {
        if (i > 0)
            result += " ";
        if (arr[i].length > MaxWordLen)
            result += arr[i].substring(0,MaxWordLen) + " " + arr[i].substring(MaxWordLen);
        else
            result += arr[i];
    }
    return result;         
}

function GetSortByValue(ExpertGridObject)
{
    //he default SortBy option for all categories except Spirituality is 9. for Spirituality & Religion it should be 10.
    if (ExpertGridObject.EG_MainCatID == 1119)
    {
        return 10;
    }
    else
    {
        return 9;
    }
}

function URLFormat(ExpertGridObject)
{
     var URL = ExpertGridObject.EG_SubDomainURL;
     
     /*
     if (ExpertGridObject.EG_params != "")
        URL+="/?"+ExpertGridObject.EG_params;         
     */
     
     if (ExpertGridObject.EG_profileMode == 'SingleExpertSelection')
     {
         URL+="/?ExpID="+ ExpertGridObject.EG_expID;    
     }
     
     
     
 return URL       
 }
