//Popup
var newWindow;
function popupWindow(path,title,width,height)
{
 newWindow = window.open(path + "","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",left=" + (screen.width - width)/2 + ",top=" + (screen.height - height)/2 + "");
}
//end popup
//onclick="popupWindow('path.html','Titlu Fereastra',690,635);"
// JavaScript Document
$(document).ready(function(){	
	
	
	//acordion homepage
	$("#questions a").click(function(){
		var thisClass;
		if ( !$(this).is(".active") ) {
		$("#questions").find(".active").removeClass("active");
		$("#content div:visible").toggle();
		thisClass ="div."+$(this).attr("id");
		$(this).addClass("active");
		$(thisClass).toggle();	  
	  }
	  return false;
    });
	//end accordion

	// Common questions toggling list
	$("#common-questions #content h3").click(function(){
		if ( !$(this).is(".active") ) {
		$(this).parent().children("div:visible").toggle();
		$(this).parent().children(".active").removeClass("active");
		$(this).addClass("active").next().toggle();
		
		var index = $("h3").index(this) +1;
		clicky.log('#QUESTION'+index,$(this).text());
	
		}
	});
	//phone issue on apply now
	var phone="";
	$("input.short").blur(function () {
		$("input#phone").val("");
		phone = $("input#phone_a").val() + $("input#phone_b").val() + $("input#phone_c").val() + $("input#phone").val() + $("input#phone_d").val();
		$("input#phone").val(phone);
	});
	//end phone issue

	//child date issue on pre register
	var birthDate="";
	$("select.chbd").click(function () {
		$("input#chld_date").val("");
		birthDate = $("select.chm").val() +"/"+ $("select.chd").val() +"/"+ $("select.chy").val();
		$("input#chld_date").val(birthDate);
	});
	//end child date
	
	//submit button bug on ie
	$("input[type='submit']").attr("value"," ");
	//end submit
																	  
	// tracking cookie //
	
	$("#applyform").submit( function () {
		//alert($("#first_name").val());
		var tempname = $("#email").val();
		$.cookie('utahupstart',tempname );
		
		return true;
	});
	
	//Popup FLV (700, 580) for (640, 520)
	$('a.popper').click(function() {
		var pophref = $(this).attr('href');
		var poptitle = $(this).attr('title');
		popupWindow(pophref,poptitle,700,580);
		return false;
	});
	//end popup FLV

	//Popup ScreenCast (860, 660) for (800, 600)
	$('a.popper2').click(function() {
		var pophref = $(this).attr('href');
		var poptitle = $(this).attr('title');
		popupWindow(pophref,poptitle,860,680);
		return false;
	});
	//end popup
	
	//Popup ScreenCast (780, 750) for (719, 700)
	$('a.popper3').click(function() {
		var pophref = $(this).attr('href');
		var poptitle = $(this).attr('title');
		popupWindow(pophref,poptitle,780,750);
		return false;
	});
	//end popup

});

	var tempcookie = $.cookie('utahupstart');
	if (tempcookie) {
		var clicky_custom_session = {
			username: tempcookie
			};
	}