/* www.kalandro.de */
$(document).ready( function() {
	$(document).pngFix(); 
	$("input.text,textarea.text").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});
	
	$("#show_solutions_nav").hover(function(){
		$("#solutions_sub").removeClass("hidden");
	},function(){
		$("#solutions_sub").addClass("hidden");
	});
	
	$("input.text,textarea.text").focus(function(){
		$(this).addClass("focus");
		$(this).parent().parent().find(".info").fadeIn("fast");
	});
	$("input.text,textarea.text").blur(function(){
		$(this).removeClass("focus");
		$(this).parent().parent().find(".info").fadeOut("slow");
	});
	$(".plus").click(function(){
		$(this).parent().find("input").val(parseInt($(this).parent().find("input").val())+1);
		$(this).parent().find("input").addClass("focus");
		if($(this).parent().find("input").val()=="NaN"){
			$(this).parent().find("input").val("0")
		}
	});
	$(".minus").click(function(){
		if(parseInt($(this).parent().find("input").val())>0){
			$(this).parent().find("input").val(parseInt($(this).parent().find("input").val())-1);
			$(this).parent().find("input").addClass("focus");
		}
		if($(this).parent().find("input").val()=="NaN"){
			$(this).parent().find("input").val("0")
		}
	});
	$(".minus, .plus").mouseout(function(){
		$(this).parent().find("input").removeClass("focus");
	});
	
	$("#ncpinfos,.info").hide();
	$(".info").fadeOut();
		
	$("#ncpklapplink").click(function(){
		$("#ncpinfos").show("slow");
	});
	$("#ncpklapplink:visible").click(function(){
		$("#ncpinfos").hide();
	});
	
	$("#flash img").mouseover(function(){
		$(".refInfo").fadeOut("fast");
		$("."+$(this).attr("name")).css("left", ($(this).offset().left)-10);
		$("."+$(this).attr("name")).css("top", ($(this).offset().top)-36);
		$("."+$(this).attr("name")).fadeIn("fast");
	});
	$("#text").mouseover(function(){
		$(".refInfo").fadeOut("fast");
	});
	$("#showdetail").click(function(){
		$("#webhosting table .detail").fadeIn("fast");
		$("#showdetail").slideUp("slow");
		return false;
	});
	$("#webhosting tbody tr").hover(function(){
		$(this).not(".hover").addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});
	if($("#paymentBank").attr("checked")==false){
		$("#bankeinzug").fadeOut("fast");
	}
	$(".paymentBank").click(function(){
		if($("#paymentBank").attr("checked")==false){
			$("#bankeinzug").hide();
		}else{
			$("#bankeinzug").show("fast");
		}
	});
	if($("#HostingOrderTransfer").attr("checked")==false){
		$("#authinfo").hide();
	}
	$("#HostingOrderTransfer").click(function(){
		if($("#HostingOrderTransfer").attr("checked")==false){
			$("#authinfo").hide();
		}else{
			$("#authinfo").show("fast");
		}
	});
});

function isNumeric(strString){
	var strValidChars = "0123456789.-";
	var strChar;
	var blnResult = true;
	if (strString.length == 0) return false;
		for (i = 0; i < strString.length && blnResult == true; i++){
			strChar = strString.charAt(i);
			if (strValidChars.indexOf(strChar) == -1){
				blnResult = false;
			}
		}
	return blnResult;
}
