
function Params()
{
if (typeof(kasamba_EG_paramID) != 'undefined')  this.EG_paramID=kasamba_EG_paramID;
if (typeof(kasamba_EG_header) != 'undefined')  this.EG_header=kasamba_EG_header;
if (typeof(kasamba_EG_footer) != 'undefined')  this.EG_footer=kasamba_EG_footer;
if (typeof(kasamba_EG_specialOfferLayout) != 'undefined')  this.EG_specialOfferLayout=kasamba_EG_specialOfferLayout;
if (typeof(kasamba_EG_numExperts) != 'undefined')  this.EG_numExperts=kasamba_EG_numExperts;
if (typeof(kasamba_EG_padding) != 'undefined')  this.EG_padding=kasamba_EG_padding;
if (typeof(kasamba_EG_imageSpecialOffer) != 'undefined')  this.EG_imageSpecialOffer=kasamba_EG_imageSpecialOffer;
if (typeof(kasamba_EG_imageDefaultExpert) != 'undefined')  this.EG_imageDefaultExpert=kasamba_EG_imageDefaultExpert;
if (typeof(kasamba_EG_expertUnitHeight) != 'undefined')  this.EG_expertUnitHeight=kasamba_EG_expertUnitHeight;
if (typeof(kasamba_EG_expertUnitWidth) != 'undefined')  this.EG_expertUnitWidth=kasamba_EG_expertUnitWidth;
if (typeof(kasamba_EG_headerUnitHeight) != 'undefined')  this.EG_headerUnitHeight=kasamba_EG_headerUnitHeight;
if (typeof(kasamba_EG_headerUnitWidth) != 'undefined')  this.EG_headerUnitWidth=kasamba_EG_headerUnitWidth;
if (typeof(kasamba_EG_footerUnitHeight) != 'undefined')  this.EG_footerUnitHeight=kasamba_EG_footerUnitHeight;
if (typeof(kasamba_EG_navigationUnitHeight) != 'undefined')  this.EG_navigationUnitHeight=kasamba_EG_navigationUnitHeight;
if (typeof(kasamba_EG_navigationUnitWidth) != 'undefined')  this.EG_navigationUnitWidth=kasamba_EG_navigationUnitWidth;
if (typeof(kasamba_EG_bannerGridShape) != 'undefined')  this.EG_bannerGridShape=kasamba_EG_bannerGridShape;
if (typeof(kasamba_EG_layoutType) != 'undefined')  this.EG_layoutType=kasamba_EG_layoutType;
if (typeof(kasamba_EG_imageContactLive) != 'undefined')  this.EG_imageContactLive=kasamba_EG_imageContactLive;
if (typeof(kasamba_EG_imageSendRequest) != 'undefined')  this.EG_imageSendRequest=kasamba_EG_imageSendRequest;
if (typeof(kasamba_EG_imageExpert) != 'undefined')  this.EG_imageExpert=kasamba_EG_imageExpert;
if (typeof(kasamba_EG_ViewAllUrl) != 'undefined')  this.EG_ViewAllUrl=kasamba_EG_ViewAllUrl;
if (typeof(kasamba_EG_Version) != 'undefined')  this.EG_Version=kasamba_EG_Version;
if (typeof(kasamba_EG_categoryUrl) != 'undefined')  this.EG_categoryUrl=kasamba_EG_categoryUrl;
if (typeof(kasamba_EG_url) != 'undefined')  this.EG_url=kasamba_EG_url;
if (typeof(kasamba_EG_imageUrl) != 'undefined')  this.EG_imageUrl=kasamba_EG_imageUrl;
if (typeof(kasamba_EG_height) != 'undefined')  this.EG_height=kasamba_EG_height;
if (typeof(kasamba_EG_width) != 'undefined')  this.EG_width=kasamba_EG_width;
if (typeof(kasamba_EG_CatID) != 'undefined')  this.EG_CatID=kasamba_EG_CatID;
if (typeof(kasamba_EG_pageNumber) != 'undefined')  this.EG_pageNumber=kasamba_EG_pageNumber;
if (typeof(kasamba_EG_kasambaUrl) != 'undefined')  this.EG_LP_Url=kasamba_EG_kasambaUrl;
if (typeof(kasamba_EG_params) != 'undefined')  this.EG_params=kasamba_EG_params;
this.EG_profileMode= 'Wizard';
if (typeof(kasamba_EG_titleColor) != 'undefined') this.EG_titleColor=kasamba_EG_titleColor;
if (typeof(kasamba_EG_titleFontSize) != 'undefined') this.EG_titleFontSize=kasamba_EG_titleFontSize;
if (typeof(kasamba_EG_subtitleColor) != 'undefined') this.EG_subtitleColor=kasamba_EG_subtitleColor;
if (typeof(kasamba_EG_ViewAllUrl) != 'undefined') this.EG_ViewAllUrl=kasamba_EG_ViewAllUrl;
if (typeof(kasamba_EG_subtitleFontSize) != 'undefined') this.EG_subtitleFontSize=kasamba_EG_subtitleFontSize;
if (typeof(kasamba_EG_imageContactLive) != 'undefined') this.EG_imageContactLive=kasamba_EG_imageContactLive;
if (typeof(kasamba_EG_SubSubCatID) != 'undefined') this.EG_SubSubCatID=kasamba_EG_SubSubCatID;
if (typeof(kasamba_EG_header) != 'undefined') this.EG_header=kasamba_EG_header;
if (typeof(kasamba_EG_imageSpecialOffer) != 'undefined') this.EG_imageSpecialOffer=kasamba_EG_imageSpecialOffer;
if (typeof(kasamba_EG_subtitleItalic) != 'undefined') this.EG_subtitleItalic=kasamba_EG_subtitleItalic;
if (typeof(kasamba_EG_footerBold) != 'undefined') this.EG_footerBold=kasamba_EG_footerBold;
if (typeof(kasamba_EG_titleFontFamily) != 'undefined') this.EG_titleFontFamily=kasamba_EG_titleFontFamily;
if (typeof(kasamba_EG_onlineStatusColor) != 'undefined') this.EG_onlineStatusColor=kasamba_EG_onlineStatusColor;
if (typeof(kasamba_EG_titleUnderline) != 'undefined') this.EG_titleUnderline=kasamba_EG_titleUnderline;
if (typeof(kasamba_EG_SubCatID) != 'undefined') this.EG_SubCatID=kasamba_EG_SubCatID;
if (typeof(kasamba_EG_subtitleBold) != 'undefined') this.EG_subtitleBold=kasamba_EG_subtitleBold;
if (typeof(kasamba_EG_titleText) != 'undefined') this.EG_titleText=kasamba_EG_titleText;
if (typeof(kasamba_EG_imageSendRequest) != 'undefined') this.EG_imageSendRequest=kasamba_EG_imageSendRequest;
if (typeof(kasamba_EG_specialOfferType) != 'undefined') this.EG_specialOfferType=kasamba_EG_specialOfferType;
if (typeof(kasamba_EG_specialOfferLayout) != 'undefined') this.EG_specialOfferLayout=kasamba_EG_specialOfferLayout;
if (typeof(kasamba_EG_screenNameColor) != 'undefined') this.EG_screenNameColor=kasamba_EG_screenNameColor;
if (typeof(kasamba_EG_linksColor) != 'undefined') this.EG_linksColor=kasamba_EG_linksColor;
if (typeof(kasamba_EG_bgColor2) != 'undefined') this.EG_bgColor2=kasamba_EG_bgColor2;
if (typeof(kasamba_EG_MainCatID) != 'undefined') this.EG_MainCatID=kasamba_EG_MainCatID;
if (typeof(kasamba_EG_ShowRating) != 'undefined') this.EG_ShowRating=kasamba_EG_ShowRating;
if (typeof(kasamba_EG_subtitleUnderline) != 'undefined') this.EG_subtitleUnderline=kasamba_EG_subtitleUnderline;
if (typeof(kasamba_EG_titleItalic) != 'undefined') this.EG_titleItalic=kasamba_EG_titleItalic;
if (typeof(kasamba_EG_paramID) != 'undefined') this.EG_paramID=kasamba_EG_paramID;
if (typeof(kasamba_EG_footerColor) != 'undefined') this.EG_footerColor=kasamba_EG_footerColor;
if (typeof(kasamba_EG_numExperts) != 'undefined') this.EG_numExperts=kasamba_EG_numExperts;
if (typeof(kasamba_EG_footerFontSize) != 'undefined') this.EG_footerFontSize=kasamba_EG_footerFontSize;
if (typeof(kasamba_EG_headerBgColor) != 'undefined') this.EG_headerBgColor=kasamba_EG_headerBgColor;
if (typeof(kasamba_EG_subtitleText) != 'undefined') this.EG_subtitleText=kasamba_EG_subtitleText;
if (typeof(kasamba_EG_footerFontFamily) != 'undefined') this.EG_footerFontFamily=kasamba_EG_footerFontFamily;
if (typeof(kasamba_EG_bgColor1) != 'undefined') this.EG_bgColor1=kasamba_EG_bgColor1;
if (typeof(kasamba_EG_subtitleFontFamily) != 'undefined') this.EG_subtitleFontFamily=kasamba_EG_subtitleFontFamily;
if (typeof(kasamba_EG_borderColor) != 'undefined') this.EG_borderColor=kasamba_EG_borderColor;
if (typeof(kasamba_EG_titleBold) != 'undefined') this.EG_titleBold=kasamba_EG_titleBold;
if (typeof(kasamba_EG_textColor) != 'undefined') this.EG_textColor=kasamba_EG_textColor;
if (typeof(kasamba_EG_footerText) != 'undefined') this.EG_footerText=kasamba_EG_footerText;
if (typeof(kasamba_EG_footerUnderline) != 'undefined') this.EG_footerUnderline=kasamba_EG_footerUnderline;
if (typeof(kasamba_EG_footer) != 'undefined') this.EG_footer=kasamba_EG_footer;
if (typeof(kasamba_EG_footerItalic) != 'undefined') this.EG_footerItalic=kasamba_EG_footerItalic;
if (typeof(kasamba_EG_ShowFee) != 'undefined') this.EG_ShowFee=kasamba_EG_ShowFee;
this.EG_expertsOutput = "";this.EG_phoneEnabled = false;this.EG_NextShowPicture = false;this.EG_125X125TimerRunning = false;this.EG_125X125RefreshTime = 3000;this.EG_SubDomainURL='http://Psychics.liveperson.com';
this.EG_UniqeKey = "Params";
this.EG_ExpertGridShortCodeUniqeKey = "Params" ;
this.EG_RefToGrid = new KasambaExpertsGrid_Params();
this.EG_ExpertGridDiv = "KasambaExperts" ;
this.EG_numExpertInPage  = 0 ;
this.EG_totalNumOfExperts  = 0 ;
this.EG_output = '';
}

function KasambaExpertsGrid_Params()
{
this.EG_id = new Array("435945","56932","818940","110351","575016","90355","89649","109388","43453","162137","673062","39053","194118","423583","429877","178422","495763","310053");
this.EG_fullname = new Array("PSYCHIC WONDERS LOVE","SPIRITUAL-LEE GIFTED","Mystic Knight","Intuitiv5","love psychic sara","Psychic Mark Wright","The WiZardStar","OzarkSeer","Readings with Cristina","Love Specialist Isabelle","Mystic future visions","Marjorie-Moonstone Medium","SHARAD KUMAR SONI","Super Psychic Dave","Spiritual Reader Fassu..","Live with Yulla Kelly","Spiritual Visions By Ryan","Sophie Reunite lovers");
this.EG_description = new Array("Love and Relationship specialist. Accurate and compassionate spirit guided answers.Need Answers?? Non Judgmental~Free Connection time~","*Honest, Accurate & Fast Psychic Reader* AS SEEN ON TV! Tell me ONLY YOUR NAME - No sugar-coating. Email & Live Chat! FREE Angel card with every first time reading","I am a fifth generation God-gifted master psychic. I have helped countless people find their destiny with no sugar, I can do the same for you.You simply need to contact me.","Seen Live Radio Psychic Numerology has the abiltiy to predict when an event will happen in your life. \"Seen Live\" TV and Radio Psychic. Can give you the best days for love, mo","99.9%accurate* Clairvoyant*Empathic* Truthful* Ethical* Experienced* Reliable* tarot*crystal*Compassionate* honest* Fast-Typer!","94% accurate reader to give you time frame on future events through NUMEROLOGY. Should you wait or move on? No false hopes and no sugar coatings.","Get into the Numbers, Here to help, Honest Ethical truth Prevails, \"Feel the Power In Spirit Led readings\" see reviews, no glitter, Exceptional! Integral Insight.","Find out what those numbers mean for you~ Honest answers~","Free Numerology report with e-mail readings. Let the numbers guide your way!","Psychic reading using Numerology.  ~*~ Spiritual healer, natural psychic, no mumbo jumbo, just clear answers and guidance","Get answers regarding numerology with my vast experience in numerology,I can help in solving almost all problems concerning life issues and let you know what future holds for","Numbers are everywhere! In your name, birth date and certainly in your energy. Ask me for your \"soul\" number and I can help you see deeper into your self.","[15+ Years Experience] I can provide you a \"Magic Number System\" , with that system you would be benefited in any number like game and many other things in your life time to t","explore your love life, romance, relationship compatibility, job, career, current life issues.My readings touch you soul to soul, picking up your vibrations and those around y","psychic readings.Numerology I can guide you through any life matters through the use of Tarot Card and if requested through Medium work.","~~~Gifted master-psychic,20 yrs of clairvoyant practise in psy.read, remote viewing, mediumship, clair/audient readings","What do the numbers say about your fate and destiny? Let me help you to know what the future hold for you.","Need your Love Questions answered? Need guidance in Relationship? Ask me for accurate advice.");
this.EG_picid = new Array("435945","56932","818940","110351","575016","90355","89649","109388","43453","162137","673062","39053","194118","423583","429877","178422","495763","310053");
this.EG_ratingpic = new Array("10","10","10","10","8","10","10","10","10","10","9","10","9","9","9","10","9","9");
this.EG_ratersnumber = new Array("5841","5797","2496","5218","475","3567","7641","8421","4853","1052","2340","3062","6935","3975","3319","2280","3860","2143");
this.EG_rating = new Array("4.884951","4.869242","4.800881","4.779417","4.132631","4.858985","4.99411","4.760004","4.808984","4.945817","4.636752","4.856303","4.490122","4.731069","4.660138","4.801754","4.730829","4.660289");
this.EG_status = new Array("4","4","4","4","1","4","4","4","4","4","1","4","1","1","1","4","1","4");
this.EG_onlinefee = new Array("7","9.99","18","18.6","1.99","15.9","8.33","8.49","5.99","14.9","9.99","7.77","3.99","1.99","3.99","20","8.99","3.99");
this.EG_title = new Array("Psychic","","","","","","","","","","","Rev. Dr.","","","","","","");
}

var WizardParam =  new Params();
var ExpertGridObject_Params=  new Params();
var expertgrid_Params ;
function Start_Params(){if (typeof(ExpertGridObject_Params.EG_Disable_Render)== 'undefined') { EGrender(ExpertGridObject_Params,expertgrid_Params);}}
 Start_Params();


//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       
 }
