$(function () {
	$(".head_li_library").click(function(){
		window.location.href="../lanhu/index.html"
	})
	$(".head_li_Moments").click(function(){
		window.location.href="../moments/index.html"
	})
       $(".navbar .dropdown").mouseover(function () {
           $(this).addClass("open");
       });
       $(".navbar .dropdown").mouseleave(function(){
           $(this).removeClass("open");
       })
	   $(".headSignout").click(function(){
		   window.localStorage.removeItem("loginUser");
		   window.localStorage.removeItem("loginCompany");
			$(".loginUserNo").show()
			 $(".loginUser").hide()
	   })
	  var loginUser= window.localStorage.getItem("loginUser");
	  if(loginUser){
		  $(".loginUserNo").hide()
		   $(".loginUser").show()
		   $(".userName").text(loginUser)
		   var loginCompany= window.localStorage.getItem("loginCompany");
		     if(loginCompany){
				 $(".head_add").attr("href","../company/postproject.html")
			 }else{
				  $(".head_add").attr("href","../company/register.html")
			 }
		   
	  }
    })
	
function jpalert(text,url,type){
	var success = $(".head_success").val();
	
	if(type==null){
		type="success"
	}
	if(type=="alert"){
		success= $(".head_warning").val();
	}
	zeroModal[type]({
		unique: '1',
		opacity: 0.8,
		content: success,
		contentDetail: text,
		width: '300px',
		height: '280px',
		ok:false,
		cancel:true,
		onClosed: function() {
			; //location.href='../signin/signin.html'
		},
		onComplete: function(evn) {
			
			console.log('onComplete')
			setTimeout(function(){
				if(url){
						window.location.href=url
				}
				zeroModal.close('1');
			},3000);
		}
	})
}

