/*************************************************REUSABLE FUNCTIONS STARTS********************************************************/

/***********HELP : STARTS**************
FUNCTION NAME : Trim -> To trim the values entered in text box(it will call the LTrim and RTrim functions inside automatically.
FUNCTION NAME : CharAndSpace -> This function will allow only character and space not digits(use for city, relation textbox).
FUNCTION NAME : DigitsAndDot -> This function will allow only Digits and Dot not characters(use for price textbox).
FUNCTION NAME : DigitsOnly -> This function will allow only Digits and not characters even dot also.
FUNCTION NAME : telephoneno -> This function will allow only Digits, +, and -(for eg. telephone no: IN +91  2221113456  Call ).
FUNCTION NAME : GetMonthDays -> This function will will return number of days in the current month.
FUNCTION NAME : GetDays -> This function will will returns the diff betn two dates for month 1=jan,12=Dec
FUNCTION NAME : isNumeric,isInteger -> This function will Checks the number is integer or not.
FUNCTION NAME : daysInFebruary -> This function will checks the posted date is valid or not.
FUNCTION NAME : isDate -> This function will Checks the febraury month.
FUNCTION NAME : closewindow -> This function will Close the window.
FUNCTION NAME : checkimage -> This function will checks the entered image is in .jpg,.gif,.jpeg,.png formot or not.
FUNCTION NAME : backToMain -> This function will redirect to specifie file.
FUNCTION NAME : ageValidate -> This function will to checks age the user's age.
FUNCTION NAME : ValidateDateAfter -> This function will to checks the date after some days.
FUNCTION NAME : SameOrAfterDate -> This function will to checks the date or after some days.
FUNCTION NAME : NotFutureDate -> This function will to checks whether the date is future date or not.
FUNCTION NAME : checkEmail -> This function will to checks for valid email-id.
FUNCTION NAME : selectall -> This function will check and uncheck the checkbox.
FUNCTION NAME : atleastone -> This function will Ask conformation before doing ant task like make active, inactive,delete operations.

/***********HELP : ENDS**************/
//Coding to not to show..
function noError(){return true;}
window.onerror = noError;

function bookmark(address,sitename)
{
	if (window.sidebar)
	{
		window.sidebar.addPanel(sitename, address,"");
	}
	else if( document.all )
	{
		window.external.AddFavorite(address, sitename);
	}
	else if( window.opera && window.print )
	{
		return true;
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

window.onLoad="MM_preloadImages('images/home_up.jpg','images/company_up.jpg','images/tech_up.jpg','images/prod_up.jpg','images/partner_up.jpg','images/news_up.jpg','images/forums_up.jpg','images/investor_up.jpg')"


//General funtion to prevent the JS error...
function xerr()
{
     return(true);
}
onerror=xerr;

//  Trim functions...
function Trim(TRIM_VALUE){
	if(TRIM_VALUE.length < 1){
		return"";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE==""){
		return "";
	}
	else{
		return TRIM_VALUE;
	}
} //End Function

function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
		return"";
	}
	var iTemp = v_length -1;

	while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
		iTemp = iTemp-1;

	} //End While
	return strTemp;

} //End Function

function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
		return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";

	var iTemp = 0;

	while(iTemp < v_length){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
		}
		iTemp = iTemp + 1;
	} //End While

	return strTemp;
} //End Function

//Function for field name that only allowed Character and Space not Digits...
function CharAndSpace(FieldName)
{
	if(FieldName.value != "")
	{
		var ValidChar = "0123456789~`!@#$%^&*()_+|\\=-][{}:';?><,./'";
		var ValidChars = ValidChar+'"';
		for (j = 0; j < FieldName.value.length; j++)
		{
			var Char = FieldName.value.charAt(j);
			if (ValidChars.indexOf(Char) != -1)
			{
				return  false;
			}
		}
		return true;
	}
}

//Function for field name that only allowed Digits and Dot...
function DigitsAndDot(FieldName)
{
	if(FieldName.value != "")
	{
		var ValidChars = "0123456789.";
		for (j = 0; j < FieldName.value.length; j++)
		{
			var Char = FieldName.value.charAt(j);
			if (ValidChars.indexOf(Char) == -1)
			{
				return  false;
			}
		}
		return true;
	}
}

//Function for field name that only allowed Digits...
function DigitsOnly(FieldName)
{
	if(FieldName.value != '')
	{
		var ValidChars = "0123456789";
		for (j = 0; j < FieldName.value.length; j++)
		{
			var Char = FieldName.value.charAt(j);
			if (ValidChars.indexOf(Char) == -1)
			{
				return  false;
			}
		}
	}
}

//Function for field name that only allowed Digits, +, and -(for eg. telephone no: IN +91  2221113456  Call )...
function telephoneno(FieldName)
{
	if(FieldName.value != "")
	{
		var ValidChars = "0123456789-+  ";
		for (j = 0; j < FieldName.value.length; j++)
		{
			var Char = FieldName.value.charAt(j);
			if (ValidChars.indexOf(Char) == -1)
			{
				return  false;
			}
		}
		return true;
	}
}

/* the function GetMonthDays will return number of days in the current month. */
function GetMonthDays()
{
	DateObj = new Date();
	var CurYear=DateObj.getMonth();
	var FebDays=28;

	if(CurYear%4==1)
	{
		FebDays=29;
	}

	days= new Array(31,FebDays,31,30,31,30,31,31,30,31,30,31);
	return days;
}

//returns the diff betn two dates for month 1=jan,12=Dec
function GetDays(toyear, tomonth, today, fromyear, frommonth, fromday)
{
	DDate= new Date(toyear,tomonth-1,today);
	NDate=	new Date(fromyear,frommonth-1,fromday);

	var Days = new String((NDate-DDate)/86400000);

	return Math.floor(Days);
}

//Check the number is integer or not...
function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++)
   {
      Char = sText.charAt(i);
      if(ValidChars.indexOf(Char) == -1)
      {
         IsNumber = false;
      }
   }
   return IsNumber;
}

//Check the febraury month...
function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   }
   return this;
}

//check the posted date is valid or not...
function isDate(dtStr)
{
	var daysInotifymonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("-The date format should be : mm/dd/yyyy.");
		return false;
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("-Please enter a valid month.");
		return false;
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInotifymonth[month]){
		alert("-Please enter a valid day.");
		return false;
	}
	if (strYear.length != 4 || year==0 || year<minotifyyear || year>maxYear){
		alert("-Please enter a valid 4 digit year between "+minotifyyear+" and "+maxYear+".");
		return false;
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("-Please enter a valid date.");
		return false;
	}
return true;
}

//Close the window
function closewindow()
{
	window.close();
}

//Function to check the entered image is in .jpg,.gif,.jpeg,.png formot or not...
function checkimage(formname,fieldname)
{
	if(eval("document."+formname+"."+fieldname+".value") != '')
	{
		imagename=eval("document."+formname+"."+fieldname+".value");
		splitimagename	= imagename.split(".");
		imagenamelen   	= splitimagename.length;
		imageextention	= splitimagename[imagenamelen-1];

                if((imageextention != 'jpg') & (imageextention != 'JPG') & (imageextention != 'gif') & (imageextention != 'jpeg') & (imageextention != 'png') & (imageextention != 'swf'))
		{
			alert("-Please Upload Proper Image.\nAccept image format:\n.gif\n.jpeg\n.jpg\n.png.");
			return false;
		}
	}
	return true;
}

//Function to check the entered image is in .jpg,.gif,.jpeg,.png formot or not...
function checkfile(formname,fieldname)
{
	if(eval("document."+formname+"."+fieldname+".value") != '')
	{
		imagename=eval("document."+formname+"."+fieldname+".value");
		splitimagename	= imagename.split(".");
		imagenamelen   	= splitimagename.length;
		imageextention	= splitimagename[imagenamelen-1];

                if((imageextention != 'jpg') & (imageextention != 'JPG') & (imageextention != 'gif') & (imageextention != 'jpeg') & (imageextention != 'png') & (imageextention != 'pdf') & (imageextention != 'doc') & (imageextention != 'txt') & (imageextention != 'mp3'))
		{
			Ext.onReady(function(){
			Ext.MessageBox.alert(alertname, '-Please Upload Proper Image.\nAccept image format:\n.gif\n.jpeg\n.jpg\n.png\n.pdf\n.doc\n.txt\.mp3.');
			});

			return false;
		}
	}
	return true;
}

//Function to check the entered image is in .jpg,.gif,.jpeg,.png formot or not...
function checkfiles(formname,fieldname)
{
	if(eval("document."+formname+"."+fieldname+".value") != '')
	{
		imagename=eval("document."+formname+"."+fieldname+".value");
		splitimagename	= imagename.split(".");
		imagenamelen   	= splitimagename.length;
		imageextention	= splitimagename[imagenamelen-1];

                if((imageextention != 'pdf') & (imageextention != 'doc') & (imageextention != 'txt') & (imageextention != 'docx'))
		{
			alert("-Please Upload Proper Image.\nAccept image format:\n.pdf\n.doc\n.txt\.docx.");
			return false;
		}
	}
	return true;
}

//Common function to redirect....
function backToMain(frm)
{
	with(frm)
	{
		document.location	=	module_name.value;
	}
}

//This function is using for to check age the user's age */
function ageValidate()
{
	var d= new Date();
	var cyear = d.getFullYear();

	var chkage = 0;

	with(document.complateapp)
	{
		if(isDate(month.value+"/"+day.value+"/"+year.value))
		{
			chkage = displayage(year.value, month.value, day.value);//cyear - main_age.value; //Age validation
			//alert(chkage);
			//if((year.value != chkage) && ((year.value < (chkage - 1)) || (year.value > (chkage + 1))))
			if(main_age.value != chkage && age_valid_status.value != 1)
			{
				alert("-The Age calculated from the Date of Birth just entered doesn't match that entered when asking for a quotation.");
				age_valid_status.value = 1;
				day.focus();
				return false;
			}
		}
		else
		{
			day.focus();
			return false;
		}
	}
}

//The function ValidateDateAfter() checks the cancellation date.
function ValidateDateAfter(year, month, day, startyear, startmonth, startday)
{
	if( parseInt(year.value) < parseInt(startyear.value))
	{
		//alert(year.value+" "+startyear.value);
		return false;
	}        //        End of if year.
	else if(parseInt(year.value) == parseInt(startyear.value))
	{
		//alert(month.value+" "+startmonth.value);

		if(parseInt(month.value) < parseInt(startmonth.value))
		{
			//alert(month.value+" "+startmonth.value);
			return false;
		}        //        End of if month.
		else if(parseInt(month.value) == parseInt(startmonth.value))
		{
			if(parseInt(day.value) < parseInt(startday.value))
			{
				//alert(day.value+" "+startday.value);
				return false;
			}        //        End of if day.
			else
			{return true;}
		}        //        End of if month.
		else
		{return true;}
	}        //        End of else if month.
	else
	{
		return true;
	}        //        End of else.
}       //        End of function.

//The function SameOrAfterDate() checks the authorization date and notification date.
function SameOrAfterDate(authyear, authmonth, authday, notifyyear, notifymonth, notifyday)
{

	//        Check for authorization date.
	if( parseInt(authyear.value) > parseInt(notifyyear.value))
	{
		//alert("-Date of notification must be a date after the Policy Start Date.");
		return true;
	}        //        End of if year.
	else if(parseInt(authyear.value) == parseInt(notifyyear.value))
	{
		//alert("compare"+month.value+" "+startmonth.value);

		if(parseInt(authmonth.value) > parseInt(notifymonth.value))
		{
			//alert("-Date of notification must be a date after the Policy Start Date.");
			return true;
		}        //        End of if month.
		else if(parseInt(authmonth.value) == parseInt(notifymonth.value))
		{
			if(parseInt(authday.value) >= parseInt(notifyday.value))
			{
				//alert("-Date of notification must be a date after the Policy Start Date.");
				return true;
			}        //        End of if day.
			else
			{return false;}
		}        //        End of if month.
		else
		{return false;}
	}        //        End of else if month.
	else
	{
		return false;
	}        //        End of else.
}       //        End of function.

//The function NotFutureDate(...) checks if the entered date is not a future date.
function NotFutureDate(year, month, day)
{
	// Get Current Date in variables.
	dateobj = new Date();
	yearobj = dateobj.getFullYear();
	monthobj= dateobj.getMonth()+1;
	dayobj  = dateobj.getDate();

	// Compare if entered year is a future year.
	if(year > parseInt(yearobj))
	{
		return false;
	}
	else if(year == parseInt(yearobj)) // if current year.
	{
		// Compare if entered month is a future month.
		if(month > parseInt(monthobj))
		{
			return false;
		}
		else if(month == parseInt(monthobj)) // current month.
		{
			// Compare if entered date is not a future date.
			if(day > parseInt(dayobj))
			{
				return false;
			}
			else { return true; }
		}
		else { return true; }
	}
	else { return true; }
}

//check email validation
function checkEmail(email)
{
	if(email != ""){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{
			return true;
		}
		alert("-Invalid E-Mail address! please re-enter.")
		return false;
	}else{
		alert("-Please enter E-Mail address.")
		return false;
	}
}

//Function to open popup...
function openpopup(url,popup_name,height,width,other_properties)
{
	var left		= parseInt((screen.width-350)/2);
	var top			= parseInt((screen.height-300)/2)
	var win_options = 'height='+height+',width='+width+',resizable=no,'
	+ 'scrollbars=1,left=' + left + ',top=' + top;
	window.open(url,popup_name,win_options);
}

//Function to open popup...
function openprintpopup(url,popup_name,height,width,other_properties)
{
	var left		= parseInt((screen.width-350)/2);
	var top			= parseInt((screen.height-300)/2)
	var win_options = 'height='+height+',width='+width+',resizable=no,'
	+ 'scrollbars=1,left=' + left + ',top=' + top;
	window.open(url,popup_name,win_options);
}

//Function to check and uncheck the checkbox...
function selectall(ids,frmname)
{
	var id=ids
	var fname= frmname
	var f1=document.fname.check;
	if(id==1)
	{
			for(i=0;i<=f1.length;i++)
			{
			   f1[i].checked=true;
			}
	}else
	{
			for(i=0;i<=f1.length;i++)
			{
				f1[i].checked=false;
			}

	}
}

//Ask conformation before doing ant task like make active, inactive,delete operations...
function atleastone(frm)
{
	with(frm)
	{
		var count = check.length;
		var i;
		for(i=0; i<count; i++)
		{
			if(check[i].checked)
			{
				var confirmation = confirm("-Do you want to do this operation.");
				if(confirmation) { return true; } else { return false; }
			}
		}
		alert('-Please select atleast one.');
		return false;
	}
}

//check email ids to your friends
function checkEmailsent(email)
{
	if(email != ""){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{
			return true;
		}
		alert("-Invalid E-Mail address! Please re-enter.")
		return false;
	}else{
		alert("-Please enter your friend E-Mail address.")
		return false;
	}
}

//check email ids to of admin...
function checkEmailadmin(email)
{
	if(email != ""){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{
			return true;
		}
		alert("-Invalid E-Mail address! Please re-enter.");
		return false;
	}else{
		alert("-Please enter E-Mail address.");
		return false;
	}
}

//By clicking on Active, Inactive, Delete button...
function anyone(frm,message)
{
	with(frm)
	{
		var count = check.length;
		var i;
		for(i=0; i < count; i++)
		{
			if(check[i].checked)
			{
				var confirmation = confirm("-Do you want to do this operation.");
				if(confirmation) { return true; } else { return false; }
			}
		}
		alert("-Please select atleast one "+message+".");
		return false;
	}
}

/*Coding to show hide the input box value on foucus and onblur START*/
function putvalue(txtval,obj)
{
	if(obj.value=='')
	{
		obj.value=txtval;
	}
}

function getvalue(txtval,obj)
{
	if(obj.value==txtval)
	{
		obj.value='';
	}
}
/*Coding to show hide the input box value on foucus and onblur END*/

/*************************************************REUSABLE FUNCTIONS ENDS********************************************************/

function validatecs(frm)
{
	with(frm)
	{
		/*if(country.value==0)
		{
			alert("-Please select the country.");
			return false;
		}
		if(service.value==0)
		{
			alert("-Please select the service.");
			return false;
		}
		if(country.value!=0 && service.value!=0) {*/
			frm.action="case_studies.php?c=" + country.value + "&s=" + service.value;
			frm.method="POST";
			frm.submit();
		//}
	}
}

function email_validate(frm)
{
	if(frm.email.value=="" || frm.email.value=="Your Email ID")
	{
		alert("-Please enter your email address");
		frm.email.focus();
		return false;
	}
	if(!checkEmail(frm.email.value))
	{
		frm.email.focus();
		return false;
	}
}

//to validate select in all/none(hotel).....
function selectall(ids,frmname)
{
	var id=ids
	var fname= frmname
	var f1=document.fname.check;
	if(id==1)
	{
			for(i=0;i<=f1.length;i++)
			{
			   f1[i].checked=true;
			}
	}else
	{
			for(i=0;i<=f1.length;i++)
			{
				f1[i].checked=false;
			}

	}
}


function SelectAllInnews(ids)
{
	//alert("gjfsjk");
	var id=ids;
	var f1=document.news.check;
	if(id==1)
	{
			for(i=0;i<=f1.length;i++)
			{
			   f1[i].checked=true;
			}
	}
	else
	{
			for(i=0;i<=f1.length;i++)
			{
				f1[i].checked=false;
			}
	}
}

function validateaddnews(frm)
{
	with(frm)
	{
		if(Trim(countries.value) == '')
		{
			alert("-Please select your country.");
			countries.focus();
			return false;
		}
		if(Trim(news_head.value) == '')
		{
			alert("-Please enter your news head.");
			news_head.focus();
			return false;
		}
		if(Trim(news_detail.value) == '')
		{
			alert("-Please enter your news details.");
			news_detail.focus();
			return false;
		}
		if(Trim(cdate.value) == '')
		{
			alert("-Please select your date.");
			cdate.focus();
			return false;
		}

	}
	return true;
}

function validatecasestudies(frm)
{
	//alert('sdffsdf');
	with(frm)
	{
		if(Trim(headline.value) == '')
		{
			alert("-Please enter the headline.");
			headline.focus();
			return false;
		}
		if(Trim(region.value)=='')
		{
			alert("-Please choose the region.");
			region.focus();
			return false;
		}
		if(Trim(country.value)=='')
		{
			alert("-Please choose the country.");
			country.focus();
			return false;
		}
		if(Trim(services.value)=='')
		{
			alert("-Please choose the services.");
			services.focus();
			return false;
		}
		if(FCKeditorAPI.GetInstance('content').GetXHTML() == '')
		{
			alert('-Please enter the content.');
			content.focus();
			return false;
		}
		/*if(Trim(title.value) == '')
		{
			alert("-Please enter the upload file title.");
			title.focus();
			return false;
		}
		if(Trim(title1.value) == '')
		{
			alert("-Please enter the file title1.");
			title1.focus();
			return false;
		}
		if(uplaod1.value != '')
		{
			if(!checkfiles('frmcasestudies','uplaod1'))
			{
				return false;
			}
		}
		if(Trim(title2.value) == '')
		{
			alert("-Please enter the file title2.");
			title2.focus();
			return false;
		}
		if(uplaod2.value != '')
		{
			if(!checkfiles('frmcasestudies','uplaod2'))
			{
				return false;
			}
		}
		if(Trim(title3.value) == '')
		{
			alert("-Please enter the file title3.");
			title3.focus();
			return false;
		}
		if(uplaod3.value != '')
		{
			if(!checkfiles('frmcasestudies','uplaod3'))
			{
				return false;
			}
		}*/
	}
	return true;
}

//validate select all and none.....
function SelectAllInfrm(ids,f1)
{
	var id=ids;
//	var f1=document.viewforum.check;
	if(id==1)
	{
			for(i=0;i<=f1.length;i++)
			{
			   f1[i].checked=true;
			}
	}
	else
	{
			for(i=0;i<=f1.length;i++)
			{
				f1[i].checked=false;
			}
	}
}

//validation for add region form...
function validateaddregion(frm)
{
	with(frm)
	{
		if(Trim(region_title.value)=='')
		{
			alert("-Plese enter the region title.");
			region_title.focus();
			return false;
		}
	}
	return true;
}

//validate fir add country form....
function validateaddcountry(frm)
{
	with(frm)
	{
		if(Trim(region.value)=='')
		{
			alert("-Plese select the region.");
			region.focus();
			return false;
		}
		if(Trim(country.value)=='')
		{
			alert("-Plese enter the country name.");
			country.focus();
			return false;
		}
	}
	return true;
}

//validation for add services form...
function validateaddservices(frm)
{
	with(frm)
	{
		if(Trim(services.value)=='')
		{
			alert("-Plese enter the services title.");
			services.focus();
			return false;
		}
	}
	return true;
}
function enlarge()
{
  window.open("detail.html","viewmap","height=383,width=483,status=no,toolbar=no,resizable=no")
}


function validatebanner(frm){
	with(frm){
		if(Trim(ban_url.value)==''){
			alert('Please enter the page url.');
			ban_url.focus();
			return false;
		}
		if(Trim(ban_name.value)==''){
			alert('Please enter the title.');
			ban_name.focus();
			return false;
		}
		if(bann_img.value != '')
		{
			if(!checkimage('frmbanner','bann_img'))
			{
			return false;
			}
		}
	}
	return true;
}