﻿function hotelvalidation()
{
var arr=new Array ();

    
   
 
    var oEditor = FCKeditorAPI.GetInstance ('ctl00_ContentPlaceHolder1_txtdescription'); 
    
    if(document .getElementById ('ctl00_ContentPlaceHolder1_txtHotelName').value =="" )
    {
    arr [0]= ("Hotel Name can not be blank.");
    }
    else 
    {
    arr [0]="";
    }
    
    if(document .getElementById ('ctl00_ContentPlaceHolder1_ddlistType').value =="1")
    {
        if( document .getElementById ('ctl00_ContentPlaceHolder1_ddlistCountry').value =="" )
        {
        arr [1]="select any country";
        }
        else 
        {
        arr [1]="";
        }
        if (document .getElementById ('ctl00_ContentPlaceHolder1_ddlistState')!=null )
        {
        if (document .getElementById ('ctl00_ContentPlaceHolder1_ddlistState').value=="select any state" )
        {
        arr [2]="select any state";
        }
        else 
        {
        arr [2]="";
        }
        }
        else 
        {
        arr [2]="";
        }
        if (document .getElementById ('ctl00_ContentPlaceHolder1_ddlistCity').value =="select any city" )
        {
        arr [3]="select any city";
        }
        else 
        {
        arr [3]="";
        }
        arr [4]="";
    }
    else if (document.getElementById ('ctl00_ContentPlaceHolder1_ddlistType').value =="2")
    {
        arr [1]="";
        arr [2]="";
        arr [3]="";
        if(document .getElementById ('ctl00_ContentPlaceHolder1_txtCost').value=="")
        {
        arr[4]="Cost can not be blank.";
        }
        else 
        {
            if(parseInt (document .getElementById ('ctl00_ContentPlaceHolder1_txtCost').value))
            {
            arr [4]="";
            }
            else 
            {
            arr [4]="enter numeric cost";
            }
            
        }
    }
   
  if (oEditor.GetXHTML ()=="")
    {
  
    arr[5]="Description can not be blank.";
    }
    else 
    {
    arr[5]="";
    }
   
        
   var mess=new Array ();
   for (var i=0;i< arr .length ;i++)
   {
         if(arr[i]!="" )
        {
        mess [i]=arr [i]+"\n";
        }
   }
   if(mess .length !=0)
   {
   alert (mess .join (""));
   return false ;
   }
   
}

function CruisePackageValidation(name,cruisename,description,cost)
{

var arr=new Array ();
if (document .getElementById (name).value=="")
{
arr [0]="name can not be blank.";

}
else 
{
arr [0]="";
}
if (document .getElementById (cruisename ).value=="")
{
arr [1]="select any cruise";

}
else 
{
arr [1]="";
} 
////if (description.GetXHTML ()=="")
////    {
////  alert ("sdsd");
////    arr[2]="Description can not be blank.";
////     
////    }
////    else 
////    {
////    arr[2]="";
////    }
    if (document.getElementById (cost ).value=="")
    {
    arr [2]="cost can not be blank.";
  
    }
    else 
    {
//    var val=parseFloat (cost );
//    if (isNaN (val ))
//    {
//    arr [2]=val + " is not an float";

//    }
//    else 
//    {
    arr [2]="";
//    }
     
    }
    var mess=new Array ();
    for (var i=0;i <arr .length ;i ++)
    {
     if (arr [i]!="")
     {
     mess [i]=arr [i]+"\n";
     }
    }
    if (mess.length >0)
    {
    alert ( mess .join (""));
    return false ;
    }
    
}


