
String.prototype.endsWith = function (str) {
	return (this.match(str + "$") == str);
};

function uploadArtworkFileFormat(file) {
	var acceptableImageFormat = new Array("JPEG", "jpeg", "JPG", "jpg", "GIF", "gif", "PNG", "png", "flv", "FLV", "wmv", "mpg", "mov", "avi", "3gp", "mp4", "WMV", "MPG", "MOV", "AVI", "3GP", "MP4");
	var fileName = file;//document.getElementById(id).value;
	var isImageExtensionAccepted = false;
	if (fileName.length != null) {
		for (var pos = 0; pos < acceptableImageFormat.length; pos++) {
			if (fileName.endsWith(acceptableImageFormat[pos])) {
				isImageExtensionAccepted = true;
				break;
			}
		}
		if (!isImageExtensionAccepted) {
			return false;
		} else {
			return true;
		}
	}
}

function conservatorPair()
{	
	//alert("submit");
	var length1=document.getElementsByName('checkBox').length;
	var flag=0;
	for (var i=0;i<length1;i++)
	{
		if(document.getElementsByName('checkBox')[i].checked==true)
			flag=1;
	}
	
	if(flag==1)	
	{
		
		document.conservatorApplypair.submit();
	}
	else
	{	
		var serror = document.getElementById("selectError");
		serror.innerHTML="<font color=red> Please Select minimum one pair....</font>";
		serror.style.display="inline";
		return false;
	}	
}

function artistPair()
{	
	var length1=document.getElementsByName('checkBox').length;
	var flag=0;
	for (var i=0;i<length1;i++)
	{
		if(document.getElementsByName('checkBox')[i].checked==true)
			flag=1;
	}
	
	if(flag==1)	
	{
		
		document.myCollection.submit();
	}
	else
	{	
		var serror = document.getElementById("selectError");
		serror.innerHTML="<font color=red> Please Select minimum one image....</font>";
		serror.style.display="inline";
		return false;
	}	
}

function editProposalPair()
{	
	//alert("submit");
	var length1=document.getElementsByName('checkBox').length;
	var flag=0;
	for (var i=0;i<length1;i++)
	{
		if(document.getElementsByName('checkBox')[i].checked==true)
			flag=1;
	}
	
	if(flag==1)	
	{
		
		document.conservatorproposalform.submit();
	}
	else
	{	
		var serror = document.getElementById("selectError");
		serror.innerHTML="<font color=red> Please Select Image....</font>";
		serror.style.display="inline";
		return false;
	}	
}


function isImageFormat(file) {
	var acceptableImageFormat = new Array("JPEG", "jpeg", "JPG", "jpg", "GIF", "gif", "PNG", "png");
	var fileName = file;//document.getElementById(id).value;
	var isImageExtensionAccepted = false;
	if (fileName.length != null) {
		for (var pos = 0; pos < acceptableImageFormat.length; pos++) {
			if (fileName.endsWith(acceptableImageFormat[pos])) {
				isImageExtensionAccepted = true;
				break;
			}
		}
		if (!isImageExtensionAccepted) {
			return false;
		} else {
			return true;
		}
	}
}

function file1(file,id) {
var error="";
	if ( file.value.length > 0 ) {
		if ( endsWith(file.value,"doc") || endsWith(file.value,"docx") || endsWith(file.value,"pdf") || endsWith(file.value,"txt") || endsWith(file.value,"rtf") ) {
			
		} else {
			error += "Invalid File Format\n";
			file.value = "";	
			if ( navigator.appName == "Microsoft Internet Explorer" ) {		
				var myval = document.getElementById(id).innerHTML;
				document.getElementById(id).innerHTML = myval;
			}
		}
	} else {
		error += "Please, Select file to upload \n";
	}
	if ( error.length > 0 ) {
		alert(error);
	}
	return false;
}

	function filename2(file,id) {
	var error="";
		if ( file.value.length > 0 ) {
			if ( endsWith(file.value,"doc") || endsWith(file.value,"docx") || endsWith(file.value,"pdf") || endsWith(file.value,"txt") || endsWith(file.value,"rtf") ) {
				
			} else {
				error += "Invalid File Format\n";
				file.value = "";	
				if ( navigator.appName == "Microsoft Internet Explorer" ) {		
					var myval = document.getElementById(id).innerHTML;
					document.getElementById(id).innerHTML = myval;
				}
			}
		} else {
			error += "Please, Select file to upload \n";
		}
		if ( error.length > 0 ) {
			alert(error);
		}
		return false;
}




function documentFile(file, id) {
	var error = ""

	if ( file.value.length > 0 ) {
		if ( endsWith(file.value,"jpeg") || endsWith(file.value,"jpg") || endsWith(file.value,"flv") || endsWith(file.value,"gif") || endsWith(file.value,"mpeg")|| endsWith(file.value,"avi")|| endsWith(file.value,"mov")|| endsWith(file.value,"MPEG")|| endsWith(file.value,"wmv")|| endsWith(file.value,"3GP")|| endsWith(file.value,"mpg") ) {
			//alert("Fine");
		} else {
			error += "Invalid File Format\n";
			file.value = "";	
			if ( navigator.appName == "Microsoft Internet Explorer" ) {		
				var myval = this.document.getElementById(id).innerHTML;
				this.document.getElementById(id).innerHTML = myval;
			}
		}
	} else {
		error += "Please, Select file to upload \n";
	}
	if ( error.length > 0 ) {
		alert(error);
	}
	return false;
}


function endsWith(src, str) {
	return (src.match(str+"$")==str)
}




function fnReadFileName(file)
{
	var fileName="";
	if (file.value != "" || file.value.length > 0) {
		var status = isDocumentFormat(file.value);
		if (!status) {
			alert("Mismatch File Format");
			file.value="";
			if ( navigator.appName == "Microsoft Internet Explorer" ) {		
				var myval = this.document.getElementById(id).innerHTML;
				this.document.getElementById(id).innerHTML = myval;
				return false;
			}
			
		} else {
			return true;
		}
	}
	return false;
	}	

function artUploadAfterValidation() {
	var fileName = document.getElementById("uploadFileName1").value;
	
	if (fileName != "" || fileName.length > 0) {
		var status = uploadArtworkFileFormat(fileName);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("uploadFileName1").value = "";
			return false;
		} else {
			//return true;
		}
	} else {
		alert("Please upload after Image");
		return false;
	}
}
function artUploadBeforeValidation() {
	var fileName1 = document.getElementById("uploadFileName").value;
	if (fileName1 != "" || fileName1.length > 0) {
		var status = uploadArtworkFileFormat(fileName1);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("uploadFileName").value = "";
			return false;
		} else {
			//return true;
		}
	} else {
		alert("Please upload Before Image");
		return false;
	}
}
function artUploadValidationArtist() {
	var fileName = document.getElementById("uploadFileName").value;
	if (fileName != "" || fileName.length > 0) {
		var status = uploadArtworkFileFormat(fileName);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("uploadFileName").value = "";
			return false;
		} else {
			return true;
		}
	} else {
		alert("Please upload your artwork");
		return false;
	}
}
function artUploadValidation() {
	
	var error = 0;
	var fileName = document.getElementById("uploadFileName").value;
	if (fileName != "" || fileName.length > 0) {
		var status = uploadArtworkFileFormat(fileName);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("uploadFileName").value = "";
			return false;
		} else {
			//return true;
			error = "";
		}
	} else {
		alert("Please upload Before Image");
		return false;
	}
	var fileName1 = document.getElementById("uploadFileName1").value;
	if (fileName1 != "" || fileName1.length > 0) {
		var status = uploadArtworkFileFormat(fileName1);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("uploadFileName1").value = "";
			return false;
		} else {
			//return true;
		}
	} else {
		alert("Please upload After Image");
		return false;
	}
	return true;
}

/* Document Format */
function isDocumentFormat(id) {
	var acceptableDocumentFormat = new Array("doc", "DOC", "DOCX", "docx", "rtf", "RTF", "txt", "TXT", "pdf", "PDF");
	var fileName = document.getElementById(id).value;
	var isDocumentExtensionAccepted = false;
	if (fileName.length != null) {
		for (var pos = 0; pos < acceptableDocumentFormat.length; pos++) {
			if (fileName.endsWith(acceptableDocumentFormat[pos])) {
				isDocumentExtensionAccepted = true;
				break;
			}
		}
		if (!isDocumentExtensionAccepted) {
			alert("Unacceptable Format");
			document.getElementById(id).value = "";
		}
	}
}
function removeMyArtwork(id, status) {	
	//alert(id);
	var theForm = this.document.myartwork;
	if (status == "YES") {
		theForm.action = "artUpload.jspx?req=delete&id=" + id;
		theForm.submit();
	} else {
		alert("sorry u can't delete this artwork");
	}
}
function largeImageView(id) {
	var url = "largeImage.jsp?id=" + id;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}
function beforelargeImageView(recordid,id) {
	var url = "beforeLargeView.jsp?id=" + id+"&record="+recordid;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}
function afterlargeImageView(recordid,id) {
	var url = "afterLargeView.jsp?id=" + id+"&record="+recordid;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}
function viewResponse(recordid,id) {
	var url = "csviewresponse.jsp?id=" + id+"&record="+recordid;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}
function beforesponser(recordid,id) {
	var url = "csbeforeandafter.jsp?id=" + id+"&record="+recordid;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}

function csbefore(recordid,id) {
var url = "csbeforeandafter.jsp?id=" + id+"&record="+recordid;
var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
windowstatus.focus();
}
function csafter(recordid,id) {
var url = "caafterview.jsp?id=" + id+"&record="+recordid;
var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
windowstatus.focus();
}

function artistvr(recordid,id){

var url="artistviewresponse.jsp?id="+id+"&record="+recordid;
var windowstatus=window.open(url,"mywindow","menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
windowstatus.focus();
}



/* end document */
/* artist menu */
function viewArtistProfile(id) {
	var url = "ArtistProfile.jsp?id=" + id;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=810,height=414");
	windowstatus.focus();
}
function artworkView(id) {
	var url = "ArtWorkPopUp.jsp?id=" + id;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=714");
	windowstatus.focus();
}

function artistConservatorArtWork(id) {
	var url = "ConservatorArtWorkPopUp.jsp?id=" + id;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=714");
	windowstatus.focus();
}

function applytoRfpRfqFileClear() {
	var fileDivId = new Array("file1", "file2", "file3", "file4", "file5", "file6", "file7", "file8", "file9", "file10", "file11", "file12", "file13", "file14", "file15", "file16", "file17", "file18", "file19", "file20");
	for (var inc = 0; inc < fileDivId.length; inc++) {
		document.getElementById(fileDivId[inc]).value="";
	}
}
function applyToProject() {	   
	var divId = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
	var fileDivId = new Array("file1", "file2", "file3", "file4", "file5", "file6", "file7", "file8", "file9", "file10", "file11", "file12", "file13", "file14", "file15", "file16", "file17", "file18", "file19", "file20");
	var errorId = new Array("errorFile1", "errorFile2", "errorFile3", "errorFile4", "errorFile5", "errorFile6", "errorFile7", "errorFile8", "errorFile9", "errorFile10", "errorFile11", "errorFile12", "errorFile13", "errorFile14", "errorFile15", "errorFile16", "errorFile17", "errorFile18", "errorFile19", "errorFile20");
	//errorFile	
	var err=0;
	var isFileUploaded = 0;
	for (var inc = 0; inc < divId.length; inc++) {
		var fileDivStatus = document.getElementById(divId[inc]).style.display;
		if (fileDivStatus == "inline") {
			var fileName = "";
			fileName = document.getElementById(fileDivId[inc]).value;
			if (fileName != "" & fileName.length > 0) {
				var fileExtensionStatus = uploadArtworkFileFormat(fileName);
				if (!fileExtensionStatus) {
					document.getElementById(errorId[inc]).style.display = "inline";
					document.getElementById(fileDivId[inc]).value = "";
					return false;
				} else {
					document.getElementById(errorId[inc]).style.display = "none";
				}
				isFileUploaded++;
			}
		}
	}
	var resumeFile = document.getElementById("artistResume").value;	
	if(resumeFile=="" || resumeFile.length==0){
		err++;		
		document.getElementById('resumeError').style.display="inline"
		document.getElementById('resumeFormatError').style.display="none"	
	}
	else{
	//if (resumeFile != "" || resumeFile.length > 0) {
		var status = documentFileFormat(resumeFile);
		//alert(status);
		if (!status) {
			//alert("Resume Mismatch File Format"); //resumeError
			//document.getElementById("resumeError").style.display = "inline";
			err++;						
			document.getElementById('resumeFormatError').style.display="inline"	
			document.getElementById('resumeError').style.display="none"	
			document.getElementById("artistResume").value = "";	
			//return false;
		//} else {
			//document.getElementById("resumeError").style.display = "none";
		}
	}
	if (isFileUploaded == 0) {
		alert("Please upload your artwork");
		return false;
	}
	if(err>0){		
		return false;
	}
	return true;
}
function applyToProjectArtWorkValidaion(id) {
	var fileName = document.getElementById(id).value;		
	//alert(fileName);
	if (fileName != "" || fileName.length > 0) {
		var status = uploadArtworkFileFormat(fileName);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById(id).value = "";
			return false;
		} else {
			return true;
		}
	}
}
function applyToProjectResumenValidation(id) {
	var fileName = document.getElementById(id).value;		
	//alert(fileName);	
	if (fileName != "" || fileName.length > 0) {
		var status = documentFileFormat(fileName);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById(id).value = "";
			return false;
		} else {
			return true;
		}
	}
}
function myproposalsLargeImageView(id) {
	var url = "MyProposalsImageView.jsp?id=" + id;
	var windowstatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowstatus.focus();
}

function fnUserRegFailed() {
	var msg = "Please login before you can access the site.\nIf you are not registered yet, Please Click Here to Register!";
	alert(msg);
}
function fnTakeATour() {
	var url = "index.html";
	var windowStatus = window.open(url, "mywindow", "menubar=0,scrollbars=1,resizable=1,width=1050,height=914");
	windowStatus.focus();
}

function documentFileFormat(file) {
	var acceptableImageFormat = new Array("docx", "doc", "txt", "pdf", "rtf", "DOC", "DOCX", "TXT", "PDF", "RTF");
	var fileName = file;//document.getElementById(id).value;
	var isImageExtensionAccepted = false;
	if (fileName.length != null) {
		for (var pos = 0; pos < acceptableImageFormat.length; pos++) {
			if (fileName.endsWith(acceptableImageFormat[pos])) {
				isImageExtensionAccepted = true;
				break;
			}
		}
		if (!isImageExtensionAccepted) {
			return false;
		} else {
			return true;
		}
	}
}
		function applyToConservator(){
			var a=document.getElementById("conservatorStatement").value;
			var b=document.getElementById("conservatorQualification").value;
			var c=document.getElementById("ImageId").value;
			
			
			if(b=="" || b.length==0){
			document.getElementById("errorQualification").style.display="inline";
			error++;
			
			}else{
			document.getElementById("errorQualification").style.display="none";
			}
			
			if(c==0 || c.length==0){
			document.getElementById("errorImageId").style.display="inline";
			error++;
			
			}else{
			document.getElementById("errorImageId").style.display="none";
			}
			
			if(b!="" || b.length>0){
			  var status=documentFileFormat(b);
			  if(!status){
			   document.getElementById("errorQualificationFormat").style.display="inline";
			   error++;
			 }
			 else{
			  document.getElementById("errorQualificationFormat").style.display="none";
			  return true;
			 }
			}
			if(error>0){
				return false;
			}
			return true;
		}

function applyToProjectConservator() {   
	var isEmpty = 0;
	var uploadFile1 = document.getElementById("file1").value;
	var uploadFile2 = document.getElementById("file2").value;
	var uploadFile3 = document.getElementById("file3").value;
	var uploadFile4 = document.getElementById("file4").value;
	//var uploadFile5 = document.getElementById("file5").value;
	if (uploadFile1 != "" || uploadFile1.length > 0) {
		isEmpty++;
	}
	if (uploadFile2 != "" || uploadFile2.length > 0) {
		isEmpty++;
	}
	if (uploadFile3 != "" || uploadFile3.length > 0) {
		isEmpty++;
	}
	if (uploadFile4 != "" || uploadFile4.length > 0) {
		isEmpty++;
	}
	/*if (uploadFile5 != "" || uploadFile5.length > 0) {
		isEmpty++;
	}
	*/
	if (isEmpty == 0) {
		alert("Please upload your artwork");
		return false;
	}
	if (uploadFile1 != "" || uploadFile1.length > 0) {
		var status = uploadArtworkFileFormat(uploadFile1);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("file1").value = "";
			document.getElementById("errorFile1").style.display = "inline";
			return false;
		} else {
			document.getElementById("errorFile1").style.display = "none";
		}
	} else {
		document.getElementById("errorFile1").style.display = "none";
	}
	if (uploadFile2 != "" || uploadFile2.length > 0) {
		var status = uploadArtworkFileFormat(uploadFile2);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("file2").value = "";
			document.getElementById("errorFile2").style.display = "inline";
			return false;
		} else {
			document.getElementById("errorFile2").style.display = "none";
		}
	} else {
		document.getElementById("errorFile2").style.display = "none";
	}
	if (uploadFile3 != "" || uploadFile3.length > 0) {
		var status = uploadArtworkFileFormat(uploadFile3);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("file3").value = "";
			document.getElementById("errorFile3").style.display = "inline";
			return false;
		} else {
			document.getElementById("errorFile3").style.display = "none";
		}
	} else {
		document.getElementById("errorFile3").style.display = "none";
	}
	if (uploadFile4 != "" || uploadFile4.length > 0) {
		var status = uploadArtworkFileFormat(uploadFile4);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("file4").value = "";
			document.getElementById("errorFile4").style.display = "inline";
			return false;
		} else {
			document.getElementById("errorFile4").style.display = "none";
		}
	} else {
		document.getElementById("errorFile4").style.display = "none";
	}
	/*	if (uploadFile5 != "" || uploadFile5.length > 0) {
		var status = uploadArtworkFileFormat(uploadFile5);
		//alert(status);
		if (!status) {
			alert("Mismatch File Format");
			document.getElementById("file5").value = "";
			document.getElementById("errorFile5").style.display = "inline";
			return false;
		} else {
			document.getElementById("errorFile5").style.display = "none";
		}
	} else {
		document.getElementById("errorFile5").style.display = "none";
	}
	
	*/
	var conResumErr=0;
	var resumeFile = document.getElementById("artistResume").value;
	if(resumeFile==""||resumeFile.length==0){
		conResumErr++;
		document.getElementById('resumeError').style.display="inline"
		document.getElementById('resumeFormatError').style.display="none"
	}
	else{
	//if (resumeFile != "" || resumeFile.length > 0) {
		var status = documentFileFormat(resumeFile);
		//alert(status);
		if (!status) {			
			conResumErr++;
			//alert("Resume Mismatch File Format"); //resumeError
			//document.getElementById("resumeError").style.display = "inline";
			//document.getElementById("artistResume").value = "";
			//return false;			
			document.getElementById('resumeError').style.display="none"
			document.getElementById('resumeFormatError').style.display="inline"
		}
		// else {
		//	document.getElementById("resumeError").style.display = "none";
		//}
	 }
	//}
	if(conResumErr>0){
		return false;
	}
	return true;
}
function resumeEditValidation() {
	var resumeFile = "";
	resumeFile = document.getElementById("uploadDoc").value;
	if (resumeFile != "" & resumeFile.length > 0) {
		var status = documentFileFormat(resumeFile);
		if (!status) {
			alert("Resume Mismatch File Format"); //resumeError
			//document.getElementById("resumeError").style.display = "inline";
			//document.getElementById("artistResume").value = "";
			return false;
		} else {
			//document.getElementById("resumeError").style.display = "none";
			return true;
		}
	}
	return true;
}
function projectShowDetails(id) {
	var visibleOption = document.getElementById("projectShow").options;
	//alert(visibleOption);
	var isvisible;
	var selectedOption;
	for (var i = 0; i < visibleOption.length; i++) {
		var statusId = visibleOption[i].selected;
		if (statusId) {
			isvisible = document.getElementById("projectShow").options[i].value;
			break;
		}
	}
	if (false) {  //always false.. don't worry about that..
	} else {
		var url = "adminProject.jspx?req=projectStatus&id=" + id + "&visible=" + isvisible;
		var req = initRequest();
		req.onreadystatechange = function () {
			if (req.readyState == 4) {
				if (req.status == 200) {
					document.getElementById("updateReport").innerHTML = req.responseText;                    
                  // alert(req.responseText);
				} else {
					if (req.status == 204) {
						clearTable();
					}
				}
			}
		};
		req.open("GET", url, true);
		req.send(null);
	}
}
function fnPostRfp() {
	//alert("hai");
	return false;
}
function initRequest() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) {
			isIE = true;
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
}
function showAlert(imgId) {
	var flag = confirm("It will remove corresponding Before/After Images also");
	var url = "";
	if (flag) {
		url = "artUpload.jspx?req=deleteConservator&id=" + imgId;
		document.getElementById("id").value = imgId;
		var theForm = this.document.myartwork;
		theForm.action = url;
		theForm.submit();
	}
}

function fnMyArtWorkStatus(id, imgId) {
	if (id == "2") {
		
		var flag = confirm("This image already applied to particular RFP/RFQ. Are you sure do you want to delete?");
		var URL2 = "";
		if (flag) {
			var URL2 = "artUpload.jspx?req=deleteConservator&id=" + imgId;
			document.getElementById("id").value = imgId;
			var theForm = this.document.myartwork;
			theForm.action = URL2;
			theForm.submit();
		}
	}
	if (id == "1") {
	
		var flag = confirm("This image already applied to particular RFP/RFQ. Are you sure do you want to delete?");
		var URL1 = "";
		if (flag) {
			var URL1 = "artUpload.jspx?req=delete&id=" + imgId;
			document.getElementById("id").value = imgId;
			var theForm = this.document.myartwork;
			theForm.action = URL1;
			theForm.submit();
		}
	}
}
function attachMoreArtwork(closeMoreUploadArtworkid, openAnotherDivId) {
	//alert(closeMoreUploadArtworkid);
	//alert(openAnotherDivId);
	
	document.getElementById(closeMoreUploadArtworkid).style.display = "none";
	document.getElementById(openAnotherDivId).style.display = "inline";
}

function showAlertForDeleteImage(imgId){

	var flag = confirm("Are you sure do you want to Delete?");
	if (flag) {
		var URL1 = "artUpload.jspx?req=delete&id=" + imgId;
		document.getElementById("id").value = imgId;
		var theForm = this.document.myartwork;
		theForm.action = URL1;
		theForm.submit();
	}
}
function applyToArtist() {
	
	var b = document.getElementById("resume").value;
	var c = document.getElementById("ImageId").value;
	var err=0;
	
	if (b == "" || b.length == 0) {
		document.getElementById("errorQualification").style.display = "inline";
		err++;
	} else {
		document.getElementById("errorQualification").style.display = "none";
	}
	if (c == 0 || c.length == 0) {
		document.getElementById("errorImageId").style.display = "inline";
		err++;
	} else {
		document.getElementById("errorImageId").style.display = "none";
	}
	if (err > 0) {
		return false;
	}
	return true;
}

