

var productName;
var which_page = "";
function uploadFileSucceed(productId){
	productName = encodeURIComponent(productName);
	productName = encodeURIComponent(productName);
	if(trim(productId).length == 1){
		alert("您上传的太快，请休息一会....");
		return;
	}
	if(which_page == "iphone"){
		iphone_upload(productId);
	}else{
		finish_upload(productId);
	}
	
		
}

//完成上传
function finish_upload(productId){
	var url = "";
	
		if(typeof(domainShop)!='undefined' && domainShop==4){
			url = "http://www.docin.com";
		}
		url += "/app/uploadFile/index?productId="+productId + "&productName=" + productName;
		if(typeof(domainShop)!='undefined' && domainShop==4){
			url += "&shopId="+domainShop;
		}
	
	window.location = url;
}

function startUpload(pName){
	productName = pName;
}

//iphone完成上传
function iphone_upload(productId){
	var userIp = document.getElementById("uip").value;
	var url = "/jsp_cn/iphone/uploadfinish.jsp?pid=" + productId + "&pn=" + productName + "&uip=" + userIp + "&date="+new Date().getTime();
	jQuery("#result").load(url);
}
