function addbookmark()
{ url="http://www.fastfever.com/"
title="FastFever.com - Exotic Cars, Cool, Hot Cars, Race Cars, Rally Cars"
if (document.all) { window.external.AddFavorite(url, title);} else if (window.sidebar) { window.sidebar.addPanel(title, url, "");}
}
function subit() { document.getElementById("submit").disabled = true; }
/////////////////////////////////////////////////////////////////////////////////
function dots(pre, para, maxb) {
	red = 1;
	for (i=1; i<=maxb; i++) { var c = $('#'+pre+i).attr('src');	if (c == '/images/smallnav_on.gif') red = i; }
	
	$('#'+pre+red).attr('src', 'images/smallnav_off.gif');
	red = red + para;
	if ((para == 1) && (red > maxb)) red=maxb;
	if ((para == -1) && (red < 1)) red=1;

	$('#'+pre+red).attr('src', '/images/smallnav_on.gif');	
}
/////////////////////////////////////////////////////////////////////////////////
function videobox() {
	$(function() {
		$(".CarouseThumbframeholder1").jCarouselLite({ btnNext: ".next1", btnPrev: ".previous1", circular: false, visible: 1, easing: "swing",	speed: 500 });
	});
}
//////////////////////////////////////////////////////////////////////////////////
function gallerybox() {
	$(function() {
    	$(".CarouseThumbframeholder2").jCarouselLite({ btnNext: ".next2", btnPrev: ".previous2", circular: false, visible: 1, easing: "swing", speed: 500 });
	});	
}
//////////////////////////////////////////////////////////////////////////////////
function RBbox() {
	$(function() {
    	$(".CarouseThumbframeholder3").jCarouselLite({ btnNext: ".next3", btnPrev: ".previous3", circular: false, visible: 1, easing: "swing", speed: 500 });
	});	
}
//////////////////////////////////////////////////////////////////////////////////
function AddToFav(id, filename) { 	 
	var MyFavNumber = MyFavCount(); 
	if (MyFavNumber >= 20) { alert('Your Favorite List is Full!'); }
	else { 
		new Ajax.Request("/includes/ajax_fav.php?a=add&id="+id+"&filename="+filename, { onComplete: ShowFav });			
		MyFavNumber++;
		
		var d = $('#myplaylistid').css('display');
		if (d) {
			$('#favcounterid2').html(MyFavNumber);
			if (d != 'block') hidenshow('myplaylistid', 'icon1');			
			$("#myplaylistid").animate({ scrollTop: 5000 }, "slow");
			
		} else {
			alert('Added to Favorite Videos');
		}
		
		$('#favcounterid1').html(MyFavNumber);
	}
}		
//////////////////////////////////////////////////////////////////////////////////	
function RemoveFromFav(id, filename) { 
	var MyFavNumber = MyFavCount();
	new Ajax.Request("/includes/ajax_fav.php?a=remove&id="+id+"&filename="+filename, { onComplete: ShowFav });	
	$('#Item_'+id).hide('slow');
		
	if (MyFavNumber > 1) {
		$('#favcounterid1').html(MyFavNumber-1);
		var bigplayer = document.getElementById("bigplayer");
		if (bigplayer) getVideo();
		
	} else {
		$('#favcounterid1').html('0');
		$('#bigplayer').hide('slow');
	}
}
//////////////////////////////////////////////////////////////////////////////////
function ShowFav(req) { 
	var MyFavNumber = MyFavCount(); 
	var favlist = $("#myplaylistid").html();
	
	if (MyFavNumber <= 1) {
		if (favlist) $("#myplaylistid").html(req.responseText);
		
	} else {
		if (favlist) $("#myplaylistid").html(favlist + req.responseText);		

	}
}
//////////////////////////////////////////////////////
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
///////////////////////////////////////////////////////
function createCookie(c_name,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
////////////////////////////////////////////////////////
function MyFavCount() { var FavList = readCookie('MyFav'); if (FavList) return FavList.split("%7C").length; else return 0; }
function CleanMe(id) { $('#'+id).val(""); }