function selectCategory() {
	catVal = document.categoryform.modelId.options[document.categoryform.modelId.selectedIndex].value;
	if(catVal.length <= 0) {
		return false;
	}
	else if(catVal == 0) {
		document.categoryform.modelId.selectedIndex ++;
		document.categoryform.submit()
	}
	else {
		modelValue = document.categoryform.modelId.options[document.categoryform.modelId.selectedIndex].value;
		document.categoryform.submit()
	}
}
function checkProfiles(){
	document.profiles.modelName.value = trimSpaces(document.profiles.modelName.value);
	if(document.profiles.modelName.value.length <= 0) {
		alert("Please enter your name");
		document.profiles.modelName.focus();
		return false;
	}
	document.profiles.modelAddress.value = trimSpaces(document.profiles.modelAddress.value);
	if(document.profiles.modelAddress.value.length <= 0) {
		alert("Please enter your address");
		document.profiles.modelAddress.focus();
		return false;
	}
	/*document.profiles.modelStreet.value = trimSpaces(document.profiles.modelStreet.value);
	if(document.profiles.modelStreet.value.length <= 0) {
		alert("Please enter the street address");
		document.profiles.modelStreet.focus();
		return false;
	}
	document.profiles.modelCity.value = trimSpaces(document.profiles.modelCity.value);
	if(document.profiles.modelCity.value.length <= 0) {
		alert("Please enter the city");
		document.profiles.modelCity.focus();
		return false;
	}
	document.profiles.modelState.value = trimSpaces(document.profiles.modelState.value);
	if(document.profiles.modelState.value.length <= 0) {
		alert("Please enter the state");
		document.profiles.modelState.focus();
		return false;
	}*/
	document.profiles.modelCountry.value = trimSpaces(document.profiles.modelCountry.value);
	if(document.profiles.modelCountry.value.length <= 0) {
		alert("Please select your country");
		document.profiles.modelCountry.focus();
		return false;
	}
		
	document.profiles.modelEmail.value = trimSpaces(document.profiles.modelEmail.value);
	if(document.profiles.modelEmail.value.length <= 0) {
		{	
			alert("Please enter the Email");
			document.profiles.modelEmail.focus();
			return false;
		}
	}
	if(document.profiles.modelEmail.value.length > 0) {
		if(!checkEmail(document.profiles.modelEmail.value)) {
			document.profiles.modelEmail.select();
			return false;
		}
	}
		
	document.profiles.frmAction.value = "update";
}

function checkBooking1(){
	document.profiles.yourName.value = trimSpaces(document.profiles.yourName.value);
	if(document.profiles.yourName.value.length <= 0) {
		alert("Please enter your name");
		document.profiles.yourName.focus();
		return false;
	}
	document.profiles.yourAddress.value = trimSpaces(document.profiles.yourAddress.value);
	if(document.profiles.yourAddress.value.length <= 0) {
		alert("Please enter your address");
		document.profiles.yourAddress.focus();
		return false;
	}
	document.profiles.yourEmail.value = trimSpaces(document.profiles.yourEmail.value);
	if(document.profiles.yourEmail.value.length <= 0) {
		{	
			alert("Please enter the Email");
			document.profiles.yourEmail.focus();
			return false;
		}
	}
	if(document.profiles.yourEmail.value.length > 0) {
		if(!checkEmail(document.profiles.yourEmail.value)) {
			document.profiles.yourEmail.select();
			return false;
		}
	}
	
	document.profiles.frmAction.value = "send";
}
function openCalendar(modelId) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 500;
	winHeight = 450;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	
	window.open("showUsercalendar.php?modelId=" + modelId , "modelPhoto", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0 " );
	return;
	
}

function oopenModelBooking(modelId) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 400;
	winHeight = 350;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	
	window.open("modelBooking.php?modelId=" + modelId , "modelPhoto", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0 " );
	return;
	
}
function checkContact(){
	document.contact.yourName.value = trimSpaces(document.contact.yourName.value);
	if(document.contact.yourName.value.length <= 0) {
		alert("Please enter your name");
		document.contact.yourName.focus();
		return false;
	}
	document.contact.yourEmail.value = trimSpaces(document.contact.yourEmail.value);
	if(document.contact.yourEmail.value.length <= 0) {
		{	
			alert("Please enter the Email");
			document.contact.yourEmail.focus();
			return false;
		}
	}
	if(document.contact.yourEmail.value.length > 0) {
		if(!checkEmail(document.contact.yourEmail.value)) {
			document.contact.yourEmail.select();
			return false;
		}
	}
		if(document.contact.comments.value.length <= 0) {
		alert("Please enter your comments");
		document.contact.comments.focus();
		return false;
	}
	document.contact.frmAction.value = "send";
}