<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "/home/amgltdbi/public_html/cmsAdmin/lib/viewer_functions.php";

  list($clientsRecords, $clientsMetaData) = getRecords(array(
    'tableName'   => 'clients',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $clientsRecord = @$clientsRecords[0]; // get first record

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1" />
<TITLE><?php echo $clientsRecord['title'] ?></TITLE>
<LINK HREF="styles.css" REL="stylesheet" TYPE="text/css" />
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'images-masthead/01.jpg'
theImages[1] = 'images-masthead/02.jpg'
theImages[2] = 'images-masthead/03.jpg'
theImages[3] = 'images-masthead/04.jpg'
theImages[4] = 'images-masthead/05.jpg'
theImages[5] = 'images-masthead/masthead-image-home-borneo.jpg'
theImages[6] = 'images-masthead/07.jpg'
theImages[7] = 'images-masthead/08.jpg'
theImages[8] = 'images-masthead/09.jpg'
theImages[9] = 'images-masthead/10.jpg'
theImages[10] = 'images-masthead/11.jpg'
theImages[11] = 'images-masthead/12.jpg'
theImages[12] = 'images-masthead/13.jpg'
theImages[13] = 'images-masthead/14.jpg'
theImages[14] = 'images-masthead/15.jpg'
theImages[15] = 'images-masthead/16.jpg'
theImages[16] = 'images-masthead/17.jpg'
theImages[17] = 'images-masthead/18.jpg'
theImages[18] = 'images-masthead/19.jpg'
theImages[19] = 'images-masthead/20.jpg'
theImages[20] = 'images-masthead/21.jpg'
theImages[21] = 'images-masthead/22.jpg'
theImages[22] = 'images-masthead/23.jpg'
theImages[23] = 'images-masthead/24.jpg'
theImages[24] = 'images-masthead/25.jpg'
theImages[25] = 'images-masthead/26.jpg'
theImages[26] = 'images-masthead/27.jpg'
theImages[27] = 'images-masthead/28.jpg'
theImages[28] = 'images-masthead/29.jpg'
theImages[29] = 'images-masthead/30.jpg'
theImages[30] = 'images-masthead/31.jpg'
theImages[31] = 'images-masthead/32.jpg'
theImages[32] = 'images-masthead/33.jpg'
theImages[33] = 'images-masthead/34.jpg'
theImages[34] = 'images-masthead/35.jpg'
theImages[35] = 'images-masthead/36.jpg'
theImages[36] = 'images-masthead/37.jpg'
theImages[37] = 'images-masthead/38.jpg'
theImages[38] = 'images-masthead/39.jpg'
theImages[39] = 'images-masthead/40.jpg'
theImages[40] = 'images-masthead/41.jpg'
theImages[41] = 'images-masthead/42.jpg'
// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->
</SCRIPT><SCRIPT TYPE="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</SCRIPT>
<script language="javascript">

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

</script>
 </HEAD>

<BODY onLoad="MM_preloadImages('images-navigation/nav-what-we-do-on.gif','images-navigation/nav-clients-on.gif','images-navigation/nav-our-team-on.gif','images-navigation/nav-24pr-on.gif','images-navigation/nav-diary-on.gif','images-navigation/nav-associations-on.gif')">
<TABLE BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0" ID="Outer">
  <TR>
    <TD CLASS="tdDarkGreyOuterCell"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ID="Inner">
      <TR>
        <TD ROWSPAN="2"><IMG SRC="images/single-pixel.gif" WIDTH="25" HEIGHT="25" /></TD>
        <TD><TABLE WIDTH="940" BORDER="0" CELLPADDING="0" CELLSPACING="0" ID="Masthead">
          <TR>
            <TD CLASS="tdMastheadLeft"><A HREF="index.php"><IMG SRC="images/logo-amg.gif" WIDTH="130" HEIGHT="67" BORDER="0" /></A></TD>
            <TD CLASS="tdMastheadRight"><TABLE BORDER="0" ALIGN="RIGHT" CELLPADDING="0" CELLSPACING="0" ID="Contact">
              <TR>
                <TD><img src="images/single-pixel.gif" width="10" height="1" /></TD>
                <TD NOWRAP><img src="images/single-pixel.gif" width="10" height="1" /></TD>
                <TD NOWRAP><img src="images/single-pixel.gif" width="10" height="1" /></TD>
                <TD rowspan="2" NOWRAP><a href="http://en-gb.facebook.com/pages/Advantage-Management-Group/93251753455" target="_blank"><img src="images/logo-facebook.gif" width="62" height="14" border="0" /></a></TD>
                <TD NOWRAP><img src="images/single-pixel.gif" width="10" height="1" /></TD>
                <TD rowspan="2" NOWRAP><a href="http://twitter.com/AMGLTD" target="_blank"><img src="images/logo-twitter.gif" width="62" height="13" border="0" /></a></TD>
              </TR>
              <TR>
                <TD><A HREF="index.php"><IMG SRC="images/icon-home.gif" WIDTH="17" HEIGHT="14" BORDER="0" /></A></TD>
                <TD NOWRAP><P CLASS="pMastheadContactText"> &nbsp;| <a href="contact.shtml">Contact Us</a></P></TD>
                <TD NOWRAP><p class="pMastheadContactText">&nbsp;|&nbsp;</p></TD>
                <TD NOWRAP><p class="pMastheadContactText">&nbsp;|&nbsp;</p></TD>
              </TR>
              <TR>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="17" HEIGHT="1" /></TD>
                <TD colspan="5"><IMG SRC="images/single-pixel.gif" WIDTH="17" HEIGHT="1" /></TD>
                </TR>
            </TABLE></TD>
          </TR>
          <TR>
            <TD COLSPAN="2" CLASS="tdMastheadImageCell"><SCRIPT LANGUAGE="JavaScript">
	  <!-- Begin
showImage();
//  End -->
          </SCRIPT></TD>
          </TR>
          <TR>
            <TD COLSPAN="2" CLASS="tdNavigationOuterCell"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ID="Nvaigation">
              <TR>
                <TD><A HREF="what.shtml"><IMG SRC="images-navigation/nav-what-we-do.gif" NAME="what" WIDTH="118" HEIGHT="35" BORDER="0" ID="what" onMouseOver="MM_swapImage('what','','images-navigation/nav-what-we-do-on.gif',1)" onMouseOut="MM_swapImgRestore()" /></A></TD>
                <TD><A HREF="clients.shtml"><IMG SRC="images-navigation/nav-clients-on.gif" NAME="clients" WIDTH="118" HEIGHT="35" BORDER="0" ID="clients" onMouseOver="MM_swapImage('clients','','images-navigation/nav-clients-on.gif',1)" onMouseOut="MM_swapImgRestore()" /></A></TD>
                <TD><A HREF="team.shtml"><IMG SRC="images-navigation/nav-our-team.gif" NAME="team" WIDTH="118" HEIGHT="35" BORDER="0" ID="team" onMouseOver="MM_swapImage('team','','images-navigation/nav-our-team-on.gif',1)" onMouseOut="MM_swapImgRestore()" /></A></TD>
                <TD><A HREF="24pr.shtml"><IMG SRC="images-navigation/nav-24pr.gif" NAME="pr" WIDTH="118" HEIGHT="35" BORDER="0" ID="pr" onMouseOver="MM_swapImage('pr','','images-navigation/nav-24pr-on.gif',1)" onMouseOut="MM_swapImgRestore()" /></A></TD>
                <td><a href="associations.php"><img src="images-navigation/nav-associations.gif" name="associations" width="118" height="35" border="0" id="associations" onmouseover="MM_swapImage('associations','','images-navigation/nav-associations-on.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
                <TD><A HREF="diary.shtml"><IMG SRC="images-navigation/nav-diary.gif" NAME="diary" WIDTH="118" HEIGHT="35" BORDER="0" ID="diary" onMouseOver="MM_swapImage('diary','','images-navigation/nav-diary-on.gif',1)" onMouseOut="MM_swapImgRestore()" /></A></TD>
              </TR>
            </TABLE></TD>
            </TR>
          <TR>
            <TD><IMG SRC="images/single-pixel.gif" WIDTH="470" HEIGHT="1" /></TD>
            <TD><IMG SRC="images/single-pixel.gif" WIDTH="470" HEIGHT="1" /></TD>
          </TR>
        </TABLE></TD>
        <TD ROWSPAN="2"><IMG SRC="images/single-pixel.gif" WIDTH="25" HEIGHT="25" /></TD>
      </TR>
      <TR>
        <TD>  <!-- STEP2: Display Records (Paste this where you want your records to be listed) --><TABLE WIDTH="940" BORDER="0" CELLPADDING="0" CELLSPACING="0" ID="Main Content Outer">
          <TR>
            <TD CLASS="tdMainContentOuterCell"><TABLE WIDTH="708" BORDER="0" CELLPADDING="0" CELLSPACING="0" ID="Main Content">
              <TR>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="20" HEIGHT="20" /></TD>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="137" HEIGHT="20" /></TD>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="20" HEIGHT="20" /></TD>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="511" HEIGHT="20" /></TD>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="20" HEIGHT="20" /></TD>
              </TR>
              <TR>
                <TD ROWSPAN="3">&nbsp;</TD>
                <TD COLSPAN="3"><H1><?php echo $clientsRecord['title'] ?></H1>
                    <P CLASS="pNoPadClients"><a href="clientsList.php"><STRONG>&laquo; Client List</STRONG></a></P>                    </TD>
                <TD ROWSPAN="3">&nbsp;</TD>
              </TR>
              <TR>
                <TD COLSPAN="3"><IMG SRC="images/rule.gif" WIDTH="668" HEIGHT="17"></TD>
              </TR>
              
              <TR>
                <TD>              <!-- STEP 2a: Display Uploads for field 'photos' (Paste this anywhere inside STEP2 to display uploads) -->
            <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
            <?php foreach ($clientsRecord['photos'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
        <img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" class="imgClient" />
        
          <?php elseif ($upload['isImage']): ?>
        <img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" class="imgClient" />
        
          <?php else: ?><?php endif ?>
            <?php endforeach ?>
              <!-- STEP2a: /Display Uploads --></TD>
                <TD>&nbsp;</TD>
                <TD>
<?php echo $clientsRecord['content'] ?>
<p><strong>
<a href="<?php echo $record['_link'] ?>" onclick="NewWindow(this.href,'name','400','400','no');return false"><?php echo $clientsRecord['sub_client_link:label'] ?></a></strong></p>
<p class="pNoPadClients"><?php echo $clientsRecord['additional_information'] ?></p>
      <p class="pNoPadClients">
        <?php if (!$clientsRecord): ?>
          <?php endif ?>
          </p>
      <!-- STEP 2a: Display Uploads for field 'factsheet' (Paste this anywhere inside STEP2 to display uploads) -->
            <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
            <?php foreach ($clientsRecord['factsheet'] as $upload): ?>
            <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
        
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" />
        
            <?php else: ?>
            <p><a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['info1'] ?>
 &raquo;</a></p>
            <?php endif ?>
            <?php endforeach ?>
			
			
			<p><?php if ($clientsRecord['facebook_link']):  // If subtitle field has content, then... (technically reads as: if `subtitle` is TRUE then... ) 
?> <a href="<?php echo $clientsRecord['facebook_link'] ?>" target="_blank"><img src="images/logo-facebook.gif" width="62" height="14" border="0" /></a>&nbsp;&nbsp;&nbsp;<?php endif; ?>
      <?php if ($clientsRecord['twitter_link']):  // If subtitle field has content, then... (technically reads as: if `subtitle` is TRUE then... ) 
?> <a href="<?php echo $clientsRecord['twitter_link'] ?>" target="_blank"><img src="images/logo-twitter.gif" width="62" height="13" border="0" /></a><?php endif; ?>
</p>
              <!-- STEP2a: /Display Uploads --></TD>
              </TR>
              <TR>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="20" HEIGHT="20" /></TD>
                <TD COLSPAN="3"><IMG SRC="images/single-pixel.gif" WIDTH="668" HEIGHT="20" /></TD>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="20" HEIGHT="20" /></TD>
              </TR>
            </TABLE></TD>
            <TD CLASS="tdRightColumn"><TABLE BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0" ID="Clients">
              
              <TR>
                <TD class="tdClientLogoCell"><!-- STEP 2a: Display Uploads for field 'client_logo' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($clientsRecord['client_logo'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />

          <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" />

          <?php endif ?>
        <?php endforeach ?>
      <!-- STEP2a: /Display Uploads --></TD>
              </TR>
              <TR>
                <TD><IMG SRC="images/single-pixel.gif" WIDTH="194" HEIGHT="10" /></TD>
              </TR>
              
            </TABLE><!-- /STEP2: Display Records -->
              <TABLE WIDTH="194" BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0" ID="Testimonials">
                <TR>
                  <TD><H4>What clients say about us</H4>
                      <P CLASS="pTestimonialsPanelText">&ldquo;We  would like to thank AMG for their absolute professionalism  and dedication to a job well done.&rdquo;<BR />
                          <EM>Elke  Menz </EM><EM>and <EM>Richard Weilers, </EM></EM><EM>Southern Sun</EM></P>
                    <P CLASS="pSmallText11pxRuleThick"><A HREF="clients-testimonials.shtml"><STRONG>More client testimonials &raquo;</STRONG></A></P></TD>
                </TR>
              </TABLE></TD>
          </TR>
        </TABLE></TD>
        </TR>
      <TR>
        <TD><IMG SRC="images/single-pixel.gif" WIDTH="25" HEIGHT="25" /></TD>
        <td><?php require_once('_include-footer.php'); ?></td>
        <TD><IMG SRC="images/single-pixel.gif" WIDTH="25" HEIGHT="25" /></TD>
      </TR>
    </TABLE></TD>
  </TR>
</TABLE>
</BODY>
</HTML>
