function countryadmin(iAction) {

	switch (iAction) {

		case "create":
			cname = city.ncountry.value;
			statename=city.nstate.value;
			scname = city.ncity.value;			
			if (cname == "" | statename == "" | scname == "") {
				alert ("Country, First state and First city Names Must Be Specified!");
			}else{
				city.submitFlag.value = "create";
		 		city.submit();
			}
		break;
		
		case "addstate":
			statname = city.astate.value;
			scname = city.acity.value;
			if (statname == "" | scname == "") {
				alert ("Please Specify state Name and First City!");
			}else{
				city.submitFlag.value = "addstate";
		 		city.submit();
			}
		break;
		
		case "addcity":
			scname = city.acity.value;
			if (scname == "") {
				alert ("Please Specify city Name!");
			}else{
				city.submitFlag.value = "addcity";
		 		city.submit();
			}
		break;
		
		case "countrymod":
			cname = city.mcountry.value;			
			if (cname == "") {
				alert ("Country Name Must Be Specified!");
			}else{
				city.submitFlag.value = "countrymod";
		 		city.submit();
			}
		break;
		
		case "statemod":
			statename = city.mstate.value;
			if (statename == "") {
				alert ("Please Specify state Name!");
			}else{
				city.submitFlag.value = "statemod";
		 		city.submit();
			}
		break;
		
		case "citymod":
			scname = city.mcity.value;
			if (scname == "") {
				alert ("Please Specify city Name!");
			}else{
				city.submitFlag.value = "citymod";
		 		city.submit();
			}
		break;

		case "delcountry":
			if (window.confirm("You are about to DELETE selected Country!")) {
				city.submitFlag.value = "delcountry";
				city.action = "admin_deletecity.asp";
		 		city.submit();
			}
		break;
		
		case "delstate":
			if (window.confirm("You are about to DELETE selected state!")) {
				city.submitFlag.value = "delstate";
				city.action = "admin_deletecity.asp";
			 	city.submit();
			}
		break;

		case "delcity":
			if (window.confirm("You are about to DELETE selected City!")) {
				city.submitFlag.value = "delcity";
				city.action = "admin_deletecity.asp";
			 	city.submit();
			}
		break;
	}
}

function selectcountry(ipage) {

	oform = document.city;
	countryID = oform.ccountry.options[oform.ccountry.selectedIndex].value;
	window.location = ipage+"?countryid="+countryID;

}



function selectstate(ipage) {
	oform = document.city;
	countryID = oform.ccountry.options[oform.ccountry.selectedIndex].value;
	stateID = oform.cstate.options[oform.cstate.selectedIndex].value;		
	window.location = ipage+"?countryid="+countryID+"&stateid="+stateID;
}


function selectcity(ipage) {

	oform = document.city;	
	countryID = oform.ccountry.options[oform.ccountry.selectedIndex].value;
	stateID = oform.cstate.options[oform.cstate.selectedIndex].value;
	cityID = oform.ccity.options[oform.ccity.selectedIndex].value;
	window.location = ipage+"?countryid="+countryID+"&stateid="+stateID+"&cityid="+cityID;

}

function popup(url,wname,params) {
	PopWin = window.open(url,wname,params);
	PopWin.focus();
}

function bnDelete(oform)
{


	if (oform.options.length !==0){
		i=0;
		for (i=0; i < oform.options.length; i++) {
			if (oform.options[i].selected == true){
				if (window.confirm("Do you wish to DELETE banner "+oform.options[oform.selectedIndex].value+"?")) {
					window.location="filter.asp?url=admin_rotator.asp&act=13&b="+oform.options[oform.selectedIndex].value;
				}
				return false;
			}else{
				notselected = true;
			}
   		}
		if (notselected) {alert("No banner was selected.");}

	}else{
		alert("The available banners list is empty.");
	}

}

function popup(url,wname,params) {
	PopWin = window.open(url,wname,params);
	PopWin.focus();
}

function evalSize(iw,ih) {

	if (document.getElementById("uimage")!==null) {
		var osz=document.getElementById("sz");
		var oimage=document.getElementById("uimage");
		var w = oimage.width;
		var h = oimage.height;
		osz.innerHTML="Dimension: "+w+"x"+h+" px";
		if (w > iw | h > ih) {
			alert("The Image size is greater than maximum allowed: "+iw+"x"+ih+"px.\n\nPlease Select a different image.");
			document.img.isvalid.value="false";
		}else{
			document.img.isvalid.value="true";
			document.img.imgw.value = w;
			document.img.imgh.value = h;
		}

	}
}

function sendImage(oForm, oRemForm) {
	
	if (oForm.isvalid.value=='true') {
		oRemForm.action = "iprev.asp?w="+oForm.imgw.value+"&h="+oForm.imgh.value;
		oForm.B2.disabled = true;
		oRemForm.submit();
	}else{
		alert("The Image size is greater than maximum allowed: 400x400px.\n\nPlease Select a different image to upload.");
	}
}

function delphoto()
{
alert("Do you want to Edit?");
}