function checkValidations(frmObj)
{
	with(frmObj)
	{
		if(is_image_uploaded.value == "0")
		{
			alert("Please upload image");
			return false;
		}
		else if(is_image_uploaded.value == "2")
		{
			alert("Please wait... image is uploading");
			return false;
		}
		if(vAlias.value != "")
		{
			if(vAlias.value.length < 5 || (alphanum(vAlias.value,vAlias.value.length) == false))
			{	
				alert("Please enter valid custom alias");
				vAlias.focus();
				return false;
			}
		}
		if(vTitle.value=="")
		{
			swapImage('IMG1', 'collaps_indicator_1', 'submit');//swapImage1(2);
			toggleSlide('Image_Information');
			alert("Please enter image title.");
			vTitle.focus();
			return false;
		}
		if(document.getElementById('eCustomTitle').checked==true)
		{
			if(document.getElementById('eCustomTitleType').value == "T")
			{
				document.getElementById('Image_Information').style.display = '';
				EditorInstance = FCKeditorAPI.GetInstance("vCustomTitle");
				content_field_name = "vCustomTitle";
				tDescription_data = getFCKEditorTextLength(content_field_name);
				//alert(tDescription_data);
				if(tDescription_data<=0 || tDescription_data == "<br />" || tDescription_data == "<BR>" || tDescription_data == "<br>")
				{
					alert("Please enter custom title.");
					EditorInstance.EditorDocument.body.focus();
					return false;
				}

				//swapImage1(2);
				//toggleSlide('Video_Information');
				/*
				alert("Please enter custom title.");
				vCustomTitle.focus();
				return false;
				*/
			}
			else if(document.getElementById('eCustomTitleType').value == "I" && vImage.value == "")
			{
				//swapImage1(2);
				//toggleSlide('Video_Information');
				alert("Please browse image.");
				vImage.focus();
				return false;
			}
			else if(document.getElementById('eCustomTitleType').value == "")
			{
				alert("Please select custom title type.");
				document.getElementById('eCustomTitleType').focus();
				return false;
			}
		}
		/* Validations for Monetize your site Option... */
		/*if(document.getElementById('eMonetize').checked == true)
		{
			if(!checkSelected('eShowMoneyAd', 'eShowMoneyAdPos', 'Free Money Training Package')) return false;
			if(!checkSelected('eShowWhiteHatAd', 'eShowWhiteHatAdPos', 'Whitehat Copyhat')) return false;
			if(!checkSelected('eShowAutoRespoAd', 'eShowAutoRespoAdPos', 'Autoresponder Code')) return false;
			if(!checkSelected('eShowDevCenterAd', 'eShowDevCenterAdPos', 'Development Center')) return false;
		}*/
		/* =========================================== */
		if(vName.value == "")
		{
			swapImage('IMG3', 'collaps_indicator_3', 'submit');
			toggleSlide('User_Options');
			//swapImage3(2);
			if(document.getElementById('User_Options').style.display == "none")
				toggleSlide('User_Options');
			alert("Please enter your name.");
			vName.focus();
			return false;
		}
		if(vEmail.value == "")
		{
			swapImage('IMG3', 'collaps_indicator_3', 'submit');
			if(document.getElementById('User_Options').style.display == "none")
				toggleSlide('User_Options');
				alert("Please enter your email.");
			vEmail.focus();
			return false;
		}
		if(!isValidEmail(vEmail.value))
		{
			swapImage('IMG3', 'collaps_indicator_3', 'submit');
			if(document.getElementById('User_Options').style.display == "none")
				toggleSlide('User_Options');
			vEmail.focus();
			return false;
		}
	}

	checkCustomAliasExist(document.frmimage, document.frmimage.vAlias.value, 'submit');
	return false;
}

function doShowHideCustomOption()
{
	var rs = document.getElementById('eCustomTitle').checked;
	if(rs == true)
		document.getElementById('customOption').style.display = '';
	else
		document.getElementById('customOption').style.display = 'none';
}

function doShowHideAllowCommentOption()
{
	var rs = document.getElementById('eAllowComment').checked;
	if(rs == true)
		document.getElementById('allowCommentOptions').style.display = '';
	else
		document.getElementById('allowCommentOptions').style.display = 'none';
}

function doShowHideCustTitleType(val)
{
	if(val == "T")
	{
		document.getElementById('cust_title').style.display = "";
		document.getElementById('cust_image').style.display = "none";
	}
	else if(val == "I")
	{
		document.getElementById('cust_title').style.display = "none";
		document.getElementById('cust_image').style.display = "";
	}
	else
	{
		document.getElementById('cust_title').style.display = "none";
		document.getElementById('cust_image').style.display = "none";
	}
}


/* ============= Validations for Monetize your site Option... ============= */
function doShowHideOptions(clickOpt, optId, mainchk)
{
	if(document.getElementById(clickOpt).checked == true)
		document.getElementById(optId).style.display='';
	else {
		if(mainchk != "")
			doClearAllOptions();
		document.getElementById(optId).style.display='none';
	}
}
function doClearAllOptions()
{
	document.getElementById('eShowMoneyAd').checked=false;
	document.getElementById('eShowMoneyAdPos1').checked=false;
	document.getElementById('eShowMoneyAdPos2').checked=false;
	
	document.getElementById('eShowWhiteHatAd').checked=false;
	document.getElementById('eShowWhiteHatAdPos1').checked=false;
	document.getElementById('eShowWhiteHatAdPos2').checked=false;
	
	document.getElementById('eShowAutoRespoAd').checked=false;
	document.getElementById('eShowAutoRespoAdPos1').checked=false;
	document.getElementById('eShowAutoRespoAdPos2').checked=false;
	
	document.getElementById('eShowDevCenterAd').checked=false;
	document.getElementById('eShowDevCenterAdPos1').checked=false;
	document.getElementById('eShowDevCenterAdPos2').checked=false;

	document.getElementById('vClickbankID').value = "";
}

function checkSelected(chkOpt, posOptId, displayStr)
{
	if(document.getElementById(chkOpt).checked == false) {
		alert("Please check "+displayStr+" checkbox.");
		document.getElementById(chkOpt).focus();
		return 0;
	}
	else if(document.getElementById(posOptId+"1").checked == false && document.getElementById(posOptId+"2").checked == false) {
		alert("Please select "+displayStr+" position.");
		document.getElementById(chkOpt).focus();
		return 0;
	}
	return 1;
}
/* =========================================================================== */