var xmlHttp

$(document).ready(function () {

	$('#testimonial-group').cycle({ //setting the fade on the testimonial box
	    fx: 'fade',
	    speed: 2500,
	    timeout: 8500,
	    sync: 0,
	    speedOut: 1500,
	    speedIn: 1000
	});
	
	/* $(".client-list").hover(function() {
	  $(".prev").animate({opacity: "show"}, "slow");
	}, function() {
	  $(".prev").animate({opacity: "hide"}, "fast");
	});
	
	$(".client-list").hover(function() {
	  $(".next").animate({opacity: "show"}, "slow");
	}, function() {
	  $(".next").animate({opacity: "hide"}, "fast");
	});
	*/
   $(function() {
   	$(".client-list").jCarouselLite({
       	btnNext: ".next",
       	btnPrev: ".prev",
       	visible: 3,
       	scroll: 3,
       	speed: 1200
   	});
	});

});


function playVideo(id) { 
	$("#dyn-video-info").html('');
	$(".teaser").removeClass("active");
	$("#video"+id).addClass("active");
	
	query = "id="+id;
	$.get("/dyn-video.cfm",query, function(data){
		title_array=data.split("~");
		document.title=title_array[0];
		$("#dyn-video-info").html(title_array[1]);
	});
}

function popUp2(message) {

var x = 20;
var y = 20;

	var windowparam = "width=" + 970 + ",height=" + 230 + ",scrollbars=yes,menubar=no,left="+x+",top="+y+",screenX="+x+",screenY="+y;
	popwin = window.open(message, "popwin", windowparam)
	popwin.opener = self;
	popwin.focus()
}

function GetXmlHttpObject() { 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


function validate_email(field,alerttxt) {
	with (field) { 
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {alert(alerttxt);return false;}
		else { return true; }
	}
}
function validate_form(thisform,fieldtovalidate)
{
	with (thisform)
	{
	if (validate_email(fieldtovalidate,"Not a valid e-mail address!")==false)
	  { return false;}
	}
}
function clearout(x) { 
	//alert(x);
	document.getElementById(x).style.background="white";
}


mainNav = function() {
	$("#topnav li").bind("mouseenter",function(){
                this.className += " over";
				
	}).bind("mouseleave",function(){
                this.className = this.className.replace(" over", "");
	});
}

newsNav = function() {
	$(".dropdown").bind("mouseenter",function(){
                this.className += " over";
	}).bind("mouseleave",function(){
                this.className = this.className.replace(" over", "");
	});
}
function addPayPalData(box,item_name,item_number,amount,paypal_id) { 
	var boxid='#item_' + box;
	boxdata='<input type="submit" value="add to cart" class="submitbutton" /><input type="hidden" name="cmd" value="_cart"><input type="hidden" name="business" value="'+paypal_id+'"><input type="hidden" name="lc" value="US"><input type="hidden" name="currency_code" value="USD"><input type="hidden" name="button_subtype" value="products"><input type="hidden" name="cn" value="Add special instructions to the seller"><input type="hidden" name="no_shipping" value="2"><input type="hidden" name="rm" value="1"><input type="hidden" name="return" value=""><input type="hidden" name="add" value="1"><input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted"><input type="hidden" name="notify_url" value="http://bcolasuonno.kaboonie.com/pages/paypal_ipn"><input type="hidden" name="item_name" value="'+item_name+'"><input type="hidden" name="item_number" value="'+item_number+'"><input type="hidden" name="amount" value="'+amount+'"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">';
	$(boxid).html(boxdata);
}


