/* ------------------------------------------------------------------------ */
/* ------------------------------ runSwfs --------------------------------- */
/* ------------------------------------------------------------------------ */
function runSwf_navMain(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="910" height="95">\n')
    document.write('<param name="movie" value="images/navMain.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navMain.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="910" height="95"></embed>\n')
    document.write('</object>\n')
}
function runSwf_intro()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="910" height="410">\n')
    document.write('<param name="movie" value="images/intro.swf">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/intro.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="910" height="410"></embed>\n')
    document.write('</object>\n')
}
function runSwf_index_box03()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="150">\n')
    document.write('<param name="movie" value="images/index_box03.swf">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/index_box03.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="150"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navServices(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="910" height="160">\n')
    document.write('<param name="movie" value="images/navServices.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navServices.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="910" height="160"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_products(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="370">\n')
    document.write('<param name="movie" value="images/navSub_products.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_products.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="185" height="370"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_aboutUs(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="110">\n')
    document.write('<param name="movie" value="images/navSub_aboutUs.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_aboutUs.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="185" height="110"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_services(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="150">\n')
    document.write('<param name="movie" value="images/navSub_services.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_services.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="185" height="150"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_quality(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="170">\n')
    document.write('<param name="movie" value="images/navSub_quality.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_quality.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="185" height="170"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_design(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="130">\n')
    document.write('<param name="movie" value="images/navSub_design.swf?target='+location+'">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_design.swf?target='+location+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="185" height="130"></embed>\n')
    document.write('</object>\n')
}
function runSwf_mapRecord()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="500" height="340">\n')
    document.write('<param name="movie" value="images/mapRecord.swf">\n')
	document.write('<param name="wmode" value="transparent">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/mapRecord.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="340"></embed>\n')
    document.write('</object>\n')
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- DW Functions ------------------------------ */
/* ------------------------------------------------------------------------ */
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_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_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];}
}
/* ------------------------------------------------------------------------ */
/* ---------------- Buttons and Tagline on the Right ---------------------- */
/* ------------------------------------------------------------------------ */
function generate_rightColumn(){
	document.write('<a href="downloads/Completion Products - Corporate Brochure.pdf" target="_blank">')
	document.write('<img src="images/butRight_companyBrochure.png" width="185" height="70" class="butRight" />')
	document.write('</a>')
	document.write('<img src="images/taglineRight_01.jpg" width="185" height="102" class="taglineRight" />')
}
/* ------------------------------------------------------------------------ */
/* ---------------- Footer Address & Copyright Message -------------------- */
/* ------------------------------------------------------------------------ */
function generate_footerButtons(){
	//document.write('[ <a href="privacyStatement.html">Privacy Statement</a> ] &nbsp;&nbsp; [ <a href="termsNconditions.html">Terms and Conditions</a> ]')
	document.write('<p><a href="index.html">Home</a> | <a href="aboutUs_intro.html">About Us</a> | <a href="product_overview.html">Products</a> | <a href="design_technology.html">Design &amp; Engineering</a> | <a href="quality_introduction.html">Quality</a> | <a href="sitemap.html">Sitemap</a> | <a href="contactUs.html">Contact Us</a></p>')
	document.write('<p><a href="market_refining.html">Refining &amp; Petrochemical</a> | <a href="market_oil.html">Oil &amp; Gas</a> | <a href="market_water.html">Water Treatment</a> | <a href="market_architectural.html">Architectural</a> | <a href="market_general.html">General Industrial</a></p>')
	document.write('<a href="privacyStatement.html">Privacy Statement</a> | <a href="termsNconditions.html">Terms and Conditions</a>')
}

function generate_footerAddress(){
	document.write('<p><strong>Completion Products Pte Ltd</strong></p>')
	document.write('<p>No. 13 Tuas Avenue 6</p>')
	document.write('<p>Singapore 639301</p>')
	document.write('<p>Tel:&nbsp; +65 6897 8970</p>')
	document.write('<p>Fax: +65 6897 8570</p>')
	document.write('<p>Email: <a href="mailto:sales@completionproducts.com">sales@completionproducts.com</a></p>')
}
function generate_copyrightMsg(){
	document.write('Copyright &copy; Completion Products Pte Ltd. All Rights Reserved.')
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- Floating Anchor --------------------------- */
/* ------------------------------------------------------------------------ */
var target_x = 0;
var target_y = 200;

var has_inner = typeof(window.innerWidth) == 'number';
var has_element = document.documentElement && document.documentElement.clientWidth;

var fm_id='floatingAnchor';

var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y;

function move_menu()
{
    if (document.layers)
    {
        //floating_menu.left = fm_next_x;
        floating_menu.top = fm_next_y;
    }
    else
    {
        //floating_menu.style.left = fm_next_x + 'px';
        floating_menu.style.top = fm_next_y + 'px';
    }
}

function compute_shifts()
{
    fm_shift_x = has_inner
        ? pageXOffset
        : has_element
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;
    if (target_x < 0)
        fm_shift_x += has_inner
            ? window.innerWidth
            : has_element
              ? document.documentElement.clientWidth
              : document.body.clientWidth;

    fm_shift_y = has_inner
        ? pageYOffset
        : has_element
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (target_y < 0)
        fm_shift_y += has_inner
            ? window.innerHeight
            : has_element
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_menu()
{
    var step_x, step_y;

    compute_shifts();

    step_x = (fm_shift_x + target_x - fm_next_x) * .07;
    if (Math.abs(step_x) < .5)
        step_x = fm_shift_x + target_x - fm_next_x;

    step_y = (fm_shift_y + target_y - fm_next_y) * .07;
    if (Math.abs(step_y) < .5)
        step_y = fm_shift_y + target_y - fm_next_y;

    if (Math.abs(step_x) > 0 ||
        Math.abs(step_y) > 0)
    {
        fm_next_x += step_x;
        fm_next_y += step_y;
        move_menu();
    }

    setTimeout('float_menu()', 20);
};

function float_it()
{
compute_shifts();
if (document.layers)
{
    // Netscape 4 cannot perform init move
    // when the page loads.
    fm_next_x = 0;
    fm_next_y = 0;
}
else
{
    fm_next_x = fm_shift_x + target_x;
    fm_next_y = fm_shift_y + target_y;
    move_menu();
}
float_menu();

}
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
