// Evolving Solutions Javascript Controls

// Page Onload
window.onload = function () {
	sifr_init();
	anchor_init();
	if($("map")) map();
	if($("map2")) map2();
	if($("testimonial_container")) testim_init();
}

// Page Anchor Scrolls
function ScrollTo(elementid){ new Effect.ScrollTo(elementid); }
function finscroll(elementid){ new Effect.Highlight(elementid); }
function anchor_init(){
    var vt = document.getElementsByTagName("var");
    for (i = 0; i < vt.length; i++){
        var links = vt[i].getElementsByTagName("a")[0];
        var anch = links.href.split("#")[1];
        if(anch) links.href="javascript:ScrollTo('"+anch+"');";
    }
}

// Google Iframe Location Map
function map(){  $("map").innerHTML = '<iframe width="580" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.au/maps?f=l&amp;hl=en&amp;geocode=&amp;q=evolving+solutions&amp;near=&amp;sll=-34.956289,138.554485&amp;sspn=0.009655,0.017338&amp;ie=UTF8&amp;om=1&amp;cid=-34972383,138555052,8683293112667240941&amp;s=AARTsJo1MenCrPJ9VZVICrdtnoXBBqGT-Q&amp;ll=-34.93323,138.57193&amp;spn=0.098512,0.199127&amp;z=12&amp;output=embed"></iframe>'; }
function map2(){ $("map2").innerHTML ='<iframe width="580" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.au/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=retailers+computer+services&amp;sll=-25.335448,135.745076&amp;sspn=35.23743,69.169922&amp;ie=UTF8&amp;hq=retailers+computer+services&amp;hnear=&amp;ll=-34.926756,138.57193&amp;spn=0.119342,0.270195&amp;z=12&amp;iwloc=A&amp;cid=8171640073547249170&amp;output=embed"></iframe>'; }

// Testimonials

function display_next_testimonial() {
    if (current_testimonial + 1 >= testimonials.length) {current_testimonial = 0;} else { current_testimonial++; }
    new Effect.Fade('testimonial', {duration:.3});
    window.setTimeout("$('testimonial').innerHTML = testimonials[current_testimonial]; new Effect.Appear('testimonial', {duration:.3});",300);
}
function testim_init(){
    testimonials = new Array();
    testimonials[0] = "Professionally planned implementation and fully integrated with a full audit trail of transactions.<div class=\"attribution\">&mdash; Dean Boyle, Mitchell and Brown</div>";
    testimonials[1] = "The RCS system is not only easy to use it calculates cost price, retail price and stock control. <div class=\"attribution\">&mdash; Peter Schenscher, Radio Rentals Group SA</div>";
    testimonials[2] = "Its simple to operate yet giving maximum<br />results which are both customer, salesperson<br />and management friendly. <div class=\"attribution\">&mdash; Peter Schenscher, Radio Rentals Group SA</div>";
    testimonials[3] = "Enabled us to dramatically improve our processes and procedures. The RCS system enables us to manage every aspect of our business. <div class=\"attribution\">&mdash; Chris Tsoutouras, Spartan Electrical SA</div>";
    testimonials[4] = "We have a full audit trail of transactions and we are able to manage our stores more economically <div class=\"attribution\">&mdash; Vicki Shanahan, Warehouse Sales</div>";
    current_testimonial = Math.round((Math.random()*testimonials.length));
    $('testimonial').innerHTML = testimonials[current_testimonial];
    setInterval('display_next_testimonial();', 8000);
}