//***************************************************************//
// Filename: shaadi-direct.js
// Creation Date: 14-02-2007
//***************************************************************//
function submitpage(mypage) {
	document.profile.action=mypage;
	document.profile.submit();
	return true;	
}

function submit_form(location) {
	document.profile.type.value="location";
	document.profile.action = document.profile.action + "#" + location
	document.profile.submit();
	return true;
}

function race_type() {
	str = document.getElementById("race").value;
	if (str == "MX") {
		document.getElementById("divrace").style.visibility = "visible";
	} else {
		document.getElementById("divrace").style.visibility = "hidden";
	}
	return true;
}

function show_photo(photoname, auction) {
	mywindow = window.open('shaadiphoto.php?id='+photoname,'winList','scrollbars=yes,resizable=yes');
	mywindow.focus();
	return true;
}

function SelectAllMail(){
	//alert(document.view.ChkInbox[0].checked);
	if (document.view.selectall.checked == true) {
		val = true;
	} else {
		val = false;		
	}
	if (document.view.mailcount.value > 1) {	// Error was comming if only one email thats why this check
		for (var i=0; i<document.view.mailcount.value; i++) {
			//alert(i);
			document.view.ChkMail[i].checked=val;
		}
	}
}

function SendMail(){
	document.compose.submit();
}

function DeleteMail(ID) {
	flag = false;
	if (document.view.mailcount.value > 1) {	// Error was comming if only one email thats why this check
		for (var i=0; i<document.view.mailcount.value; i++) {
			if (document.view.ChkMail[i].checked == true) {
				flag = true;
				break;
			}
		}
	} else {
		flag = true;
	}
	if (flag) {
		abc = confirm("Are you sure to delete the selected email? ");
		if (abc == true){
			if (document.view.action.value == "inbox") {
				document.view.action.value = "delinbox";
				document.view.submit();
			} else if (document.view.action.value == "sent") {
				document.view.action.value = "delsent";
				document.view.submit();
			} else if (document.view.action.value == "trash") {
				document.view.action.value = "deltrash";
				document.view.submit();
			} else if (document.view.action.value == "allinbox") {
				document.view.action.value = "delallinbox";
				document.view.submit();
			}
		}
	}else {
		alert("You must need to select at least one email.");
	}
}

function IgnoreMail(ID) {
	flag = false;
	if (document.view.mailcount.value > 1) {	// Error was comming if only one email thats why this check
		for (var i=0; i<document.view.mailcount.value; i++) {
			if (document.view.ChkMail[i].checked == true) {
				flag = true;
				break;
			}
		}
	} else {
		flag = true;
	}
	if (flag) {
		abc = confirm("Are you sure to ignore emails from selected emails sender? ");
		if (abc == true){
			if (document.view.action.value == "inbox") {
				document.view.action.value = "ignoreinbox";
				document.view.submit();
			} else if (document.view.action.value == "allinbox") {
				document.view.action.value = "ignoreallinbox";
				document.view.submit();
			}
		}
	}else {
		alert("You must need to select at least one email.");
	}
}

function IgnoreUpdate() {
	flag = false;
	if (document.view.mailcount.value > 1) {	// Error was comming if only one email thats why this check
		for (var i=0; i<document.view.mailcount.value; i++) {
			if (document.view.ChkMail[i].checked == true) {
				flag = true;
				break;
			}
		}
	} else {
		flag = true;
	}
	if (flag) {
		abc = confirm("Are you sure to update email ignore list? ");
		if (abc == true){
			document.view.action.value = "ignoreupdate";
			document.view.submit();
		}
	}/*else {
		alert("You must need to select at least one email.");
	}*/
}
