var rootURL = "http://"+location.host+"/";
var fileURL = "http://upload.eapoo.com:8080/ServAccept";
var ATT_PATH = "http://attach.eapoo.com/";
var thumbPath = "http://upload.eapoo.com/";
var MYEAPOOURL = "http://my.eapoo.com/";
var EAPOOURL = "http://www.eapoo.com/";
var SNSURL = "http://group.eapoo.com/";
var NEWSURL = "http://news.eapoo.com/";
var SPACEURL = "http://www.eapoo.com/space/";
var SHOPURL = "http://shop.eapoo.com/";
var SERVICEURL = "http://service.eapoo.com/";
var playerURL = "http://www.eapoo.com/global/swf/player/"; 
var SEARCHURL = " http://search.eapoo.com/";
var nowbox = "";
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);  

	//加好友
function addFriend(uid){
	$.weeboxs.open(rootURL+'friend/ajaxadd/'+uid,
					   { title       : '加为好友',
						 width       : 400,
		             	 contentType : 'ajax',
						 showCancel  : false,
						 onok        : function(box){
							 				nowbox = box;
											$('#friendForm').submit();
									}
					  });
}

//发信息
function sendMsg(uid){
	$.weeboxs.open(rootURL+'msg/ajaxsend/'+uid,
					   { title       : '发短消息',
						 width       : 400,
		             	 contentType : 'ajax',
						 showCancel  : false,
						 onok        : function(box){
							 				nowbox = box;
											$('#msgForm').submit();
									}
					  });
}

$(".collect").live('click',function(){
	$.ajax({		
		type: "POST",
	    url: rootURL+"fav/",
	    data:'id='+$(this).attr('v')+'&type='+$(this).attr('n'),
		dataType: "json",
	    success: function(str){
				alert(str.msg);
			}
		});									 
});

function oncollect(){
	if(isNaN($('#date').val()))
	{
		alert('工作周期只能填写数字');
		return false;
	}
	if($('#date').val() < 1){
		alert('工作周期不能为0或负数 ');
		return false;	
	}
	if($('#date').val() == ''){
		alert('工作周期不能为空');
		return false;
	}
	if($('#money').val() == ''){
		alert('报价不能为空');
		return false;
	}
	if(isNaN($('#money').val())){
		alert('报价只能填写数字');
		return false;
		}
	
	if($('#collectform #message').val() == ''){
		alert('夺标理由不能为空');
		return false;
	}
}
