Tuesday, August 17, 2010

HOW TO Display table with images/rollovers based on a backend SharePoint List data using HTML/jQuery

The code below shows how to display a table (containing images/rollovers). The data that is displayed in the table, is retrieved from a backend SharePoint List. It uses jQuery and HTML to render the table.

 

Embed the entire code in a Content Editor Web Part.

 

 

<link href="http://intranet.na.kraft.com/sites/TC/jQuery/AltToTravel.css" rel="stylesheet"

type="text/css"/>

 

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

 

 

 

<script type="text/javascript">

    

    //$(document).ready(function() {

  $(window).load(function() {

 

        var costSoapEnv =

            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \

                <soapenv:Body> \

                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \

                        <listName>Travel and Collaboration Tools Cost</listName> \

                  <viewFields> \

                            <ViewFields> \

                              <FieldRef Name='Typical_x0020_domestic_x0020_tra' /> \

                              <FieldRef Name='Typical_x0020_international_x002' /> \

                              <FieldRef Name='Most_x0020_Collaboration_x0020_T' /> \

                              <FieldRef Name='B2B_x0020_TelePresence_x0020_too' /> \

                            </ViewFields> \

                        </viewFields> \

                    </GetListItems> \

                </soapenv:Body> \

            </soapenv:Envelope>";

 

 

//alert("Soap = " + costSoapEnv);

        $.ajax({

            url: "http://intranet.na.kraft.com/sites/TC/plantrip/_vti_bin/lists.asmx",

            type: "POST",

            dataType: "xml",

            data: costSoapEnv,

            complete: buildTravelCostsChart,

            contentType: "text/xml; charset=\"utf-8\""

        });

    });

 

function buildTravelCostsChart(xData, status) {

var costsColTag;

var itemCount;

 

//Construct the Column tag classes here

costsColTag = "sizedata chart_td";

 

//Get a handle to the SPAN tag

var spnElement= document.getElementById("spnCostsChart");

 

 

//alert("here");

//alert(xData.responseXML.xml);

 

 

//Check if a SoapServerException has occurred

//This could occur if the List is missing/deleted

//The Response XML will contain the SoapServerException

//If SoapServerException is found, IndexOf returns an integer

//IndexOf returns -1 if SoapServerException is not found.

 

//var strErrorCheck = xData.responseXML.xml;

//alert ("strErrorCheck = " + strErrorCheck);

//var posErrStr = strErrorCheck.indexOf("SoapServerException");

 

//if (posErrStr >= 0)

//{

       //alert ("A Soap Exception has occurred"); 

 

 

      //Display a table with a message indicating that

      //Travel and B2B Costs SharePoint List NOT found in the Site

      //Display an appropriate error message

      //Start constructing No List Table HTML here

  //var noListTableHtml = "";

  //noListTableHtml += "<TABLE WIDTH=100% border=0>";

  //noListTableHtml += "<TBODY>";

  //noListTableHtml += "<TR>";

  //noListTableHtml += "<TD><SPAN class=ms-rteCustom-Kraft_Major_Headline><FONT

size=2>&nbsp;<FONT color=#ff0000>Travel and B2B Costs SharePoint List not found! Please contact

the Site Administrator.</FONT></FONT></SPAN></TD>"

  //noListTableHtml += "</TR></TBODY></TABLE>";

 

   //Assign the noListTableHTML code to the span tag INNER HTML property to display it

     //spnElement.innerHTML = noListTableHtml ; 

 

//}

 

//else //returning -1; No Soap Exception

//{

 

 

 

//Get the Item Count here

$(xData.responseXML).find("[nodeName=rs:data]").each(function() {

  itemCount = $(this).attr("ItemCount");

  //alert("Total Number of Items = " + itemCount); 

});

 

 

 

//If Item Count is 0 display an error message to user

//Travel and B2 Tools cost info not found

//Have user fill it out by providing a link to SharePoint List

if (itemCount == "0")

 

{

 

   //alert ("Travel and B2B Tools cost info not defined in SharePoint List");

  //Display a table with a message indicating that

  //Travel Cost info has NOT been defined in the SharePoint List

  //Provide a link to the SharePoint List here

  //Start constructing table HTML here

  var noCostsTableHtml = "";

  noCostsTableHtml += "<TABLE WIDTH=100% border=0>";

  noCostsTableHtml += "<TBODY>";

  noCostsTableHtml += "<TR>";

  noCostsTableHtml += "<TD><SPAN class=ms-rteCustom-Kraft_Major_Headline><FONT size=2>&nbsp;<FONT

color=#ff0000>Travel and B2B tools cost info not found!</FONT></FONT></SPAN></TD>"

  noCostsTableHtml += "</TR>";

  noCostsTableHtml += "<TR>";

  noCostsTableHtml += "<TD>&nbsp;Please click on the link below to define the Travel and B2B

tools cost info in the SharePoint List.</TD>";

  noCostsTableHtml += "</TR>";

  noCostsTableHtml += "<TR>";

  noCostsTableHtml += "<TD><A

href='http://intranet.na.kraft.com/sites/TC/plantrip/Lists/Alternatives%20to%20Travel/AllItems.as

px'>&nbsp;<STRONG><U><FONT color=#0000ff>Define Travel and B2B tools cost info

tools</FONT></U></STRONG></A></TD>";

   noCostsTableHtml += "</TR></TBODY></TABLE>";

 

   //Assign the tableHTML code to the span tag INNER HTML property to display it

     spnElement.innerHTML = noCostsTableHtml; 

 

}

 

else //Item Count is greater than 0; render the Travel and B2B tools cost info chart

 

{

 

 

//Loop through the result set returned in the SOAP

//envelope courtesy of the SharePoint Lists Web Service

$(xData.responseXML).find("[nodeName=z:row]").each(function() {

   

    //alert("here");

   

    //Get domestic travel cost

    domCost = $(this).attr("ows_Typical_x0020_domestic_x0020_tra");

   

    //Check if domCost is blank

    if (typeof(domCost) == 'undefined') 

    {

      domCost = "Domestic travel cost not defined in SharePoint List.";

 

    }

 

    //alert(domCost);

 

     //Get international travel cost

     intlCost = $(this).attr("ows_Typical_x0020_international_x002");

   

    //Check if intlCost is blank

    if (typeof(intlCost) == 'undefined') 

    {

      intlCost = "International travel cost not defined in SharePoint List.";

 

    }

 

  

    //alert(intlCost);

 

    //Get Most Collab tools cost

    collabCost = $(this).attr("ows_Most_x0020_Collaboration_x0020_T");

   

    //Check if collabCost is blank

    if (typeof(collabCost) == 'undefined') 

    {

      collabCost = "Collaboration tools cost not defined in SharePoint List.";

 

    }

 

    //alert(collabCost);

 

   //Get B2B TelePresence tools cost

    b2bCost = $(this).attr("ows_B2B_x0020_TelePresence_x0020_too");

 

   //Check if b2bCost is blank

    if (typeof(b2bCost) == 'undefined') 

    {

      b2bCost = "B2B tools cost not defined in SharePoint List.";

 

    }

 

    //alert(b2bCost);

 

}); //closing for jQuery for loop

 

    //Start constructing chart table HTML here

    var tableHtml = "";

 

   //Render Page Heading here

    tableHtml += "<P><B><FONT size=4><SPAN class=ms-rteCustom-Kraft_Major_Headline>Alternatives

to Travel</SPAN></B></P>";

 

  //Render Travel and B2B Tool Costs table here

    tableHtml += "<P><TABLE id='costsgrid' cellSpacing='0' cellPadding='0' border='0'>";

 

    tableHtml += "<TBODY><TR><TH width='450px' class=cost_th>Typical US domestic travel

cost</TH><TH width='450px' class=cost_th>Typical international travel (US to int'l)

cost</TH></TR>";

 

    tableHtml += "<TR><TD width='450px' class='";

    tableHtml += costsColTag + "'><P align=center><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=2>1 person - 2 night stay</FONT></SPAN></P></TD>";

 

    tableHtml += "<TD width='450px' class='";

 

    tableHtml += costsColTag + "'><P align=center><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=2>1 person - 2 night stay</FONT></SPAN></P></TD></TR>";

 

 

    tableHtml += "<TR><TD width='450px' class='";

 

    tableHtml += costsColTag + "'><P align=center><B><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=3>" + domCost + "</FONT></SPAN></B></P></TD>";

 

  tableHtml += "<TD width='450px' class='";

 

  //End Cost table rendering here

  tableHtml += costsColTag + "'><P align=center><B><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=3>" + intlCost + "</FONT></SPAN></B></P></TD></TR><TR></TR></TBODY></TABLE></P>";

 

  //Render TelePresence Costs table here

tableHtml += "<P><TABLE id='telepresencecostsgrid' cellSpacing='0' cellPadding='0' border='0'>";

 

    tableHtml += "<TBODY><TR><TH width='450px' class=cost_th>Most Collaboration Tools

cost</TH><TH width='450px' class=cost_th>Cost of using external TelePresence</TH></TR>";

 

    tableHtml += "<TR><TD width='450px' class='";

 

    tableHtml += costsColTag + "'><P align=center><B><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=3>" + collabCost + "</FONT></SPAN></B></P></TD>";

 

  tableHtml += "<TD width='450px' class='";

 

  //End TelePresence Cost table rendering here

  tableHtml += costsColTag + "'><P align=center><B><SPAN class=ms-rteCustom-Kraft_Body><FONT

size=3>" + b2bCost + "</FONT></SPAN></B></P></TD></TR><TR></TR></TBODY></TABLE></P>";

 

 

    //Assign the tableHTML code to the span tag INNER HTML property to display it

     spnElement.innerHTML = tableHtml ;

 

   

} //closing brace for (itemCount == 0) if statement   

 

//} //closing brace for SoapException if statement

 

} //closing brace for function

 

 

</script>

 

<span id="spnCostsChart"></span>

 

 

 

 

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/wz_tooltip.js"></script>

 

<style type="text/css">

 

th.chart_th {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 12px;

                font-weight: bold;

                color: #FFF;

                background-color: #039;

                border-top-width: 1px;

                border-right-width: 1px;

                border-bottom-width: 1px;

                border-left-width: 1px;

                border-top-style: none;

                border-right-style: solid;

                border-bottom-style: none;

                border-left-style: none;

                border-top-color: #FFF;

                border-right-color: #FFF;

                border-bottom-color: #FFF;

                border-left-color: #FFF;

                padding-top: 4px;

                padding-bottom: 4px;

}

 

th.cost_th {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 12px;

                font-weight: bold;

                color: #FFF;

                background-color: #339966;

                border-top-width: 1px;

                border-right-width: 1px;

                border-bottom-width: 1px;

                border-left-width: 1px;

                border-top-style: none;

                border-right-style: solid;

                border-bottom-style: none;

                border-left-style: none;

                border-top-color: #FFF;

                border-right-color: #FFF;

                border-bottom-color: #FFF;

                border-left-color: #FFF;

                padding-top: 4px;

                padding-bottom: 4px;

}

 

 

td.names {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 12px;

                font-weight: bold;

                color: #036;

                border-right-width: 2px;

                border-right-style: solid;

                border-right-color: #FFF;

                margin: 0px;

                padding-top: 0px;

                padding-right: 2px;

                padding-bottom: 0px;

                padding-left: 8px;

                width: 150px;

 

}

td.sizedata, td.locationdata, td.techdata {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 12px;

                color: #000;

                border-right-width: 2px;

                border-left-width: 2px;

                border-right-style: solid;

                border-left-style: none;

                border-right-color: #FFF;

                border-left-color: #FFF;

                text-align: center;

}

td.featuresdata {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 12px;

                color: #000;

                border-right-width: 2px;

                border-left-width: 2px;

                border-right-style: solid;

                border-left-style: none;

                border-right-color: #FFF;

                border-left-color: #FFF;

                text-align: left;

}

 

.features {

                margin: 0px;

                padding-top: 0px;

                padding-right: 0px;

                padding-bottom: 0px;

                padding-left: 14px;

                font-size: 12px;

}

td.chart_td {

                padding-top: 4px;

                padding-right: 2px;

                padding-bottom: 4px;

                padding-left: 2px;

                border-bottom-width: 4px;

                border-bottom-style: solid;

                border-bottom-color: #FFF;

                border-top-width: 2px;

                border-top-style: solid;

                border-top-color: #CCC;

}

#alternativesgrid a {

                color: #036;

                text-decoration: none;

                font-weight: bold;

}

#alternativesgrid {

}

.costs {

                font-family: Arial, Helvetica, sans-serif;

                font-size: 14px;

                width: 100%;

                padding: 4px;

                margin-bottom: 8px;

}

.costs h2 {

                font-size: 18px;

                line-height: 18px;

                margin: 0px;

                padding: 0px;

}

.names a img {

}

.key {

                font-size: 11px;

                margin-bottom: 0px;

                padding-bottom: 0px;

}

.key p {

                margin-bottom: 4px;

                line-height: 12px;

                padding: 4px;

                margin-top: 0px;

}

chart_span {

                background-color: #FFF;

}

#Span1 {

}

#alternativesgrid {

                background-color: #D9E6FF;

}

 

#costsgrid {

                background-color: #D7E4BC;

}

 

#telepresencecostsgrid {

                background-color: #D7E4BC;

}

</style>

 

 

 

 

 

<script type="text/javascript">

    //$(document).ready(function() {

    $(window).load(function() {

        var soapEnv =

            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \

                <soapenv:Body> \

                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \

                        <listName>Alternatives to Travel</listName> \

                        <viewFields> \

                            <ViewFields> \

                              <FieldRef Name='Title' /> \

                              <FieldRef Name='In_x0020_all_x0020_Kraft_x0020_L' /> \

                              <FieldRef Name='Audience_x0020_Size' /> \

                              <FieldRef Name='Best_x0020_for' /> \

                              <FieldRef Name='Features_x0020_and_x0020_Benefit' /> \

                              <FieldRef Name='Main_x0020_Image' /> \

                              <FieldRef Name='Rollover_x0020_Image' /> \

                              <FieldRef Name='Rollover_x0020_Text' /> \

                              <FieldRef Name='Target_x0020_Page' /> \

 <FieldRef Name='Rollover_x0020_text_x0020_for_x0' /> \

<FieldRef Name='Rollover_x0020_text_x0020_for_x00' /> \

<FieldRef Name='Target_x0020_Page_x0020_for_x002' /> \

<FieldRef Name='Target_x0020_Page_x0020_for_x0020' /> \

</ViewFields> \

                        </viewFields> \

                    </GetListItems> \

                </soapenv:Body> \

            </soapenv:Envelope>";

 

 

//alert("Soap = " + soapEnv);

        $.ajax({

            url: "http://intranet.na.kraft.com/sites/TC/plantrip/_vti_bin/lists.asmx",

            type: "POST",

            dataType: "xml",

            data: soapEnv,

            complete: buildAltToTravelChart,

            contentType: "text/xml; charset=\"utf-8\""

        });

    });

 

function buildAltToTravelChart(xData, status) {

var altTravelTitle, allKraftLoc;

var targetPageValue, targetPage;

var mainImageURLValue, mainImageURL;

var rolloverText, rolloverImageURLValue, rolloverImageURL;

var toolsColTag;

var audSizeColTag, krftLocColTag, bestForColTag, ftrBnftColTag;

var spnID;

var audSizeRolloverText, locRolloverText;

var audSizeTargetPageValue, audSizeTargetPage;

var locTargetPageValue, locTargetPage;

var itemCount;

 

 

//Construct the Column tag classes here

toolsColTag = "names chart_td";

audSizeColTag = "sizedata chart_td";

krftLocColTag = "locationdata chart_td";

bestForColTag = "techdata chart_td";

ftrBnftColTag = "featuresdata chart_td";

 

     //Get a handle to the SPAN tag

      var spnElement= document.getElementById("spnChart");

 

 

//alert("here");

//alert(xData.responseXML.xml);

 

//Check if a SoapServerException has occurred

//This could occur if the List is missing/deleted

//The Response XML will contain the SoapServerException

//If SoapServerException is found, IndexOf returns an integer

//IndexOf returns -1 if SoapServerException is not found.

 

//var strErrorCheck = xData.responseXML.xml;

//alert ("strErrorCheck = " + strErrorCheck);

//var posErrStr = strErrorCheck.indexOf("SoapServerException");

 

//if (posErrStr >= 0)

//{

       //alert ("A Soap Exception has occurred"); 

 

 

      //Display a table with a message indicating that

      //Alternatives to Travel SharePoint List NOT found in the Site

      //Display an appropriate error message

      //Start constructing No List Table HTML here

  //var noListTableHtml = "";

  //noListTableHtml += "<TABLE WIDTH=100% border=0>";

  //noListTableHtml += "<TBODY>";

  //noListTableHtml += "<TR>";

  //noListTableHtml += "<TD><SPAN class=ms-rteCustom-Kraft_Major_Headline><FONT

size=2>&nbsp;<FONT color=#ff0000>Alternatives to Travel SharePoint List not found! Please contact

the Site Administrator.</FONT></FONT></SPAN></TD>"

  //noListTableHtml += "</TR></TBODY></TABLE>";

 

   //Assign the noListTableHTML code to the span tag INNER HTML property to display it

     //spnElement.innerHTML = noListTableHtml ; 

 

//}

 

//else //returning -1; No Soap Exception

//{

  //alert("No Soap Exception");

  

  //Get the Item Count here

  $(xData.responseXML).find("[nodeName=rs:data]").each(function() {

     itemCount = $(this).attr("ItemCount");

     //alert("Total Number of Items = " + itemCount); 

   });

 

    

   

    //If Item Count is 0 display an error message to user

    //Alt To Travels not found

    //Have user fill it out by providing a link to SharePoint List

     if (itemCount == "0")

 

     {

 

      //alert ("No Tools defined in SharePoint List");

      //Display a table with a message indicating that

      //Alt To Travel tools have NOT been defined in the SharePoint List

  //Provide a link to the SharePoint List here

  //Start constructing table HTML here

  var noToolsTableHtml = "";

  noToolsTableHtml += "<TABLE WIDTH=100% border=0>";

  noToolsTableHtml += "<TBODY>";

  noToolsTableHtml += "<TR>";

  noToolsTableHtml += "<TD><SPAN class=ms-rteCustom-Kraft_Major_Headline><FONT size=2>&nbsp;<FONT

color=#ff0000>Alternatives to Travel tools not found!</FONT></FONT></SPAN></TD>"

  noToolsTableHtml += "</TR>";

  noToolsTableHtml += "<TR>";

  noToolsTableHtml += "<TD>&nbsp;Please click on the link below to define the Alternatives to

Travel tools in the SharePoint List.</TD>";

  noToolsTableHtml += "</TR>";

  noToolsTableHtml += "<TR>";

  noToolsTableHtml += "<TD><A

href='http://intranet.na.kraft.com/sites/TC/plantrip/Lists/Alternatives%20to%20Travel/AllItems.as

px'>&nbsp;<STRONG><U><FONT color=#0000ff>Define Alternatives to Travel

tools</FONT></U></STRONG></A></TD>";

   noToolsTableHtml += "</TR></TBODY></TABLE>";

 

   //Assign the tableHTML code to the span tag INNER HTML property to display it

     spnElement.innerHTML = noToolsTableHtml; 

 

} //ending brace for (if itemCount == 0)

 

else //Item Count is greater than 0; render the Alt To Travel chart

 

{

 

     //Start constructing the rollover text HTML here

     //This HTML will contain the text that will be used for mouseover events  

      //Get a handle to the SPAN tag

      var spnRollover= document.getElementById("spnRollover");

     //alert("Current Rollover text = " + spnRollover.innerHTML);

     var spnHtml = spnRollover.innerHTML;

 

    //Append style to not display the rollover text at bottom of page

    spnHtml += "<DIV style=display:none>";

   

 

   //Start constructing chart table HTML here

    var tableHtml = "";

 

   //Render Alternatives to Travel table here

    tableHtml += "<TABLE id='alternativesgrid' border='1' cellspacing='0' cellpadding='1'>";

      

   

    //Construct Top column header here

    tableHtml += "<TBODY><TR><TH class=chart_th>Collaboration Tools </TH><TH

class=chart_th><P>Audience Size</P></TH><TH class=chart_th>Locations</TH><TH class=chart_th

width='20%'>Best for...</TH><TH class=chart_th width='40%'>Features and

Benefits</TH></TR><TBODY><TR>";

 

 

//Loop through the result set returned in the SOAP

//envelope courtesy of the SharePoint Lists Web Service

$(xData.responseXML).find("[nodeName=z:row]").each(function() {

   

    //alert("here");

   

    //Get the title of the Collab Tool

    altTravelTitle = $(this).attr("ows_Title"); 

 

     //Get Audience Size supported by this Tool

     audSize = $(this).attr("ows_Audience_x0020_Size");

 

     //Check if Audience Size column is blank in SharePoint List

     //If true, display a message in the column

     if (typeof audSize == 'undefined')

     {

        audSize = "Audience Size for this tool must be defined in the SharePoint List.";  

      }

   

    //Get Is Tool available in all Kraft locations

    allKraftLoc = $(this).attr("ows_In_x0020_all_x0020_Kraft_x0020_L"); 

 

      //Check if Tool availability column is blank in SharePoint List

     //If true, display a message in the column

     if (typeof allKraftLoc == 'undefined')

     {

        allKraftLoc = "Availability info for this tool must be defined in the SharePoint List."; 

 

      }

 

   //Get Best for...

   bestFor = $(this).attr("ows_Best_x0020_for");  

 

   //Check if Best For... column is blank in SharePoint List

   //If true, display a message in the column

   if (typeof(bestFor) == 'undefined')

   {

       bestFor = "Best For... text for this tool must be defined in the SharePoint List.";  

   }

          

  //Get Features and Benefits

  ftrBnft = $(this).attr("ows_Features_x0020_and_x0020_Benefit");

 

   //Check if Features and Benefits column is blank in SharePoint List

   //If true, display a message in the column

 

   if (typeof ftrBnft == 'undefined')

   {

       ftrBnft = "<ul>";

       ftrBnft += "<li>Features and Benefits text for this tool must be defined in the SharePoint

List.</li>";

       ftrBnft += "</ul>";

  

   }

 

   //Get Main Image URL Value. This is a comma separated value

   mainImageURLValue = $(this).attr("ows_Main_x0020_Image"); 

 

   //Check if Main Image URL is missing

   //If true, display a generic Image Not Found image

    if (typeof(mainImageURLValue) == 'undefined')

 

    {

        //alert("No Main Image");

        mainImageURLValue =

"http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/noimage.jpg,http://intranet.na.k

raft.com/sites/TC/Travel%20Central%20Images/noimage.jpg";

    }

 

   //Split the Main Image URL Value at the comma separator

   mainImageURL= mainImageURLValue.split(",");

 

    //Get Rollover Image URL Value. This is a comma separated value

   rolloverImageURLValue = $(this).attr("ows_Rollover_x0020_Image"); 

 

 

      //Check if Rollover Image URL is missing

   //If true, display a generic Image Not Found image

    if (typeof(rolloverImageURLValue) == 'undefined')

 

    {

        //alert("No Rollover Image");

        rolloverImageURLValue =

"http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/noimage.jpg,http://intranet.na.k

raft.com/sites/TC/Travel%20Central%20Images/noimage.jpg";

    }

 

 

   //Split the Rollover Image URL Value at the comma separator

   rolloverImageURL = rolloverImageURLValue.split(",");

 

 

    //Get the Rollover text for the Tool

    rolloverText = $(this).attr("ows_Rollover_x0020_Text"); 

 

   //Check if Rollover text column is blank in SharePoint List

   //If true, display a message in the rollover

 

   if (typeof rolloverText == 'undefined')

   {

       rolloverText = "<B>Rollover Text not found</B><BR>";

       rolloverText += "Rollover text for this tool must be defined in the SharePoint List.";  

   }

 

    //Get the Target page to link to when user clicks on the Tool

    targetPageValue = $(this).attr("ows_Target_x0020_Page");

 

    //Check if Target page value is blank

    //If true, then set the Target page to the current page

     if (typeof(targetPageValue) == 'undefined')

 

    {

         targetPageValue = "#,#"; 

    }  

 

   //Split the Target Page URL Value at the comma separator

   targetPage = targetPageValue.split(",");

 

 

    //Get the Target page to link to when user clicks on the Audience Size link

    audSizeTargetPageValue = $(this).attr("ows_Target_x0020_Page_x0020_for_x0020"); 

 

 

    //Check if Audience Size Target page value is blank

    //If true, then set the Target page to the current page

     if (typeof(audSizeTargetPageValue) == 'undefined')

    {

         audSizeTargetPageValue = "#,#"; 

    }  

 

   //Split the Target Page URL Value at the comma separator

   audSizeTargetPage = audSizeTargetPageValue.split(",");

 

    //Get the Rollover text for the Audience Size column

    audSizeRolloverText = $(this).attr("ows_Rollover_x0020_text_x0020_for_x00"); 

 

 

   //Check if Rollover text column for Audience Size

   //is blank in SharePoint List

   //If true, display a message in the rollover

 

   //if (typeof audSizeRolloverText == 'undefined')

   //{

     //  audSizeRolloverText = "<B>Rollover Text not found</B><BR>";

     //  audSizeRolloverText += "Rollover text for Audience size for this tool must be defined in

the SharePoint List.";  

   //}

 

 

   //Get the Target page to link to when user clicks on the Locations link

    locTargetPageValue= $(this).attr("ows_Target_x0020_Page_x0020_for_x002"); 

 

    //Check if Kraft Locations Target page value is blank

    //If true, then set the Target page to the current page

     if (typeof(locTargetPageValue) == 'undefined')

 

    {

         locTargetPageValue = "#,#"; 

    }  

 

   //Split the Target Page URL Value at the comma separator

   locTargetPage= locTargetPageValue.split(",");

 

   if (allKraftLoc == "All")

   {

     locTargetPage[0] = "#";

   }

 

 

    //Get the Rollover text for the Locations column

    locRolloverText = $(this).attr("ows_Rollover_x0020_text_x0020_for_x0"); 

 

 

   //Check if Rollover text column for Locations

   //is blank in SharePoint List

   //If true, display a message in the rollover

 

   if (typeof locRolloverText == 'undefined')

   {

       locRolloverText = "<B>Rollover Text not found</B><BR>";

       locRolloverText += "Rollover text for Kraft locations availability for this tool must be

defined in the SharePoint List.";  

   }

 

        

     //alert("Title = " + altTravelTitle);

     //alert("In All Kraft locations = " + allKraftLoc);

     //alert("Main Image URL = " + mainImageURL[0]);

     //alert("Rollover text = " + rolloverText);

     //alert("Target Page = " + targetPage);

    

    //Render Begin Row tag

     tableHtml += "<TR>";

 

         

     //Create SPAN id tag based on Tool title

     //Remove spaces if any in the title

     //This is the ID of the SPAN tag for the rollover text/image

     spnID = altTravelTitle.split(' ').join('');

 

     //alert("Span ID = " + spnID);

    

     //Render Collab Tools column

     //If Target Page is blank in the List, then display an alert

     //when user clicks on the link

     if(targetPage[0] == "#")

 

     {

     tableHtml += "<TD class='" + toolsColTag + "'>";

     tableHtml += "<A onmouseover=TagToTip('" ;

     tableHtml += spnID + "') onmouseout='UnTip()' onclick='NoTargetPage()' ";

     tableHtml += "href='" + targetPage[0] + "'>";

     tableHtml += "<IMG align=middle width=116 height=65 border=0 src='";

 

     }

 

     else

 

     {

 

 

     tableHtml += "<TD class='" + toolsColTag + "'>";

     tableHtml += "<A onmouseover=TagToTip('" ;

     tableHtml += spnID + "') onmouseout='UnTip()'";

     tableHtml += "href='" + targetPage[0] + "' target=_blank>";

     tableHtml += "<IMG align=middle width=116 height=65 border=0 src='";

 

      }

 

     //Render Tool main image here

     tableHtml += mainImageURL[0] + "'><BR>";

//     tableHtml += altTravelTitle + "</A></TD>";

tableHtml += "<U><FONT color=#0000ff>" + altTravelTitle + "</FONT></U></A></TD>";

 

 

 

   //Check if Rollover text column for Audience Size

   //is blank in SharePoint List

   //If true, don't display rollover, just display the Audience Size value

 

  //alert("Aud Size Rollover text = " + audSizeRolloverText);

   if ((typeof audSizeRolloverText == 'undefined') || (audSizeRolloverText == '<p>&nbsp;</p>') ||

(audSizeRolloverText == '<div>&nbsp;</div>'))

   {

 

    //tableHtml += "<TD>" + audSize + "</TD>";

    tableHtml += "<TD class='" + audSizeColTag + "'>";

    tableHtml += "<STRONG>" + audSize + "</STRONG></TD>";

 

   }

 

   else  //Render Audience Size column with rollover text

 

  {

    tableHtml += "<TD class='" + audSizeColTag + "'>";

    tableHtml += "<A onmouseover=TagToTip('" ;

    tableHtml += spnID + "Size" + "') onmouseout='UnTip()'";

    tableHtml += "href='#'>"

    //tableHtml += audSize + "</TD>";

    tableHtml += "<FONT color=#0000ff>" + audSize + "</FONT></TD>";

 

  }

 

 

//Render Location column

//If Location is All, then don't render hyperlink

    

   if (allKraftLoc == "All")

 

   {

     tableHtml += "<TD class='" + krftLocColTag + "'>";

     tableHtml += "<A onmouseover=TagToTip('" ;

     tableHtml += spnID + "Loc" + "') onmouseout='UnTip()'";

     tableHtml += "href='#'>"

     tableHtml += allKraftLoc + "</TD>";

   }

 

else

 

   {

 

     if(locTargetPage[0] == "#")

 

 

    {

 

      //If Target Page is blank in the List, then display an alert

      //when user clicks on the link

     tableHtml += "<TD class='" + krftLocColTag + "'>";

     tableHtml += "<A onmouseover=TagToTip('" ;

     tableHtml += spnID + "Loc" + "') onmouseout='UnTip()' onclick='NoTargetPage()' ";

     tableHtml += "href='" + locTargetPage[0] + "'>";

     tableHtml += "<U><FONT color=#0000ff>" + allKraftLoc + "</FONT></U></TD>";

   }

 

   else //locTargetPage[0] is NOT #

 

   {

      tableHtml += "<TD class='" + krftLocColTag + "'>";

     tableHtml += "<A onmouseover=TagToTip('" ;

     tableHtml += spnID + "Loc" + "') onmouseout='UnTip()'";

     tableHtml += "href='" + locTargetPage[0] + "' target=_blank>";

     tableHtml += "<U><FONT color=#0000ff>" + allKraftLoc + "</FONT></U></TD>";

 

 

 

   }

 

}

     //Render Best for... column

     tableHtml += "<TD class='" + bestForColTag + "'>";

     tableHtml += bestFor + "</TD>";

 

     //Render Features and Benefits column

     tableHtml += "<TD class='" + ftrBnftColTag + "'>";

     tableHtml += ftrBnft + "</TD>";

 

     //Render Closing Row tag

     tableHtml += "</TR>";

 

    //Populate Tool column rollover text and image in SPAN tag and

    //append to existing SPAN tag

    spnHtml += "<SPAN id=" + spnID + ">";

    spnHtml += "<IMG height=128 width=225 hspace=8 vspace=4 align=right src='";

    spnHtml += rolloverImageURL[0] + "'>";

    spnHtml += "<P><STRONG>" + altTravelTitle + "</STRONG></P>";

    spnHtml += "<P>" + rolloverText + "</P>";

    spnHtml += "<P>Click your mouse for more " + altTravelTitle + " information. </P></SPAN>";

    //alert("Span HTML = " + spnHtml);

 

 

 

    //Populate Audience Size column rollover text in SPAN tag

    //append to existing SPAN tag

    //Create SPAN tag only if Audience Size rollover text is not blank

 

   if ((typeof audSizeRolloverText != 'undefined') || (audSizeRolloverText != '<p>&nbsp;</p>') ||

(audSizeRolloverText != '<div>&nbsp;</div>'))

 

  {

 

    spnHtml += "<SPAN id=" + spnID + "Size" + ">";

    spnHtml += "<P>" + audSizeRolloverText + "</P>";

    spnHtml += "</SPAN>";

  }   

 

    //Populate Locations column rollover text in SPAN tag

    //append to existing SPAN tag

    //If Location is All, don't show "click your mouse" text in rollover

   if (allKraftLoc == "All")

   {

     spnHtml += "<SPAN id=" + spnID + "Loc" + ">";

     spnHtml += "<P>" + locRolloverText + "</P>";

     spnHtml += "</SPAN>";    

   }

  else //Show "click your mouse" text in rollover

   {

    spnHtml += "<SPAN id=" + spnID + "Loc" + ">";

    spnHtml += "<P>" + locRolloverText + "</P>";

    spnHtml += "<P>Click your mouse for more information. </P></SPAN>";

   }   

 

 

}); //closing for jQuery for loop

 

     //Render closing Table Body and Table tags

     tableHtml += "</TBODY></TABLE>";

 

    //Close the <DIV> tag

    //Append the SPAN HTML to the existing span tag

    //This will contain the rollover text/images

    spnHtml += "</DIV>";

 

 

    //Assign the tableHTML code to the span tag INNER HTML property to display it

     spnElement.innerHTML = tableHtml ;

 

    //Construct the static HTML related to Audience size

    spnHtml += "<DIV class=key><P><STRONG>Location Availability:</STRONG><STRONG><i>

Limited</i></STRONG> - few to several locations; <STRONG><i>Moderate</i></STRONG> - many

locations; <STRONG><i>All </i></STRONG> - available to everyone at Kraft locations</P></DIV>";

 

    //Assign the Rollover text/image to the span tag

    spnRollover.innerHTML = spnHtml;

 

} //closing brace for (itemCount == 0) if statement   

 

//} //closing brace for SoapException if statement

 

} //closing brace for function

 

function NoTargetPage()

 

{

   alert("Target Page not defined. Please define a target Page in the Alternatives to Travel

SharePoint List.");

}

 

 

</script>

 

<span id="spnChart"></span>

<span id="spnRollover"></span>

HOW TO Display a Slideshow in SharePoint using jQuery/HTML

The code below shows how to display a slideshow in SharePoint using jQuery/HTML. I am using the jQuery Cycle plugin, which can be downloaded from the link below:

 

http://jquery.malsup.com/cycle/

 

Embed the entire code in a Content Editor Web Part.

 

<IMG ID="slideshowPicturePlaceholder" src="/_layouts/images/GEARS_AN.GIF" style="display:none"/>

<div id="slideshowContentArea" style="display:none">&nbsp;</div>

<script type="text/javascript" src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

<script type="text/javascript" src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery.cycle.all.2.88.js"></script>

 

<script>

 function GetAllImages()

{

$("#slideshowPicturePlaceholder").css("display", "block");   

var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";

   

 soapEnv += "<listName>Kraft Traveler's Pictures</listName>";

    soapEnv += "<query><Query><OrderBy Override='TRUE'><FieldRef Name='Created' Ascending='FALSE' /></OrderBy></Query></query>";

    soapEnv += "<viewFields><ViewFields><FieldRef Name='Title'/><FieldRef Name='ows_FileLeafRef'/></ViewFields></viewFields><rowLimit></rowLimit>";

    soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>";

 

var port = window.location.port;

if (port.length <= 0)

 port = "";

else

 port = ":"+port;

var webservice = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/_vti_bin/lists.asmx";

 

    $.ajax({

        url: webservice,

        type: "POST",

        dataType: "xml",

        data: soapEnv,

        complete: processQueryResults,

        contentType: "text/xml; charset=utf-8",

         error: function(xhr) {

        alert('Error!  Status = ' + xhr.status);}

    });

}

 

function processQueryResults(xData, status)

{

var port = window.location.port;

if (port.length <= 0)

 port = "";

else

 port = ":"+port;

//Change the below to point to your image library

var imageURL = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/Kraft%20Travelers%20Pictures/";

var itemURL = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/Kraft%20Travelers%20Pictures/Forms/DispForm.aspx?ID=";

 

$("#slideshowContentArea").html("")

$(xData.responseXML).find("[nodeName=z:row]").each(function() {

        var title = $(this).attr("ows_Title");

  var imageLink = imageURL+$(this).attr("ows_FileLeafRef").substring($(this).attr("ows_FileLeafRef").indexOf('#')+1);

  var itemLink = itemURL+$(this).attr("ows_ID");

  var liHtml = "<div><a href='"+itemLink+"' target='_blank' border='0'><img width='200' height='200' border='0'  src='" + imageLink +"'/></a><p align='center'>"+ title + "</p></div>";

        $("#slideshowContentArea").append(liHtml);

    });

 

$("#slideshowPicturePlaceholder").css("display", "none");

$("#slideshowContentArea").css("display", "block");

 

$('#slideshowContentArea').cycle({

    fx:     'fade',

    timeout: 6000,

    delay:  -3000

});

}

 

GetAllImages();

</script>

HOW TO Display Page Tools icons in SharePoint using jQuery/HTML

This code shows how to display Page Tools icons (Print this page, Email this page) in SharePoint.

 

Embed the entire code in a Content Editor Web Part.

 

<script type="text/javascript" src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

 

<style type="text/css">

img.hoverImage

{

  cursor:pointer;

}

</style>

 

 

<TABLE id=PageToolsIcons width="100%" border=0>

<TBODY>

<TR>

<TD align=middle>

<TABLE>

<TBODY>

<TR>

<TD align=middle>

<IMG class=hoverImage id=printBtn alt="Printer Friendly Version" src="http://intranet.na.kraft.com/sites/TC/SiteCollectionImages/printbutton.jpg">

</TD>

<TD align=middle>

<IMG class=hoverImage id=emailFriendBtn alt="Email link to a Friend" src="http://intranet.na.kraft.com/sites/TC/SiteCollectionImages/emailbutton.jpg">

</TD>

</TR><tr><td></td><td><TABLE align=right>

<TBODY>

<TR>

<TD><A href="#"><IMG src="http://intranet.na.kraft.com/sites/TC/SiteCollectionImages/flag_icon_canada.gif" border=0></A></TD>

<TD><A href="#"><STRONG><FONT color=#0000ff><U>Francais</U></FONT></STRONG></A></TD></TR></TBODY></TABLE></td></tr>

</TBODY>

</TABLE>

</TD>

</TR>

</TBODY>

</TABLE>

 

 

<SCRIPT>

 

 

$(document).ready(function()

{

var strlink = "";

$("link[rel='stylesheet']").each(function()

{

strlink += "<link rel = 'stylesheet' href='"+$(this).attr('href')+"' type='text/css'/>";

});

 

 

 

 

 

$("#printBtn").click(function()

{

 

 

var htmlStr ="<html><head>"+strlink+"</head><body>"+$("#MSO_ContentTable").parent().html()+"</body></html>";

var PrintingWindow = window.open("about:blank","","toolbar,width=800,height=600,scrollbars,resizable,menubar");

PrintingWindow.document.open();

PrintingWindow.document.write(htmlStr);

PrintingWindow.document.close();

PrintingWindow.focus();

PrintingWindow.document.getElementById("PageToolsIcons").style.display="none";

PrintingWindow.document.getElementById("ShareExperience").style.display="none";

//PrintingWindow.document.getElementById("Destination").style.display="none";

 

PrintingWindow.print();

 

});

 

$("#emailFriendBtn").click(function()

{

 

 

            var eMailSoapEnv =

            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \

                <soapenv:Body> \

                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \

                        <listName>E193795D-1DE9-4447-9CBE-4BBFFECE5A73</listName> \

                        <query> \

                              <Query> \

                                  <Where> \

                                        <Eq> \

                                           <FieldRef  Name='Title' /> \

<Value Type='Text'>" + jQuery.trim(document.title) + "</Value> \

                                                                        </Eq> \

                                  </Where> \

                               </Query> \

                        </query> \

                       <viewFields> \

                            <ViewFields> \

                              <FieldRef Name='Title' /> \

                              <FieldRef Name='Subject' /> \

                              <FieldRef Name='Body' /> \

                            </ViewFields> \

                        </viewFields> \

                    </GetListItems> \

                </soapenv:Body> \

            </soapenv:Envelope>";

 

 

//alert("Soap = " + eMailSoapEnv);

        $.ajax({

            url: "http://intranet.na.kraft.com/sites/TC/_vti_bin/lists.asmx",

            type: "POST",

            dataType: "xml",

            data: eMailSoapEnv,

            complete: buildEMailMessage,

            contentType: "text/xml; charset=\"utf-8\""

        });

 

 

});

 

function buildEMailMessage(xData, status) {

var mailSubject, mailBody;

 

 

//alert(xData.responseXML.xml);

 

//Get the Item Count here

$(xData.responseXML).find("rs\\:data").each(function() {

  itemCount = $(this).attr("ItemCount");

  //alert("Total Number of Items = " + itemCount); 

});

 

//Check if Item Count is 0

//If true, then there is no custom Subject and Body content

//Provide generic content

if (itemCount == 0)

 

 {

  //Create generic Subject line

  mailSubject = "I found this on the My Travel and Expense site and thought you'd be interested.";

 

  //Create generic Body text

   mailBody = "I was on the My Travel and Expense intranet site and I found this page related to " + jQuery.trim(document.title) + " that I thought you would find useful:%0A%0A" + document.location.href;

 

}

 

else //Retrieve custom Subject and Body values from SharePoint List

 

{

  //Loop through the result set returned in the SOAP

  //envelope courtesy of the SharePoint Lists Web Service

$(xData.responseXML).find("z\\:row").each(function() {

  //Get custom Subject line from List

  mailSubject = $(this).attr("ows_Subject");

 

  if(typeof(mailSubject) == 'undefined')

  {

    mailSubject = "I found this on the My Travel and Expense site and thought you'd be interested.";

  }

 

  //Get custom Body text from List

  mailBody = $(this).attr("ows_Body");

 

  if(typeof(mailBody) == 'undefined')

  {

    mailBody = "I was on the My Travel and Expense intranet site and I found this page related to " + jQuery.trim(document.title) + " that I thought you would find useful:";

  }

 

 

  //Append line break

  mailBody += "%0A%0A";

 

  //Append page Url

  mailBody += document.location.href;

 

  //alert("Subject from List = " + mailSubject);

  //alert("Subject from List = " + mailBody);

});

 

}

 

//Construct mailto

var mailtoS = "mailto:%20" + "&subject=" + mailSubject + "&body=" + mailBody;

 

//Display the message in the newly created e-mail message

window.navigate(mailtoS);

}

 

});

 

</SCRIPT>

HOW TO Create a tabbed interface in SharePoint using HTML/jQuery

The code below shows how to create a tabbed interface in SharePoint using HTML/jQuery.

 

Embed the entire code in a Content Editor Web Part.

 

<link href="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-ui.css" rel="stylesheet"

type="text/css"/>

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

 

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-ui.min.js"></script>

 

<script>

  $(document).ready(function() {

    $("#divCountries_NEW").tabs();

  });

 

</script>

 

 

<style type="text/css">

       .outerTable

        {

            width: 90%;

        }

        .innerTable

        {

            width: 90%;

        }

        .innerBlankTD

        {

            width: 1px;

        }

</style>

 

 

 

 

<div id="divCountries_NEW">

    <ul>

        <li><a href="#divUS_NEW"><span>US based employees</span></a></li>

        <li><a href="#divCanada_NEW"><span>Canada based employees</span></a></li>

        <li><a href="#divPuertoRico_NEW"><span>Puerto Rico based employees</span></a></li>

    </ul>

 

 

 

<DIV id="divUS_NEW">

<TABLE>

<TR>

<TD valign="middle"><IMG alt="" border="0"

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/United_States-32.png"></TD>

<TD style="vertical-align:middle"><FONT size="4">Booking & Reservations: United States based

employees</FONT></TD>

</TR>

</TABLE>

 

<TABLE class="outerTable" align="middle">

<TR>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/local_reservations.jpg">

</TD></TR>

<TR>

<TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Online

Reservations</SPAN></TD></TR>

<TR>

<TD align="middle">

<P align="left"><SPAN><SPAN class=ms-rteCustom-Kraft_Body><STRONG>Cliqbook</STRONG> is our online

booking tool for US based employees. <STRONG>Cliqbook</STRONG> must be used for all

<STRONG>US</STRONG> and <STRONG>Canadian</STRONG> reservations.</SPAN></P>

<UL>

<LI>

<DIV align="left"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN></SPAN></SPAN></SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff><A title=""

href="https://e-travelmanagement1.amadeus.com/login/kraftus"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook online booking

tool</FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></S

PAN></A></FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN

></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><A

href="http://intranet.na.kraft.com/sites/Travel/Old%20Documentsto%20be%20held/Miscellaneous%20Doc

uments/V7Training-Krafttutorial.ppt" target=_blank><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook  user

training</FONT></U></STRONG></SPAN></A></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN><A

href="http://hr.kraft.com/workplace/travel/e-travel/etravelFAQ.doc"

target=_blank><STRONG><U><SPAN class=ms-rteCustom-Kraft_Body><FONT color=#0000ff>Cliqbook

FAQs</SPAN></FONT></SPAN></U></STRONG></A></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>

</LI></UL></TD></TR></TBODY></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TBODY>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/international_reservations.j

pg"> </TD></TR>

<TR>

<TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>International

Reservations</SPAN></TD></TR>

<TR>

<TD align="middle">

<P align="left"><SPAN class=ms-rteCustom-Kraft_Body><SPAN>BCD will make business reservations for

individual travel and group events that do not require meeting support.</SPAN></SPAN></P>

<P align="center"></SPAN><SPAN><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Business Hours

Phone<BR></SPAN><STRONG>1-888-391-6785<BR></STRONG><SPAN class=ms-rteCustom-Kraft_Body>(hours

7:00 a.m. to 6:00 p.m. CST)

</SPAN><BR><BR>

<SPAN class=ms-rteCustom-Kraft_Minor_Headline>After Hours Help Hotline</SPAN><BR>

<STRONG>1-888-635-5223<BR></STRONG><SPAN class=ms-rteCustom-Kraft_Body>(Toll-Free in the US and

Canada)</SPAN><BR><P align="left">Note: Fees apply for non-emergency calls made to this line and

will be billed to traveler’s credit card.</P>

<STRONG>1-313-271-7887</STRONG><BR><SPAN class=ms-rteCustom-Kraft_Body>(Collect outside the US

and Canada)</SPAN><BR></P>

<P align="left">Identify yourself as a Kraft employee by using the access code AOR1.</P><BR>

<P align="left"><I>The cost for calls made to the hotline during Omaha's business hours, and for

non-emergencies will be charged back to the traveler's cost center.</I> </P>

<P align=left></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><STRONG><BR>&nbsp;</P></STRONG></SPAN></SPAN></TD></TR></TBOD

Y></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align=middle><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/group_reservations.jpg">

</TD></TR>

<TR>

<TD align=middle><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Group Planning &

Reservations</SPAN></TD></TR>

<TR>

<TD align=middle><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN class=ms-rteCustom-Kraft_Body>

<P align=left><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN class=ms-rteCustom-Kraft_Body>Meetings and

Incentives is&nbsp;for travel arrangements on all group events requiring meeting

management.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN> The Meetings and Incentives link will take

you to Meeting Central, a tool that has been developed exclusively for Kraft Foods to centralize

all meetings. The information collected allows Kraft Foods as a company to have a calendar of all

meetings, leverage meeting and event spend volume with suppliers, identify preferred suppliers

and achieve cost savings and efficiencies company wide while mitigating risk.</P>

<UL>

<LI>

<DIV align=left></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body>Click <A title=""

href="http://www.meetings-incentives.com/meetingcentral/kraft/updated/meetingcentral/"><STRONG><U

><FONT color=#0000ff>Meetings and Incentives</FONT></U></STRONG></A> to make your group

reservations.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></LI></UL>

<P align=left>&nbsp;</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>

 

<div id="divCanada_NEW">

<TABLE>

<TR>

<TD><IMG alt="" border="0"

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/Canada-32.png"></TD>

<TD style="vertical-align:middle"><FONT size="4">Booking & Reservations: Canada based

employees</FONT></TD>

</TR>

</TABLE>

<TABLE class="outerTable" align="middle">

<TR>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/local_reservations.jpg">

</TD></TR>

<TR>

<TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Online

Reservations</SPAN></TD></TR>

<TR>

<TD align="middle">

<P align="left"><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><STRONG>Cliqbook</STRONG> is our

online booking tool for Canada based employees. <STRONG>Cliqbook</STRONG> must be used for all

<STRONG>Canadian</STRONG> and <STRONG>US</STRONG> reservations.</SPAN></P>

<UL>

<LI>

<DIV align="left"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN></SPAN></SPAN></SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff><A title=""

href="https://e-travelmanagement1.amadeus.com/login/kraftus"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook online booking

tool</FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></S

PAN></A></FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN

></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><A

href="http://intranet.na.kraft.com/sites/Travel/Old%20Documentsto%20be%20held/Miscellaneous%20Doc

uments/V7Training-Krafttutorial.ppt" target=_blank><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook  user

training</FONT></U></STRONG></SPAN></A></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN><A

href="http://hr.kraft.com/workplace/travel/e-travel/etravelFAQ.doc"

target=_blank><STRONG><U><SPAN class=ms-rteCustom-Kraft_Body><FONT color=#0000ff>Cliqbook

FAQs</SPAN></FONT></SPAN></U></STRONG></A></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>

</LI></UL></TD></TR></TBODY></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TBODY>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/international_reservations.j

pg"> </TD></TR>

<TR>

<TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>International

Reservations</SPAN></TD></TR>

<TR>

<TD align="middle">

<P align="left"><SPAN class=ms-rteCustom-Kraft_Body>BCD can make reservations for individual

travel and group events that do not require meeting support.</SPAN></P><SPAN

class=ms-rteCustom-Kraft_Body>

<P align="center"><SPAN

class=ms-rteCustom-Kraft_Minor_Headline>Reservations<BR></SPAN><STRONG>888-642-8884<BR></STRONG><

BR><SPAN class=ms-rteCustom-Kraft_Body>Travel Agent Supervisor: <br>Faiyaz

Keshvani<BR>Phone:&nbsp;<STRONG>416-507-3022</STRONG><BR>Email: <STRONG><U><FONT color=#0000ff><A

title=""

href="mailto:%20faiyaz.h.keshvani@aexp.com">faiyaz.h.keshvani@aexp.com</A></FONT></U></STRONG></S

PAN></P>

<P><SPAN class=ms-rteCustom-Kraft_Minor_Headline>BCD Emergency Travel Center</SPAN></P>

<P>24 Hour Emergency Services:<BR><STRONG>800-434-2941</STRONG><BR><BR>Where toll free not

accessible:<BR><STRONG>613-237-3263</STRONG> (call collect)&nbsp;<BR>Access code:

<STRONG>S-X2Y0</STRONG><EM>&nbsp;</EM></P>

<P align=left></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><STRONG><BR>&nbsp;</P></STRONG></SPAN></SPAN></TD></TR></TBOD

Y></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align=middle>&nbsp;</TD></TR>

<TR>

<TD align=middle>&nbsp;</TD></TR>

<TR>

<TD align=middle>&nbsp;</TD></TR>

</TABLE>

</TD>

</TR>

</TABLE>

</div>

<div id="divPuertoRico_NEW">

<TABLE>

<TR>

<TD><IMG alt="" border="0"

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/Puerto_Rico-32.png"></TD>

<TD style="vertical-align:middle"><FONT size="4">Booking & Reservations: Puerto Rico based

employees</FONT></TD>

 

</TR>

</TABLE>

 

    <TABLE class="outerTable" align="middle">

<TR>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/local_reservations.jpg">

</TD></TR>

<TR>

<TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Online

Reservations</SPAN></TD></TR>

<TR>

<TD align="middle">

<P align="left"><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><STRONG>Cliqbook</STRONG> is our

online booking tool for Puerto Rico based employees. <STRONG>Cliqbook</STRONG> must be used for

all travel within North America.</SPAN></P>

<UL>

<LI>

<DIV align="left"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN></SPAN></SPAN></SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff><A title=""

href="https://e-travelmanagement1.amadeus.com/login/kraftus"><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook online booking

tool</FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></S

PAN></A></FONT></U></STRONG></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN

></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><A

href="http://intranet.na.kraft.com/sites/Travel/Old%20Documentsto%20be%20held/Miscellaneous%20Doc

uments/V7Training-Krafttutorial.ppt" target=_blank><SPAN

class=ms-rteCustom-Kraft_Body><STRONG><U><FONT color=#0000ff>Cliqbook  user

training</FONT></U></STRONG></SPAN></A></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></LI>

<LI>

<DIV align=left><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN><SPAN><SPAN><SPAN><SPAN><A

href="http://hr.kraft.com/workplace/travel/e-travel/etravelFAQ.doc"

target=_blank><STRONG><U><SPAN class=ms-rteCustom-Kraft_Body><FONT color=#0000ff>Cliqbook

FAQs</SPAN></FONT></SPAN></U></STRONG></A></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>

</LI></UL></TD></TR></TBODY></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TBODY>

<TR>

<TD align="middle"><IMG alt=""

src="http://intranet.na.kraft.com/sites/TC/Travel%20Central%20Images/international_reservations.j

pg"> </TD></TR>

<TR><TD align="middle"><SPAN class=ms-rteCustom-Kraft_Minor_Headline>International

Reservations</SPAN></TD></TR><TR>

<TD align="middle">

<P align="left"><SPAN class=ms-rteCustom-Kraft_Body><SPAN>BCD can make reservations for

individual travel and group events that do not require meeting support.</SPAN></SPAN></P><SPAN

class=ms-rteCustom-Kraft_Body><SPAN></SPAN></SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN>

<P align="center"></SPAN><SPAN><SPAN><SPAN class=ms-rteCustom-Kraft_Body><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><SPAN class=ms-rteCustom-Kraft_Minor_Headline>Business Hours

Phone<BR></SPAN><STRONG>1-888-391-6785<BR></STRONG><SPAN class=ms-rteCustom-Kraft_Body>(hours

7:00 a.m. to 6:00 p.m. CST)

</SPAN><BR><BR>

<SPAN class=ms-rteCustom-Kraft_Minor_Headline>After Hours Help Hotline</SPAN><BR>

<STRONG>1-888-635-5223<BR></STRONG><SPAN class=ms-rteCustom-Kraft_Body>(Toll-Free in the US and

Canada)</SPAN><BR><BR><STRONG>1-313-271-7887</STRONG><BR><SPAN

class=ms-rteCustom-Kraft_Body>(Collect outside the US and Canada)</SPAN><BR></P>

<P align="left">Identify yourself as a Kraft employee by using the access code AOR1.</P><BR>

<P align="left"><I>The cost for calls made to the hotline during Omaha's business hours, and for

non-emergencies will be charged back to the traveler's cost center.</I> </P>

<P align=left></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><SPAN

class=ms-rteCustom-Kraft_Body><SPAN><STRONG><BR>&nbsp;</P></STRONG></SPAN></SPAN></TD></TR></TBOD

Y></TABLE></TD>

<TD class="innerBlankTD">&nbsp; </TD>

<TD width="33%" align="middle" valign="top">

<TABLE>

<TR>

<TD align=middle>&nbsp;</TD></TR>

<TR>

<TD align=middle>&nbsp;</TD></TR>

<TR>

<TD align=middle>&nbsp;</TD></TR>

</TABLE>

</TD>

</TR></TABLE></TD></TR></TABLE>

 

    </div>

</div>

HOW TO Create Terms and Conditions page in SharePoint using HTML/jQuery/List Web Service

The code below shows how to create a Terms and Conditions page in SharePoint using HTML/jQuery/List Web Service. It uses the UpdateListItem method to create an Item in the SharePoint List.

 

Embed the entire code in a Content Editor Web Part.

 

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery-1.3.2.min.js"></script>

 

<script type="text/javascript"

src="http://intranet.na.kraft.com/sites/TC/jQuery/jquery.SPServices-0.5.6.min.js"></script>

 

 

<SCRIPT>

 

$(document).ready(function() {

$("#btnAccept").click(function()

{

 

//alert("jQuery - You clicked the Accept button");

var chkBoxField = document.getElementById("chkBoxAccept");

    if (chkBoxField.checked == false )

{

alert("Please click the checkbox to accept the Terms and Conditions.");

return false;

}

else

{

//Create a New Item in the SharePoint List

//We are going to capture only the Yes responses in the SP List

//Name of SP List is - American Express Terms and Conditions

CreateNewAmExItem();

 

//Redirect the user to the AmEx Instructions page

location.href="http://intranet.na.kraft.com/sites/TC/Expenses/Pages/AmericanExpressFormInstructio

ns.aspx";

}

 

});

 

 

$("#btnCancel").click(function()

 

{

 

//This function is called when the user clicks on the Cancel button

alert("You clicked Cancel. You will now be redirected to the My Travel and Expense site Home

page.");

 

//Redirect the user to the Home page

location.href="http://intranet.na.kraft.com/sites/TC/";

 

});

 

 

});

 

</SCRIPT>

 

 

<script type="text/javascript">

 

function CreateNewAmExItem() {

 

//The new Item in the SP List is created here

//alert ("In CreateNewAmExItem");

 

//Get Current Date

var currentTime = new Date();

var month = currentTime.getMonth() + 1;

var day = currentTime.getDate();

var year = currentTime.getFullYear();

 

 

//Get Current User's First Name and Last Name

var firstName = $().SPServices.SPGetCurrentUser({

                   fieldName: "FirstName"

});

 

var lastName = $().SPServices.SPGetCurrentUser({

                   fieldName: "LastName"

});

 

//Build the current date

var currentDate = month + "/" + day + "/" + year;

 

//Store the current user name

var currentUserName = firstName + " " + lastName

 

//Set the Title

var title = "Terms and Conditions - Acceptance Information";  

 

//alert("Title = " + title);

//alert ("Current User Name: " + currentUserName);

//alert ("Today's date is: " + currentDate);

 

 var batch =

        "<Batch OnError=\"Continue\"> \

            <Method ID=\"1\" Cmd=\"New\"> \

                <Field Name=\"Title\">" + title + "</Field> \

                <Field Name=\"User_x0020_Name\">" + currentUserName + "</Field> \

<Field Name=\"Accepted_x0020_On\">" + currentDate + "</Field> \

                </Method> \

        </Batch>";

 

    var soapEnv =

        "<?xml version=\"1.0\" encoding=\"utf-8\"?> \

        <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \

            xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \

            xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"> \

          <soap:Body> \

            <UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"> \

              <listName>American Express Terms and Conditions</listName> \

              <updates> \

                " + batch + "</updates> \

            </UpdateListItems> \

          </soap:Body> \

        </soap:Envelope>";

 

    //alert("Batch = " + batch);

    //alert("SoapEnv = " + soapEnv);

 

$.ajax({

        url: "http://intranet.na.kraft.com/sites/TC/expenses/_vti_bin/lists.asmx",

        beforeSend: function(xhr) {

            xhr.setRequestHeader("SOAPAction",

            "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");

        },

        type: "POST",

        dataType: "xml",

        data: soapEnv,

        contentType: "text/xml; charset=\"utf-8\""

    });

 

}

 

 

 

//-->

</script>

 

 

 

 

 

<BR>

<TABLE width="800px" align="center">

 

<TR>

<TD><SPAN class=ms-rteCustom-Kraft_Major_Headline>Employee Certification and Manager's Approval

for American Express and AT&amp;T VTNS Corporate Card</SPAN></TD>

</TR>

 

<TR>

<TD>

<P><SPAN class=ms-rteCustom-Kraft_Body>I certify that I am an employee of Kraft Foods and that I

am authorized to receive an American Express and an AT&T VTNS Corporate Card to be used for

business purposes of the Company under the terms of our existing agreement with American Express

Travel Related Services Company, Inc. and Virtual Telecommunications Network Services.</SPAN>

</P>

 

<P><SPAN class=ms-rteCustom-Kraft_Body>I understand the American Express Corporate Card will be

linked to the AT&T Calling Card and a monthly billing statement will come from American Express

covering all AT&T Calling Card charges.</SPAN> </P>

 

<P><SPAN class=ms-rteCustom-Kraft_Body>I understand that I am personally responsible to pay for

all charges and fees billed to my American Express Corporate Card and I authorize Kraft Foods to

deduct the amount of any past due Corporate Express cash balances charged to my Corporate Card

from any amounts owed to me (including salary, vacation, and/or separation pay).</SPAN></P>

 

<P><SPAN class=ms-rteCustom-Kraft_Body>I agree to surrender the card immediately upon my

retirement or upon termination of employment. </SPAN></P>

 

<P><SPAN class=ms-rteCustom-Kraft_Body><STRONG>I understand that the card is to be used ONLY for

Business purposes and I am directly responsible for REVIEWING AMEX statements monthly to ensure

charges and expenses are accurate. Utilization of this card for personal use is STRICTLY

prohibited and is in direct violation of Company Policy and may result in disciplinary action up

to and including termination.</STRONG></SPAN></P>

</TD>

</TR>

<TR>

<TD>&nbsp;</TD>

</TR>

<TR>

<TD>

<input type="checkbox" value="0" id="chkBoxAccept"><SPAN class=ms-rteCustom-Kraft_Body>Click the

checkbox to accept the above Terms and Conditions.</SPAN>

</TD>

</TR>

<TR>

<TD>&nbsp;</TD>

</TR>

<TR>

<TD>

<input type="button" value="Accept" id="btnAccept">

<input type="button" value="Cancel" id="btnCancel">

</TD>

</TR>

 

 

</TABLE>

Tuesday, May 4, 2010

HOW TO Display Expand/Collapse icons in a SharePoint List

Insert the following code in a Content Editor Web Part to display +/- icons to expand/collapse Items in a SharePoint List. The icons will appear in the Actions Menu in the List.

<script type="text/javascript" src="/../JavaScript%20Library/jquery-1.2.6.min.js"></script>

<script type="text/javascript">

function collapseGroups() {

$("img[src='/_layouts/images/minus.gif']:visible").parent().click();

}

function expandGroups() {

$("img[src='/_layouts/images/plus.gif']:visible").parent().click();

}

$(function() {

var expandAll = "<a href='#' onClick="

+'"'+"this.href='javascript:expandGroups()'"

+'"><img title="expand all groups" style="border:none;" alt="expand all" src="/_layouts/images/collapseplus.gif"></a>';

var collapseAll = "<a href='#' onClick="+'"'

+"this.href='javascript:collapseGroups()'"

+'"><img title="collapse all groups" style="border:none;" alt="collapse all" src="/_layouts/images/collapseminus.gif"></a>';

$("td.ms-toolbar[width='99%']").append(expandAll).append(collapseAll);

});

</script>