function NewCaptcha(divid){
	$(divid+' img').fadeOut(300, function() { $(this).remove(); });
		$(divid).html('<img src="Extras/captcha.jpg?cache='+ new Date().getTime()+'" alt="Loading New Image" title="Type the same letters">');
}

function SelectAll(divid, type){
	if (type == 1){
		$(divid+ ' input:checkbox').attr("checked", true);
	}
	if (type == 0){
		$(divid+ ' input:checkbox').attr("checked", false);
	}
}
$(function(){

	if (Website_Animation == 1){
		$(".Module").css('visibility','visible').hide().fadeIn('slow');
	}

	var RoundDivs = new Array();
	RoundDivs[0] = ".Module";
	RoundDivs[1] = ".Top_Menu a";
	RoundDivs[2] = ".Error";
	RoundDivs[3] = ".Job_Summary";
	RoundDivs[4] = ".Done";
	RoundDivs[5] = ".Container_Menu";
	RoundDivs[6] = ".Rounded";

	for(i=0; i<RoundDivs.length; i++){ 
		$(RoundDivs[i]).corner({
			 tl: { radius: 5 },
			 tr: { radius: 5 },
			 bl: { radius: 5 },
			 br: { radius: 5 }}
		);
	}

	if (Animate_Buttons != 0){
		$(".Job_Summary").hover(
			function(){
				jQuery(".Email_Button", this).fadeTo("slow", 1.0);
				jQuery(".Save_Job", this).fadeTo("slow", 1.0);
			},
			function(){
				jQuery(".Email_Button", this).fadeTo("slow", 0.15);
				jQuery(".Save_Job", this).fadeTo("slow", 0.15);
			}
		);
	}else{
		jQuery(".Email_Button").fadeTo("fast", 1.0);
		jQuery(".Save_Job").fadeTo("fast", 1.0);
	}

	$(".Blue_Border").mouseout(function() {
		$(this).removeClass("Blue_Border_Hover");
	});

	$(".Blue_Border").mouseover(function() {
		$(this).addClass("Blue_Border_Hover");
	});

	$(".Blue_Border").mouseout(function() {
		$(this).removeClass("Blue_Border_Hover");
	});

	$(".Purple_Border").mouseover(function() {
		$(this).addClass("Purple_Border_Hover");
	});

	$(".Purple_Border").mouseout(function() {
		$(this).removeClass("Purple_Border_Hover");
	});


	$(".Right_Contents .Job_Link").each(function() {
		var Content_Id = $(this).attr('id');
		Content = $("#"+Content_Id+"_Content").html();
		
		$(this).qtip({
			content: Content,
			hide: { delay: 1000, fixed: true },
			position: {
				corner: {
					target: 'bottomLeft',
					tooltip: 'rightTop'
				}
			},
			style: { 
				width: 250,
				padding: 0,
				background: '#FFF',
				border: {
					width: 1,
					radius: 4,
					color: '#d938ed'
				},
				tip: 'topRight',
				name: 'dark' // Inherit the rest of the attributes from the preset dark style
			}
		});
	});

	$(".Middle_Contents .Job_Link").each(function() {
		var Content_Id = $(this).attr('id');
		Content = $("#"+Content_Id+"_Content").html();
		
		$(this).qtip({
			content: Content,
			hide: { delay: 1000, fixed: true },
			position: {
				corner: {
					target: 'bottomRight',
					tooltip: 'leftTop'
				}
			},
			style: { 
				width: 250,
				padding: 0,
				background: '#FFF',
				border: {
					width: 1,
					radius: 4,
					color: '#d938ed'
				},
				tip: 'topLeft',
				name: 'dark' // Inherit the rest of the attributes from the preset dark style
			}
		});
	});
	
});

function FocusInput(Default_Value, Input_Id, FocusBlur){
	var Input_Id = document.getElementById(Input_Id);
	if (Input_Id){
		if (FocusBlur == 1){
			if (Input_Id.value == Default_Value){
				Input_Id.value = "";
			}
		}else if (FocusBlur == 0){
			if (Input_Id.value == ""){
				Input_Id.value = Default_Value;
			}
		}
	}
}
