
 //Function to set the border of div depending upon height of content.
function setBorder()
{  
           
      if((document.getElementById("divContentBodyOuterRight").offsetHeight)>(document.getElementById("divContentBodyOuterLeft").offsetHeight))
      {        
         document.getElementById("divContentBodyOuterRight").className="borderLeft";
          document.getElementById("divContentBodyOuterLeft").className="";
      }
    
}


//Function to show and hide div on click of need a quote checkbox on the call back form
function showQuote()
{
     if((document.getElementById("chkQuote")).checked==true)
      {   
         //show the amount required and currency fields.     
         (document.getElementById("divQuote")).className="divQuoteNone";    
         //adjust the outer div height
         (document.getElementById("divCallBackForm")).className="divCallBackForm336 borderGrey5px";      
      }
      else
      {           
          //hide the amount required and currency fields.    
         (document.getElementById("divQuote")).className="divQuote"; 
         //adjust the outer div height    
         (document.getElementById("divCallBackForm")).className="divCallBackForm borderGrey5px";      
      } 

}

//********************To populate testimonial starts here**********************************************//
 
function populateTestimonial()
{
    var sec=9; 
    //Function to give the Fading effects
    shiftOpacity("divTestimonial",3000);
    //Array declaration for populating testimonial
    var testArray = new Array();
    testArray[0] = '"My Smart Trader has found just the right balance between being helpful and great customer service."<br/><b>SP</b>';
    testArray[1] = '"Smart certainly makes the financial aspects of buying currency for international payments easy."<br/><b>SP</b>';
    testArray[2] = '"My company has been very impressed with the services provided and will certainly use Smart again."<br/><b>LMM</b>';
    testArray[3] = '"Cost effective, friendly and efficient."<br/><b>PH</b>';
    testArray[4] = '"A very good service with helpful, friendly staff."<br/><b>LMM</b>';
    testArray[5] = '"A very efficient and cost effective method for making foreign payments."<br/><b>ANON</b>';
    testArray[6] = '"Did not know I should discuss rates. Have found the service excellent for our need."<br/><b>NA</b>';
    testArray[7] = '"Good personal service and responsive to enquiries."<br/><b>MWG</b>';
    testArray[8] = '"Good, helpful and efficient."<br/><b>HR</b>';
    testArray[9] = '"My Smart Trader has found just the right balance between being helpful and great customer service."<br/><b>TL</b>';
    testArray[10] = '"I have found you an excellent and trustworthy company to deal with."<br/><b>JR</b>';
    testArray[11] = '"Your company made the transfer of funds back to the UK very simple and worthwhile process."<br/><b>PR</b>';
    testArray[12] = '"I was really pleased with the first class service I received with my recent currency transfer with Smart."<br/><b>DP</b>';
    testArray[13] = '"Very good personal service.Given excellent service even when relatively small transactions."<br/><b>TK</b>';
    testArray[14] = '"Smart Currency eased my fears and talked me through the whole experience."<br/><b>JL</b>';
    testArray[15] = '"I was attracted to Smart Currency because of your competitive rates."<br/><b>MH</b>';
    testArray[16] = '"I was certainly made to feel like their only one! An excellent, professional and personal service."<br/><b>NA</b>';
    testArray[17] = '"Your service has been excellent and we will certainly make our future international payments."<br/><b>KB</b>';    
    var which = Math.round(Math.random()*(testArray.length - 1));
    //alert(which);
   	document.getElementById("lblTestimonial").innerHTML= testArray[which];
	
	setTimeout('populateTestimonial('+sec+')', sec*1000);   
}

//Function to fade in and fade out an element
function shiftOpacity(id, millisec)
{ 
    //alert(document.getElementById(id).style.opacity)
    //if an element is invisible, make it visible, else make it ivisible 
//    if(document.getElementById(id).style.opacity == 0) 
//    { 
//        opacity(id, 100, 0, millisec); 
//    }
//     else
    { 
        opacity(id, 0, 100, millisec); 
    } 
}
//Function to fade out an element
function opacity(id, opacStart, opacEnd, millisec)
 { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd)
    { 
        for(i = opacStart; i >= opacEnd; i--)
        { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    }
    else if(opacStart < opacEnd) 
    { 
        for(i = opacStart; i <= opacEnd; i++) 
        { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) 
{ 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

//********************To populate testimonial ends here**********************************************//


//Function to show and hide div on click of need a quote checkbox on the call back form
function showQuoteGen(id)
{
  
     if((document.getElementById(id)).checked==true)
      {   
         //show the amount required and currency fields.     
         (document.getElementById("divQuote")).className="divQuoteNone";    
         //adjust the outer div height
         (document.getElementById("divCallBackForm")).className="divCallBackForm336";      
      }
      else
      {           
          //hide the amount required and currency fields.    
         (document.getElementById("divQuote")).className="divQuote"; 
         //adjust the outer div height    
         (document.getElementById("divCallBackForm")).className="divCallBackForm";      
      } 

}


//************************************************ Google Tracking Code *********************************************//
function updateRef(obj,hdncount) 
{ 
  //alert('Hi');
  if(getQueryVariable("src"))
  { 
     var ref = getQueryVariable("src"); 
  }
  else
     ref = null  
     
  if(getQueryVariable("trk"))
  { 
     var reftrack = getQueryVariable("trk"); 
  }
  else
     reftrack = null
   
  if (ref != null) 
  { 
    if (document.getElementById(hdncount).value == 0) 
    { 
     document.getElementById(obj).src = document.getElementById(obj).src + '&src=' + ref + '&trk=' + reftrack; 
     document.getElementById(hdncount).value = 1;
     }
  }
}

function getQueryVariable(variable) 
{ 
     var query = window.location.search.substring(1); 
     var vars = query.split("&"); for (var i=0;i<vars.length;i++) 
     { 
       var pair = vars[i].split("="); 
        if (pair[0] == variable) 
        { 
          return pair[1];
        }     
      }
}
//********************To populate testimonial ends here**********************************************//

/******************To Hide and Show Home page Videos**************************/
function firstVideo()
{
    document.getElementById("homeVideoFirst").style.display = 'inline';
    document.getElementById("homeVideoSecond").style.display = 'none';
    document.getElementById("arrowMakingPayments").style.display = 'none';
    document.getElementById("arrowBuyingOverseas").style.display = 'inline';
}

function SecondVideo()
{
    document.getElementById("homeVideoFirst").style.display = 'none';
    document.getElementById("homeVideoSecond").style.display = 'inline';
    document.getElementById("arrowBuyingOverseas").style.display = 'none';
    document.getElementById("arrowMakingPayments").style.display = 'inline';
}
