// JavaScript Document

img_src = Array(
	"/images/button_contact_hover.png",
	"/images/button_examples_hover.png",
	"/images/button_nsltr_submit_hover.png",
	"/images/button_order_hover.png",
	"/images/button_order_now_hover.png",
	"/images/button_show_more_hover.jpg"
);
 
img_array = new Array();
 
for (counter in img_src) {
	img_array[counter] = new Image();
	img_array[counter].src = img_src[counter];
}

function del_contents(ele, text){
	if (ele.value == text){
			ele.value = "";
		}
	}

function add_contents(ele, text){
	if (ele.value == ""){
		ele.value = text;
	}
}

function featured_snapto(img){
	for(var x = 1; x <= featured_max; x++){
		if(x == img){
			$('#faderimg' + x).fadeIn('def');
			featured_selected = x;
		} else {
			$('#faderimg' + x).fadeOut('def');
		}
	}
}

function featured_next(){
	if (featured_selected >= featured_max){
		featured_snapto(1);
	}else{
		featured_snapto(featured_selected + 1);
	}
}

function featured_prev(){
	if (featured_selected <= 1){
		featured_snapto(featured_max);
	}else{
		featured_snapto(featured_selected - 1);
	}
}

function featured_timer(){
	if (feat_mo == 0){
		featured_next();
	}
}

function featured_preload(){
	var imgpreload = new Array();
	for(var x = 1; x <= featured_max; x++){
		imgpreload[x] = new Image();
		imgpreload[x].src = featured_img[x];
	}
}

function featured_play(){
	featured_interval = setInterval("featured_timer()",3000);
}

function featured_pause(){
	clearInterval(featured_interval);
}

var featured_selected = 1;
var feat_mo = 0;
var featured_interval = 0;
