Cufon.replace('h1, h2, #pricing .td, #hp-banner .splash', { fontFamily: 'Kozuka' });
Cufon.replace('#hp-banner h1, #hp-banner .tag, h3', { fontFamily: 'Geometric' });
Cufon.replace('.dashboard_content .module h3, #section-tour h3, #upgrade-page h3', { fontFamily: 'Kozuka' });
Cufon.replace('#primary-menu a, #section-tour h2, #signup h3', { fontFamily: 'Geometric', hover: true });

$(document).ready(function(){

	if($('#faq').length) {
    	$("#faq .answer").hide();
		$("#faq h2").click(function(){
			$(this).next().slideToggle('fast');
		});
	}
	
	if($('a[rel="screens"]').length) {
		$('a[rel="screens"]').colorbox();
	}
	
	if($(".view-terms").length) {
		$(".view-terms").colorbox({width:"80%", height:"80%", iframe:true});

	}
	
	if($(".new-client").length) {
		$(".new-client").colorbox({width:"660px", height:"600px", iframe:true});

	}
	if($(".new-client-smaller").length) {
		$(".new-client-smaller").colorbox({width:"660px", height:"360px", iframe:true});

	}
	if($(".tour_image").length) {
		$("a[rel='tour1']").colorbox();
		$("a[rel='tour2']").colorbox();

	}
	
	if($('img.bt').length) {
		$('img.bt').bt({
		  trigger: 'click',
		  contentSelector: "$(this).attr('title')",
		  fill: '#6db9e1',
		  width:'300px',
		  strokeWidth: 2,
		  strokeStyle: "#999",
		  shrinkToFit: true,
		  spikeGirth: 15,
		  spikeLength: 5,
		  padding: 8,
		  cornerRadius: 5,
		  cssStyles: {color:'#fff'},
		  positions: ['top', 'right', 'bottom']
		});
	}
	
	try {
		$("#tabs").tabs();
	} catch(err) {}
	
});
	
	
function closeSlideout() { 
	$('#slideout').hide();  
}	
			
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 getPassword(thisTable,thisId){ 
	  var retVal = "" 
	  retVal = prompt("A password is required to view this video.", ""); 
	  thisURL="/video.cfm";
	  $.post(thisURL, { variable: thisTable, variable2: thisId, variable3: retVal }, function(data){
	    newAnswer=data.replace(/^\s*/, "").replace(/\s*$/, "");
		if (newAnswer == "No") {
	 	 	alert("Incorrect Password!");
		  	window.location.reload();
		  	return false;
		  }
		  else {
		  	return true;
		  } 
	  });
}

function popUp1(message) {



var x = 20;

var y = 20;



	var windowparam = "width=" + 500 + ",height=" + 700 + ",scrollbars=yes,menubar=no,left="+x+",top="+y+",screenX="+x+",screenY="+y;

	popwin = window.open(message, "popwin", windowparam)

	popwin.opener = self;

	popwin.focus()

}

function confirmSubmit(message)
{
var agree=confirm(message);
if (agree)
	return true ;
else
	return false ;
}
