/* 
accomodation_rates.js: library of javascript for validating accomodation rates
    david.kelly@fanore.com (http://www.fanore.com/website_design.htm)
    
    
    
*/

function check_accommodation_rate(){
    var progress_bar_url=$F('progress_bar_url');
    if ($F('house_type').blank()){
        show_error_message("please enter the house type!",'error_message_panel');
        $('house_type').focus();
        return false;
    }
    if ($F('season').blank()){
        show_error_message("please enter the season!",'error_message_panel');
        $('season').focus();
        return false;
    }
    if ($F('duration').blank()){
        show_error_message("please enter the duration (e.g. 2 nights)!",'error_message_panel');
        $('duration').focus();
        return false;
    }
    if ($F('price').blank()){
        show_error_message("please enter the price!",'error_message_panel');
        $('price').focus();
        return false;
    }
    var p= $F('price')
    if (isNaN(p)){
        show_error_message("please enter only numeric values for the price!",'error_message_panel');
        $('price').focus();
        return false;
    }

    //return false;
    $('save').target='keyhole'; 
// display a window indicating save progress 
            var w=380;
            var h=50;
            var winLeft=Math.round((screen.width - w)/2);
            var winTop=Math.round((screen.height - h)/2);
            var sVersion = navigator.appVersion;
             
           if (sVersion.indexOf('MSIE') != -1 && sVersion.substr(sVersion.indexOf('MSIE')+5,1) > 4)
          {
        		var settings="dialogWidth:380px; dialogHeight:50px; center:yes";
        		var x=window.showModelessDialog(progress_bar_url+ '&b=IE',null,settings);
                x.opener=window
            }
            else
            {
        		//var x=window.open(progress_bar_url+ '&b=NN','','width=370,height=115', true);
                var x=window.open(progress_bar_url+ '&b=NN','','width=380px,height=50', true);
        
           }
           
            x.focus()
   
   

            

    $('save').submit();
    
}




