function formatText(index, panel) {
return index + "";
}
function labelsInInputs() {
//place labels inside inputs
$('form#enquiryform input, form#enquiryform textarea').each(function(i){
var input_id = $(this).attr('id');
var the_value = $(this).attr('value');
var the_label = 'label[for='+input_id+']';
var the_label_text = $(the_label).text();
$(the_label).css({'color' : '#AAA', 'display' : 'block', 'font-size': '1.2em', 'left' : '13px', 'position' : 'absolute', 'top' : '-5px'});
if($.browser.msie){ /* Thank you, monkey boy */
$(the_label).css({'top' : '7px'});
}
if(the_value != '') {
//$(this).attr({ value : the_label_text });
$(the_label).css({'display' : 'none'});
}
}).focus(function(){
var input_id = $(this).attr('id');
var the_label = 'label[for='+input_id+']';
var the_label_text = $(the_label).text();
if ($(this).val() == '') {
$(the_label).css({'color' : '#DEDEDE'});
}
}).keyup(function(){
var input_id = $(this).attr('id');
var the_label = 'label[for='+input_id+']';
var the_label_text = $(the_label).text();
if ($(this).val() != '') {
$(the_label).css({'display' : 'none'});
}
}).blur(function(){
var input_id = $(this).attr('id');
var the_label = 'label[for='+input_id+']';
var the_label_text = $(the_label).text();
if ($(this).val() == '') {
$(the_label).css({'color' : '#AAA', 'display' : 'block'});
}
});
$('form#enquiryform span#span-message label').css({'top' : '-120px'});
if($.browser.msie){ /* Thank you, monkey boy */
$('form#enquiryform span#span-message label').css({'top' : '5px'});
}
}
$(document).ready(function(){
$('#ticker').innerfade({
animationtype: 'fade',
speed: 1000,
timeout: 5000,
/* type: 'random', */
containerheight: '17px'
});
$('#rightcontent-home a img').each(function(i) {
the_link = $(this).parent('a');
$(the_link).css({'border':'none', 'padding':0});
});
$('#rightcontent-inside a img').each(function(i) {
the_link = $(this).parent('a');
$(the_link).css({'border':'none', 'padding':0});
});
$('.anythingSlider').anythingSlider({
easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin
autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not.
delay: 3000, // How long between slide transitions in AutoPlay mode
startStopped: false, // If autoPlay is on, this can force it to start stopped
animationTime: 600, // How long the slide transition takes
hashTags: true, // Should links change the hashtag in the URL?
buildNavigation: true, // If true, builds and list of anchor links to link to each slide
pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover
startText: "Go", // Start text
stopText: "Stop", // Stop text
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
});
$("#slide-jump").click(function(){
$('.anythingSlider').anythingSlider(6);
});
$('ul.main-menu a, body#faq ul#the-questions a').click(function () {
var the_target = $(this).attr('href');
var anchors = the_target.split('#');
var the_anchor = '';
if(anchors != the_target) {
the_anchor = anchors[1];
}
if( (the_anchor != '') ) {
$('html, body').animate({
scrollTop: $('#' + the_anchor).offset().top
}, 1000);
return false;
}
});
$('a img.back-top-top').click(function () {
$('html, body').animate({
scrollTop: $('div#container').offset().top
}, 500);
return false;
});
labelsInInputs();
$('#attachment').before('
').change(function() {
var theFile = $(this).val();
$('#faux-attachment').text(theFile);
});
});