CVE-2015-10126: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (CWE-89)
value: A vulnerability classified as critical was found in Easy2Map Photos Plugin 1.0.1 on WordPress. This vulnerability affects unknown code. The manipulation leads to sql injection. The attack can be initiated remotely. Upgrading to version 1.1.0 is able to address this issue. The patch is identified as 503d9ee2482d27c065f78d9546f076a406189908. It is recommended to upgrade the affected component. VDB-241318 is the identifier assigned to this vulnerability.
CWE description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
CVSS v3 base score: 9.8
Published: 2023-10-06T08:15Z
Repository: https://github.com/wp-plugins/easy2map-photos
Language: PHP
Files changed: css/mapadmin.css, includes/CSSEditHTML.html, includes/Easy2MapImg.php, includes/Functions.php, includes/ImageFunctions.php, includes/MapAdmin.php, includes/MapPinImageUpload.php, includes/SettingsEdit.php, index.php, readme.txt, scripts/functions.imgmap.admin.js, scripts/functions.imgmappin.admin.js
Commit date: 2015-07-06 07:29:33 +0000
Commit message: tested up to v 4.2.2 and SQL vulnerability plugged

git-svn-id: https://plugins.svn.wordpress.org/easy2map-photos/trunk@1193098 b8457f37-d9ea-0310-8a92-e5e31aec5664

Diff: diff --git a/css/mapadmin.css b/css/mapadmin.css
index 825dd83..06ca970 100644
--- a/css/mapadmin.css
+++ b/css/mapadmin.css
@@ -43,11 +43,11 @@ td .highlighted{
     color: #fff !important;
     text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.29);
     -webkit-font-smoothing: antialiased;
 }
 
-#easy2mapslidertext {display:none;text-align:center;color:#FFFFFF;font-family:Arial, Helvetica, sans-serif;font-size:0.9em;position:absolute;width:100%;top:15px;font-weight:bold;z-index:999;border-color:transparent;border-radius:0px;border-style:solid;border-width:1px;text-shadow:#171717 0.1em 0.1em 0.1em;background-color:transparent;white-space:nowrap;}
+#easy2mapslidertext {display:none;text-align:center;position:absolute;width:100%;top:15px;z-index:999;border-color:transparent;border-radius:0px;border-style:solid;border-width:1px;text-shadow:#171717 0.1em 0.1em 0.1em;background-color:transparent;white-space:nowrap;}
 #easy2mapslider .easy2mapholder_cont {width: 100%; margin: 0 auto; overflow: hidden;  height:60px;}
 #easy2mapslider .easy2mapholder { vertical-align:middle; margin-left: 43px; margin-right: 37px; background-image: url("<?php echo easy2mapimg_get_plugin_url('/images/bg_grey.png') ?>"); background-repeat: repeat; }
 #easy2mapslider .easy2mapslide {cursor:pointer; vertical-align:middle; margin-top:auto;margin-bottom:auto;position: relative; margin-right: 8px; float:left; min-width: 60px; height: 60px;}
 #easy2mapslider .easy2mapbutton {position: absolute;}
 #easy2mapslider .easy2mapprev {top: 25px; margin-left:3px;left:5px;}
diff --git a/includes/CSSEditHTML.html b/includes/CSSEditHTML.html
index 877790e..30508a7 100644
--- a/includes/CSSEditHTML.html
+++ b/includes/CSSEditHTML.html
@@ -18,10 +18,51 @@
         <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
         <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
     </div>
 </div>
 
+<div id="div_edit_textalign" style="width:600px;" 
+     class="modal hide fade" tabindex="-1" 
+     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+        <h3>Alter Style Value</h3>
+    </div>
+    <div class="modal-body" style="max-height: 300px">
+        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_textalign" name="txtDefaultValue_textalign">
+            <option value="left">Left</option>
+            <option value="center">Center</option> 
+            <option value="right">Right</option>
+        </select> 
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
+    </div>
+</div>
+
+<div id="div_edit_fontweight" style="width:600px;" 
+     class="modal hide fade" tabindex="-1" 
+     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+        <h3>Alter Style Value</h3>
+    </div>
+    <div class="modal-body" style="max-height: 300px;font-w">
+        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_fontweight" name="txtDefaultValue_fontweight">
+            <option value="normal">Normal</option>
+            <option value="bold">Bold</option> 
+            <option value="bolder">Bolder</option>
+            <option value="lighter">Lighter</option>
+        </select> 
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
+    </div>
+</div>
+
 <div id="div_edit_pixel" style="width:600px" 
      class="modal hide fade" tabindex="-1" 
      role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
     <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
@@ -87,10 +128,105 @@
         <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
         <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
     </div>
 </div>
 
+<div id="div_edit_em" style="width:600px" 
+     class="modal hide fade" tabindex="-1" 
+     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+        <h3>Alter Style Value</h3>
+    </div>
+    <div class="modal-body" style="max-height: 300px">
+        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_em" name="txtDefaultValue_em">
+            <option value="0.1em">0.1em</option>
+            <option value="0.15em">0.15em</option>
+            <option value="0.2em">0.2em</option>
+            <option value="0.25em">0.25em</option>
+            <option value="0.3em">0.3em</option>
+            <option value="0.35em">0.35em</option>
+            <option value="0.4em">0.4em</option>
+            <option value="0.45em">0.45em</option>
+            <option value="0.5em">0.5em</option>
+            <option value="0.55em">0.55em</option>
+            <option value="0.6em">0.6em</option> 
+            <option value="0.65em">0.65em</option>
+            <option value="0.7em">0.7em</option>
+            <option value="0.75em">0.75em</option>
+            <option value="0.8em">0.8em</option>
+            <option value="0.85em">0.85em</option>
+            <option value="0.9em">0.9em</option>
+            <option value="0.95em">0.95em</option>
+            <option value="1.0em">1.0em</option>
+            <option value="1.05em">1.05em</option>
+            <option value="1.1em">1.1em</option>
+            <option value="1.15em">1.15em</option>
+            <option value="1.2em">1.2em</option>
+            <option value="1.25em">1.25em</option>
+            <option value="1.3em">1.3em</option>
+            <option value="1.35em">1.35em</option>
+            <option value="1.4em">1.4em</option>
+            <option value="1.45em">1.45em</option>
+            <option value="1.5em">1.5em</option>
+            <option value="1.55em">1.55em</option>
+            <option value="1.6em">1.6em</option> 
+            <option value="1.65em">1.65em</option>
+            <option value="1.7em">1.7em</option>
+            <option value="1.75em">1.75em</option>
+            <option value="1.8em">1.8em</option>
+            <option value="1.85em">1.85em</option>
+            <option value="1.9em">1.9em</option>
+            <option value="1.95em">1.95em</option>
+            <option value="2.0em">2.0em</option>
+            <option value="2.1em">2.1em</option>
+            <option value="2.2em">2.2em</option>
+            <option value="2.3em">2.3em</option>
+            <option value="2.4em">2.4em</option>
+            <option value="2.5em">2.5em</option>
+            <option value="2.6em">2.6em</option> 
+            <option value="2.7em">2.7em</option>
+            <option value="2.8em">2.8em</option>
+            <option value="2.9em">2.9em</option>
+            <option value="3.0em">3.0em</option>
+        </select> 
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
+    </div>
+</div>
+
+<div id="div_edit_fontfamily" style="width:600px" 
+     class="modal hide fade" tabindex="-1" 
+     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+        <h3>Alter Style Value</h3>
+    </div>
+    <div class="modal-body" style="max-height: 300px">
+        <select class="Heading3" style="width:300px;height:28px" id="txtDefaultValue_fontfamily" name="txtDefaultValue_fontfamily">
+            <option value="Georgia, serif">Georgia, serif</option>
+            <option value='Palatino, serif'>Palatino, serif</option> 
+            <option value='Times, serif'>Times, serif</option>
+            <option value='Arial, Helvetica, sans-serif'>Arial, Helvetica, sans-serif</option>
+            <option value="Gadget, sans-serif">Gadget, sans-serif</option>
+            <option value="cursive, sans-serif">cursive, sans-serif</option>
+            <option value="Impact, Charcoal, sans-serif">Impact, Charcoal, sans-serif</option>
+            <option value="Tahoma, Geneva, sans-serif">Tahoma, Geneva, sans-serif</option>
+            <option value="Helvetica, sans-serif">Helvetica, sans-serif</option>
+            <option value="Verdana, Geneva, sans-serif">Verdana, Geneva, sans-serif</option>
+            <option value="Courier, monospace">Courier, monospace</option>
+            <option value="Monaco, monospace">Monaco, monospace</option>
+        </select> 
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
+    </div>
+</div>
+
 <div id="div_edit_style" style="width:600px" 
      class="modal hide fade" tabindex="-1" 
      role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
     <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
diff --git a/includes/Easy2MapImg.php b/includes/Easy2MapImg.php
index c05df11..4f49c14 100644
--- a/includes/Easy2MapImg.php
+++ b/includes/Easy2MapImg.php
@@ -3,14 +3,14 @@
 class Easy2MapImg {
 
     const plugin_name = 'Easy2MapImg';
     const min_php_version = '5.0';
     const min_wp_version = '3.0';
-
     // Used to uniquely identify this plugin's menu page in the WP manager
     const admin_menu_slug = 'easy2mapimg';
 
+    //MERCURIAL COMMIT TEST 2
     /** Adds the necessary JavaScript and/or CSS to the pages to enable the Ajax search. */
     public static function head() {
 
         $src_Easy2MapImgAPI = "http://maps.google.com/maps/api/js?sensor=true";
         $src_Easy2MapImg = plugins_url('scripts/easy2mapimg.js', dirname(__FILE__));
@@ -191,11 +191,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map On Bottom', '', 1,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-bottom-width:0px;top:0px;left:0px;min-width:10px;margin-bottom:0px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><a class=\"easy2maplogo\" id=\"easy2mapphotologo\" target=\"_blank\" href=\"http://easy2map.com\"><img src=\"[siteurl]images/e2mlogosmall.png\"></a><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr><tr><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"border-top-width:0px;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;background-color:transparent;position:relative;\"></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert3)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -213,11 +213,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map On Top', '', 2,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"background-color:transparent;border-style:solid;border-width:1px;border-bottom-width:0px;border-color:transparent;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"></div></td></tr><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-top-width:0px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:0px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert4)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -235,11 +235,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map On Left', '', 3,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings width=\"150px\" height=\"390px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"background-color:transparent;border-style:solid;border-width:1px;border-right-width:0px;border-color:transparent;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:0px;margin-top:5px;position:relative;\"></div></td><td style=\"width:100%;\"><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-left-width:0px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert5)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -257,11 +257,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map On Right', '', 4,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings width=\"150px\" height=\"390px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td style=\"width:100%;\"><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-right-width:0px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"background-color:transparent;border-style:solid;border-width:1px;border-left-width:0px;border-color:transparent;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-right:5px;margin-left:0px;margin-top:5px;position:relative;\"></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert6)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -279,11 +279,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Top Left - Style 1', '', 5,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"none\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" margin-left=\"0px\" margin-top=\"0px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;top:0px;left:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert7)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -301,11 +301,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Top Right - Style 1', '', 6,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"none\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" margin-right=\"0px\" margin-top=\"0px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;top:0px;right:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert8)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -323,11 +323,11 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Bottom Left - Style 1', '', 7,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"none\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" margin-left=\"0px\" margin-bottom=\"0px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;bottom:0px;left:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert9)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
@@ -345,19 +345,19 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Bottom Right - Style 1', '', 8,
             '<settings background-color=\"#FFFFFF\" border-style=\"solid\" border-width=\"1px\" border-color=\"#EBEBEB\" margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"none\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#faf9f9\" margin-right=\"0px\" margin-bottom=\"0px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;bottom:0px;right:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert10)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
                 return;
             }
-            
+
             $SQLInsert11 = "INSERT INTO `$map_templates_table`
             (`TemplateName`,
             `ExampleImage`,
             `DisplayOrder`,
             `CSSValues`,
@@ -367,21 +367,21 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Top Left - Style 2', '', 9,
             '<settings margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"-4px -4px 2px #888888\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#272727\" margin-left=\"-15px\" margin-top=\"-15px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:transparent;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;top:0px;left:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert11)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
                 return;
             }
-            
-            
-            
+
+
+
             $SQLInsert12 = "INSERT INTO `$map_templates_table`
             (`TemplateName`,
             `ExampleImage`,
             `DisplayOrder`,
             `CSSValues`,
@@ -391,19 +391,19 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Top Right - Style 2', '', 10,
             '<settings margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"4px -4px 2px #888888\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#272727\" margin-right=\"-15px\" margin-top=\"-15px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:transparent;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;top:0px;right:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert12)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
                 return;
             }
-            
+
             $SQLInsert13 = "INSERT INTO `$map_templates_table`
             (`TemplateName`,
             `ExampleImage`,
             `DisplayOrder`,
             `CSSValues`,
@@ -413,19 +413,19 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Bottom Left - Style 2', '', 11,
             '<settings margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"-4px 4px 2px #888888\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#272727\" margin-left=\"-15px\" margin-bottom=\"-15px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:transparent;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;bottom:0px;left:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert13)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
                 return;
             }
-            
+
             $SQLInsert14 = "INSERT INTO `$map_templates_table`
             (`TemplateName`,
             `ExampleImage`,
             `DisplayOrder`,
             `CSSValues`,
@@ -435,33 +435,30 @@ class Easy2MapImg {
             `Active`
             )
             VALUES
             ('Map In Photo On Bottom Right - Style 2', '', 12,
             '<settings margin-left=\"auto\" margin-right=\"auto\" />',
-            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
+            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
             '<settings box-shadow=\"4px 4px 2px #888888\" width=\"120px\" height=\"120px\" border-radius=\"0px\" border-style=\"solid\" border-width=\"1px\" border-color=\"#272727\" margin-right=\"-15px\" margin-bottom=\"-15px\" />',
             '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-color:transparent;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;position:relative;\"><div id=\"divMap\" style=\"position:absolute;background-color:transparent;border-style:solid;border-width:1px;border-color:transparent;bottom:0px;right:0px;min-width:10px;\"></div><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>', 1)";
 
             if (!$wpdb->query($SQLInsert14)) {
                 echo sprintf($error, __("Could not add data to easy2map templates table.", 'easy2mapimg'));
                 return;
             }
-            
-             $SQLInsert15 = "UPDATE `$map_templates_table`
+
+            $SQLInsert15 = "UPDATE `$map_templates_table`
              SET `TemplateHTML` = '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"background-color:transparent;border-style:solid;border-width:1px;border-right-width:0px;border-color:transparent;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:0px;margin-top:5px;position:relative;\"></div></td><td style=\"width:100%;\"><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-left-width:0px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td></tr></table></div>'
              WHERE `TemplateName` = 'Map On Left'";
-             
-             $wpdb->query($SQLInsert15);
-             
-             $SQLInsert16 = "UPDATE `$map_templates_table`
+
+            $wpdb->query($SQLInsert15);
+
+            $SQLInsert16 = "UPDATE `$map_templates_table`
              SET `TemplateHTML` = '<div style=\"margin:auto;\"><table cellpadding=\"1\" cellspacing=\"1\" id=\"divMapParent\"><tr><td style=\"width:100%;\"><div align=\"center\" id=\"easy2mapmainimage\" style=\"text-align:center;border-style:solid;border-width:1px;border-right-width:0px;border-color:#FFFFFF;background-color:#FFFFFF;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-left:5px;margin-right:5px;margin-top:5px;position:relative;\"><div align=\"center\" id=\"easy2mapslidertext\"></div><div id=\"easy2mapslider\"><a class=\"easy2mapbutton easy2mapprev\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/prev.png\"></a><a class=\"easy2mapbutton easy2mapnext\" href=\"#\" rel=\"nofollow\"><img src=\"[siteurl]images/next.png\"></a><div class=\"easy2mapholder_cont\"><ul id=\"Easy2MapSliderParent\" class=\"easy2mapholder\"></ul></div><div class=\"easy2mapclear\"></div></div></div></td><td id=\"tdMap\" style=\"border-width:0px;vertical-align:top;\"><div id=\"divMap\" style=\"background-color:transparent;border-style:solid;border-width:1px;border-left-width:0px;border-color:transparent;top:0px;left:0px;min-width:10px;margin-bottom:5px;margin-right:5px;margin-left:0px;margin-top:5px;position:relative;\"></div></td></tr></table></div>'
              WHERE `TemplateName` = 'Map On Right'";
-             
-             $wpdb->query($SQLInsert16);
 
-            
-            
+            $wpdb->query($SQLInsert16);
         }
     }
 
     /**     * Create custom post-type menu */
     public static function create_admin_menu() {
@@ -505,27 +502,30 @@ class Easy2MapImg {
             //include('MapAdminister.php');
             include('MapAdmin.php');
         } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "mappiniconsave") == 0 && isset($_GET["map_id"])) {
             include('MapPinIconSave.php');
         } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "copymapsettings") == 0 && isset($_GET["map_id"])) {
-            include('CopyMapSettings.php');    
+            include('CopyMapSettings.php');
         } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "mappinimageupload") == 0 && isset($_GET["map_id"])) {
             include('MapPinImageUpload.php');
         } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "mappreview") == 0 && isset($_GET["map_id"])) {
             include('MapPreview.php');
-        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "activation") == 0) {
-            include('Validation.php');
+        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "copymapsettings") == 0 && isset($_GET["map_id"])) {
+            include('CopyMapSettings.php');
+        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "photoimport") == 0 && isset($_GET["map_id"])) {
+            include('ZipPhotoImport.php');
         } else {
             include('ImageMapManager.php');
         }
     }
 
     /** Validation fucntion */
     private static function easy2MapPhotoCodeValidator($code) {
-        
-        if (strlen($code) == "") $code = get_option('phe_171323_transient_17666766');
-        
+
+        if (strlen($code) == "")
+            $code = get_option('phe_171323_transient_17666766');
+
         //code validator
         $validation = true;
         $string = substr($code, 32, -32);
         $pie_1 = substr($code, 0, 32);
         $pie_2 = substr($code, -32, 32);
diff --git a/includes/Functions.php b/includes/Functions.php
index faeae14..7ce5db5 100644
--- a/includes/Functions.php
+++ b/includes/Functions.php
@@ -43,11 +43,11 @@ if (!function_exists('easy2mapimg_e2m_img_e2m_img_save_map_polylines_callback'))
         global $wpdb;
         $mapsTable = $wpdb->prefix . "easy2mapimg_maps";
         $mapID = $_REQUEST["mapID"];
         $PolyLines = urldecode($_REQUEST['PolyLines']);
 
-        $wpdb->query(sprintf("UPDATE $mapsTable
+        $wpdb->query($wpdb->prepare("UPDATE $mapsTable
         SET PolyLines = '%s'
         WHERE ID = '%s';", $PolyLines, $mapID));
 
         echo json_encode("");
         die;
@@ -213,11 +213,11 @@ if (!function_exists('easy2mapimg_e2m_img_save_map')):
         $mapsTable = $wpdb->prefix . "easy2mapimg_maps";
 
         if (intval($mapID) != 0) {
 
             //this is a map update
-            $wpdb->query(sprintf("
+            $wpdb->query($wpdb->prepare("
                 UPDATE $mapsTable
                 SET TemplateID = '%s',
                     MapName = '%s',
                     Settings = '%s',
                     CSSValues = '%s',
@@ -226,19 +226,19 @@ if (!function_exists('easy2mapimg_e2m_img_save_map')):
                     MapHTML = '%s',
                     IsActive = 1
                 WHERE ID = %s;", 
                     $_REQUEST['mapTemplateName'], 
                     $_REQUEST['mapName'], 
-                    urldecode($_REQUEST['mapSettingsXML']), 
-                    urldecode($_REQUEST["parentCSSXML"]),
-                    urldecode($_REQUEST["photoCSSXML"]), 
-                    urldecode($_REQUEST["mapCSSXML"]), 
-                    urldecode($_REQUEST["mapHTML"]), $mapID));
+                    stripcslashes(urldecode($_REQUEST['mapSettingsXML'])), 
+                    stripcslashes(urldecode($_REQUEST["parentCSSXML"])),
+                    stripcslashes(urldecode($_REQUEST["photoCSSXML"])), 
+                    stripcslashes(urldecode($_REQUEST["mapCSSXML"])), 
+                    stripcslashes(urldecode($_REQUEST["mapHTML"])), $mapID));
         } else {
 
             //this is a map insert
-            if (!$wpdb->query(sprintf("
+            if (!$wpdb->query($wpdb->prepare("
             INSERT INTO $mapsTable(
                 TemplateID,
                 MapName,
                 DefaultPinImage,
                 Settings,
@@ -251,16 +251,16 @@ if (!function_exists('easy2mapimg_e2m_img_save_map')):
                 IsActive
             ) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0);", 
                     $_REQUEST['mapTemplateName'], 
                     $_REQUEST['mapName'], 
                     str_replace('index.php', '', easy2mapimg_get_plugin_url('/index.php')) . "images/map_pins/pins/111.png",
-                    urldecode($_REQUEST['mapSettingsXML']), 
+                    stripcslashes(urldecode($_REQUEST['mapSettingsXML'])), 
                     getdate(), '', 
-                    urldecode($_REQUEST["parentCSSXML"]), 
-                    urldecode($_REQUEST["photoCSSXML"]), 
-                    urldecode($_REQUEST["mapCSSXML"]), 
-                    urldecode($_REQUEST["mapHTML"])))) {
+                    stripcslashes(urldecode($_REQUEST["parentCSSXML"])), 
+                    stripcslashes(urldecode($_REQUEST["photoCSSXML"])), 
+                    stripcslashes(urldecode($_REQUEST["mapCSSXML"])), 
+                    stripcslashes(urldecode($_REQUEST["mapHTML"]))))) {
                 die("Error!");
             }
 
             $newRow = $wpdb->get_results("SELECT LAST_INSERT_ID() AS NewMapID;");
 
@@ -326,11 +326,11 @@ if (!function_exists('easy2mapimg_e2m_img_save_map_name')):
 
         global $wpdb;
         $mapID = $_REQUEST["mapID"];
         $mapsTable = $wpdb->prefix . "easy2mapimg_maps";
         
-        $wpdb->query(sprintf("
+        $wpdb->query($wpdb->prepare("
             UPDATE $mapsTable
             SET MapName = '%s'
             IsActive = 1
             WHERE ID = %s;", 
                 $_REQUEST['mapName'], 
diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php
index 4e34620..14d17b1 100644
--- a/includes/ImageFunctions.php
+++ b/includes/ImageFunctions.php
@@ -113,6 +113,74 @@ function getExtension($str) {
     $l = strlen($str) - $i;
     $ext = substr($str, $i + 1, $l);
     return $ext;
 }
 
+function extractLocationFromImageExif($uploadedFile) {
+
+    $arrImage = array();
+    $arrResult = array(0, 0);
+    $lat = 0;
+    $lng = 0;
+
+    try {
+
+        if (extension_loaded('exif')) {
+            $arrImage = exif_read_data($uploadedFile, 0, true);
+        }
+
+        if (isset($arrImage['GPS'])) {
+
+            $GPS = $arrImage['GPS'];
+
+            if (isset($GPS['GPSLatitudeRef']) && isset($GPS['GPSLatitude'])) {
+
+                //LATITUDE
+                $LatitudeRef = $GPS['GPSLatitudeRef'];
+                $Latitude = $GPS['GPSLatitude'];
+
+                $arrLatDegrees = explode("/", $Latitude[0]);
+                $arrLatMinutes = explode("/", $Latitude[1]);
+                $arrLatSeconds = explode("/", $Latitude[2]);
+
+                $latDegrees = floatval($arrLatDegrees[0] / $arrLatDegrees[1]);
+                $latMinutes = floatval($arrLatMinutes[0] / $arrLatMinutes[1]);
+                $latSeconds = floatval($arrLatSeconds[0] / $arrLatSeconds[1]);
+
+                //LONGITUDE
+                $LongitudeRef = $GPS['GPSLongitudeRef'];
+                $Longitude = $GPS['GPSLongitude'];
+
+                $arrLngDegrees = explode("/", $Longitude[0]);
+                $arrLngMinutes = explode("/", $Longitude[1]);
+                $arrLngSeconds = explode("/", $Longitude[2]);
+
+                $lngDegrees = floatval($arrLngDegrees[0] / $arrLngDegrees[1]);
+                $lngMinutes = floatval($arrLngMinutes[0] / $arrLngMinutes[1]);
+                $lngSeconds = floatval($arrLngSeconds[0] / $arrLngSeconds[1]);
+
+                $lat = DMStoDEC($latDegrees, $latMinutes, $latSeconds);
+                if (strcasecmp($LatitudeRef, "S") === 0)
+                    $lat = -1 * $lat;
+
+                $lng = DMStoDEC($lngDegrees, $lngMinutes, $lngSeconds);
+                if (strcasecmp($LongitudeRef, "W") === 0)
+                    $lng = -1 * $lng;
+            }
+        }
+    } catch (Exception $e) {
+        
+    }
+
+    $arrResult = array($lat, $lng);
+    return $arrResult;
+}
+
+function DMStoDEC($deg, $min, $sec) {
+
+// Converts DMS ( Degrees / minutes / seconds ) 
+// to decimal format longitude / latitude
+
+    return $deg + ((($min * 60) + ($sec)) / 3600);
+}
+
 ?>
\ No newline at end of file
diff --git a/includes/MapAdmin.php b/includes/MapAdmin.php
index 1cb47a4..3ebcf2b 100644
--- a/includes/MapAdmin.php
+++ b/includes/MapAdmin.php
@@ -55,11 +55,11 @@ $mapID = $_REQUEST["map_id"];
             "link": true, //Button to insert a link. Default true'
             "html": true, //Button which allows you to edit the generated HTML. Default false
             "image": false, //Button to insert an image. Default true,
             "color": true //Button to change color of font  
         });
-        
+
         jQuery('.fileupload').fileupload();
         notBusy();
 
         jQuery('#colourpicker').colorpicker().on('changeColor', function(ev) {
             document.getElementById('txtDefaultValue_color').style.backgroundColor = ev.color.toHex();
@@ -183,13 +183,13 @@ $mapID = $_REQUEST["map_id"];
                                id="mapName" value="" maxlength="128"
                                type="text" placeholder="Give your map a name" 
                                class="input-large" style="display:none;width:300px;margin-bottom:-6px" />
 
                         <!---<?php if (!isset($_REQUEST["no_back"])) { ?>
-                                                                                                        <button onclick="window.location='?page=easy2mapimg&action=viewMaps'" type="button" 
-                                                                                                                style="margin-left:30px;width:100px;" 
-                                                                                                                class="btn">Back</button> 
+                                                                                                                <button onclick="window.location='?page=easy2mapimg&action=viewMaps'" type="button" 
+                                                                                                                        style="margin-left:30px;width:100px;" 
+                                                                                                                        class="btn">Back</button> 
                         <?php } ?>--->
 
                 </td>
                 <td nowrap align="center" id="TitleMapSize" style="text-align:center;width:50%;font-size:15px;">
 
@@ -258,10 +258,19 @@ $mapID = $_REQUEST["map_id"];
                                         </td></tr>
 
                                     <tr id="pinImageParent" style="display:none;"><td align="center" style="text-align:center" colspan="2">
                                             <img id="pinImagePreview">
                                         </td></tr>
+                                    
+                                    
+                                    <tr id="zipUpload" style="display:none;"><td align="center" style="text-align:center" colspan="2">
+                                        
+                                        
+                                        <h5><a href="#" onclick="document.formPhotoImport.photoSize.value=document.formAddPinImage.photoSize.value;jQuery('#mapZipImport').modal();">Upload  Zip File of Geotagged Images</a></h5>
+                                        
+                                        
+                                    </tr>
 
                                 <!---<tr id="pinNameParent" style="display:none;"><td colspan="2">
 
                                         <h5 style="margin-top:0px;">Image Title</h5>
 
@@ -356,11 +365,11 @@ $mapID = $_REQUEST["map_id"];
 <form name="formCopymapSettings" 
       id="formCopymapSettings"
       action="?page=easy2mapimg&action=copymapsettings&map_id=<?php echo $mapID; ?>"
       method="post">
     <input type="hidden" name="CopyMapID" id="CopyMapID">
-</form>                    
+</form>
 
 <form name="formAddPinIcon" 
       target="frameAddPinIcon" 
       enctype="multipart/form-data" 
       id="formAddPinIcon"
@@ -432,10 +441,125 @@ $mapID = $_REQUEST["map_id"];
     <div class="modal-footer">
         <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
     </div>
 </div>
 
+<form name="formPhotoImport" 
+      enctype="multipart/form-data"
+      target="frameAddPinIcon" 
+      id="formPhotoImport"
+      onsubmit="return easy2map_imgmappin_functions.uploadZippedFile();"
+      action="?page=easy2mapimg&action=photoimport&map_id=<?php echo $mapID; ?>"
+      method="post">
+    
+    
+
+    <div id="mapZipImport" style="width:600px" 
+         class="modal hide fade" tabindex="-1" 
+         role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+        <div class="modal-header">
+            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+            <h3>Upload Zip File of Geotagged Images</h3>
+        </div>
+        <div class="modal-body" style="max-height: 400px">
+
+            <input type="hidden" name="photoSize" value="<?php echo $_REQUEST["photoSize"]; ?>" />
+
+            <table style="background-color:#EBEBEB;width:60%;margin-left:auto;margin-right:auto;margin-top:10px;" cellspacing="3" cellpadding="3" class="table table-bordered">
+                <tr>
+                    <td class="instructions"><h5>Note: only geotagged images will be uploaded</h5>
+                    </td>
+                </tr>
+
+                <tr><td align="center" style="text-align:center">
+
+                        <h5><input type='file' name='zipfile' 
+                                   id='zipfile' 
+                                   size='30' style="width:300px;vertical-align:middle;"
+                                   acceptedFileList='ZIP'
+                                   accept='zip/*'></h5>
+                        <h6><i>(Only Valid ZIP Files Accepted)</i></h6>
+                    </td></tr>
+            </table>
+
+        </div>
+        <div class="modal-footer">
+            <button class="btn btn-primary" data-dismiss="modal" 
+                    onclick="document.formPhotoImport.submit();"
+                    aria-hidden="true">Upload Zip File</button>
+
+        </div>
+    </div>
+
+</form>
+
+
+
+
+
+
+<form name="formAddPinIcon" 
+      target="frameAddPinIcon" 
+      enctype="multipart/form-data" 
+      id="formAddPinIcon"
+      action="?page=easy2mapimg&action=mappiniconsave&map_id=<?php echo $mapID; ?>"
+      method="post">
+
+    <div id="mapPinIconList" style="width:600px" 
+         class="modal hide fade" tabindex="-1" 
+         role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
+        <div class="modal-header">
+            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+            <h3>My map icons</h3>
+        </div>
+        <div class="modal-body" style="max-height: 400px">
+            <h5>                
+                <?php if (self::easy2MapPhotoCodeValidator('') === false) { ?>
+                    <i>(Please upgrade to the Pro Version to upload your own custom icons)</i>
+                    <br><br>
+                <?php } else { ?>  
+                    Upload own icon: 
+                    <input type='file' name='pinicon' 
+                           id='pinicon' 
+                           size='30' style="width:300px;vertical-align:middle;"
+                           acceptedFileList='JPG;JPEG;PJPEG;GIF;PNG;X-PNG'
+                           accept='image/*'></h5>
+                <h6><i>Valid image files accepted (.jpg, .png, .gif) with a maximum file size of 5MB.</i></h6>
+            <?php } ?>
+            <table style="width:96%" 
+                   cellpadding="4" 
+                   cellspacing="4" id="tblPinImages"></table>
+        </div>
+        <div class="modal-footer">
+            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+            <?php if (self::easy2MapPhotoCodeValidator('') === true) { ?><button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmappin_functions.uploadPinIcon()" aria-hidden="true">Upload Icon</button><?php } ?>
+        </div>
+    </div> 
+
+</form>
+                    
+<form name="formRefresh" 
+      id="formRefresh"
+      action="?page=easy2mapimg&action=edit&map_id=<?php echo $mapID; ?>"
+      method="post">                    
+<div id="popupModalZipImport" class="modal fade">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                    <h4 class="modal-title">Zip File Upload Result</h4>
+                </div>
+                <div class="modal-body">
+                    <p style="font-size:1.5em;font-weight:bold;" id="resultMessage"></p>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" onclick="document.formRefresh.submit();" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div><!-- /.modal-content -->
+        </div><!-- /.modal-dialog -->
+    </div><!-- /.modal -->
+</form>
 
 <iframe name="frameAddPinIcon" 
         id="frameAddPinIcon" 
         width="98%" height="98%" 
         frameborder="0" style="display:none;margin:auto;" 
diff --git a/includes/MapPinImageUpload.php b/includes/MapPinImageUpload.php
index f8da5b6..90601ae 100644
--- a/includes/MapPinImageUpload.php
+++ b/includes/MapPinImageUpload.php
@@ -1,10 +1,12 @@
 <?php
 include 'ImageFunctions.php';
 
 $imagesDirectory = WP_CONTENT_DIR . "/uploads/easy2map/images/pin_content/" . $_GET["map_id"] . "/";
 
+var_dump($_REQUEST);
+
 if (is_uploaded_file($_FILES["pinimage"]['tmp_name'])) {
 
     if (!file_exists($imagesDirectory)) {
         mkdir($imagesDirectory);
     }
@@ -13,57 +15,20 @@ if (is_uploaded_file($_FILES["pinimage"]['tmp_name'])) {
     
     $uploadedFile = $_FILES["pinimage"]['tmp_name'];
     $extension = strtolower(getExtension($imageName));
 
     list($width, $height, $type, $attr) = getimagesize($uploadedFile);
-    
-    $arrImage = array();
-    if (extension_loaded('exif')) {
-        $arrImage = exif_read_data($uploadedFile, 0, true);
-    }
-    
+    $arrLatLng = extractLocationFromImageExif($uploadedFile);
     $lat = 0;
     $lng = 0;
     
-    if (isset($arrImage['GPS'])){
-    
-        $GPS = $arrImage['GPS'];
-        
-        if (isset($GPS['GPSLatitudeRef']) && isset($GPS['GPSLatitude'])){
-
-            //LATITUDE
-            $LatitudeRef = $GPS['GPSLatitudeRef'];
-            $Latitude = $GPS['GPSLatitude'];
-            
-            $arrLatDegrees = explode("/", $Latitude[0]);
-            $arrLatMinutes = explode("/", $Latitude[1]);
-            $arrLatSeconds = explode("/", $Latitude[2]);
-            
-            $latDegrees = floatval($arrLatDegrees[0] / $arrLatDegrees[1]);
-            $latMinutes = floatval($arrLatMinutes[0] / $arrLatMinutes[1]);
-            $latSeconds = floatval($arrLatSeconds[0] / $arrLatSeconds[1]);
-            
-            echo $latDegrees . '|' . $latMinutes . '|' . $latSeconds . '|';
-
-            //LONGITUDE
-            $LongitudeRef = $GPS['GPSLongitudeRef'];
-            $Longitude = $GPS['GPSLongitude'];
-            
-            $arrLngDegrees = explode("/", $Longitude[0]);
-            $arrLngMinutes = explode("/", $Longitude[1]);
-            $arrLngSeconds = explode("/", $Longitude[2]);
-            
-            $lngDegrees = floatval($arrLngDegrees[0] / $arrLngDegrees[1]);
-            $lngMinutes = floatval($arrLngMinutes[0] / $arrLngMinutes[1]);
-            $lngSeconds = floatval($arrLngSeconds[0] / $arrLngSeconds[1]);
-
-            $lat = DMStoDEC($latDegrees,$latMinutes,$latSeconds);
-            if (strcasecmp($LatitudeRef, "S") === 0) $lat = -1 * $lat;
-
-            $lng = DMStoDEC($lngDegrees,$lngMinutes,$lngSeconds);
-            if (strcasecmp($LongitudeRef, "W") === 0) $lng = -1 * $lng;
-        }
+    if (is_array($arrLatLng) && count($arrLatLng) == 2
+            && is_numeric($arrLatLng[0])
+            && is_numeric($arrLatLng[1]))
+    {
+        $lat = $arrLatLng[0];
+        $lng = $arrLatLng[1];
     }
     
     echo $lat . '<br>' . $lng;
         
     $imageNameExplode = explode(".", $imageName);
@@ -81,18 +46,11 @@ if (is_uploaded_file($_FILES["pinimage"]['tmp_name'])) {
         $imagePlusLocation_Large = WP_CONTENT_URL . "/uploads/easy2map/images/pin_content/" . $_GET["map_id"] . "/" . $arrLargeImage[0];
         
     }
 }
 
-function DMStoDEC($deg,$min,$sec)
-{
-
-// Converts DMS ( Degrees / minutes / seconds ) 
-// to decimal format longitude / latitude
 
-    return $deg+((($min*60)+($sec))/3600);
-} 
 
 ?>
 
 <script type="text/javascript">
 
diff --git a/includes/SettingsEdit.php b/includes/SettingsEdit.php
index 9787f14..9171618 100644
--- a/includes/SettingsEdit.php
+++ b/includes/SettingsEdit.php
@@ -36,6 +36,7 @@ if (isset($activeMaps) && count($activeMaps) > 0) {
     foreach ($activeMaps as $activeMap) {
         echo '<option value="' . $activeMap->ID . '">' . $activeMap->MapName . '</option>';
     }
     echo '</select></td></tr><tr><td style="text-align:center"><button onclick="easy2map_imgmap_functions.copyMapSettings()" class="btn" data-dismiss="modal" aria-hidden="true">Copy Map Settings</button></td></tr></table>';
 }
+   
 ?>
\ No newline at end of file
diff --git a/index.php b/index.php
index 1dcafe7..d5fc729 100644
--- a/index.php
+++ b/index.php
@@ -3,11 +3,11 @@
 /* 
   Plugin Name: Easy2Map Photos
   URI: http://easy2map.com/ 
   Description: The easiest tool available for creating geo-tagged photo galleries. Display photos & their geographic location in a great-looking slider gallery.
   Author: Steven Ellis 
-  Version: 1.0.9 
+  Version: 1.1.0 
   Author URI: http://easy2map.com/ 
  */
 
 $e2m_image_function_names_used = array('easy2mapimg_retrieve_map_pins_callback',
 'easy2mapimg_e2m_img_e2m_img_save_map_polylines_callback',
diff --git a/readme.txt b/readme.txt
index 0a4fc85..2d0aaa7 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,12 +1,12 @@
 === Easy2Map Photos ===
 Plugin Name: Easy2Map Photos
 Contributors: stevenellis
 Tags: photo maps, image maps, image map, geo, map images, map photos, google maps, map plugins, mapping plugins, maps, mapping, mapper, blog maps, blogging maps, travel maps, plugin, posts, post, page, coordinates, latitude, longitude, geocoding, geotag images, geotag photos, image slider, photo slider, image gallery, photo gallery
 Requires at least: 3.0.1
-Tested up to: 3.6.1
-Stable tag: 1.0.9
+Tested up to: 4.4.2
+Stable tag: 1.1.0
 License: GPLv2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
 The easiest tool available for creating geo-tagged photo galleries. Display photos & their geographic location in a great-looking slider gallery
 
@@ -95,10 +95,14 @@ Yes, width of photos can be made as percentage or pixel value.
 
  = 1.0.9 = 
 * Enhanced file upload control
 * Various fixes and enhancements
 
+= 1.1.0 = 
+* Plugin made WP 4.2.2 compliant
+* SQL injection vulnerabilities plugged
+
 == Upgrade Notice ==
 
 = 1.0.1 =
 * Plugin uploaded to WordPress
 
@@ -110,6 +114,10 @@ Yes, width of photos can be made as percentage or pixel value.
 * Background color removed from maps' CSS (causes issues in some browsers)
 * Photo maps made responsive
 
  = 1.0.9 = 
 * Enhanced file upload control
-* Various fixes and enhancements
\ No newline at end of file
+* Various fixes and enhancements
+
+= 1.1.0 = 
+* Plugin made WP 4.2.2 compliant
+* SQL injection vulnerabilities plugged
diff --git a/scripts/functions.imgmap.admin.js b/scripts/functions.imgmap.admin.js
index 1983600..8899cb7 100644
--- a/scripts/functions.imgmap.admin.js
+++ b/scripts/functions.imgmap.admin.js
@@ -9,60 +9,60 @@ var easy2map_imgmap_functions = (function() {
         return item;
     },
             //refresh the example map
             refreshExampleMap = function(saveMapToDatabase) {
 
-        var templateID = parseInt(jQuery("#MapTemplateName").val());
-        var proVersion = !!jQuery("#photoSize").attr("proVersion");
+                var templateID = parseInt(jQuery("#MapTemplateName").val());
+                var proVersion = !!jQuery("#photoSize").attr("proVersion");
 
-        for (var t = 0; t < $arrTemplates.length; t++) {
+                for (var t = 0; t < $arrTemplates.length; t++) {
 
-            var template = $arrTemplates[t];
+                    var template = $arrTemplates[t];
 
-            if (parseInt(template.ID) == templateID) {
+                    if (parseInt(template.ID) == templateID) {
 
-                jQuery('#divPreview').html(replaceAll(template.TemplateHTML, '[siteurl]', $pluginsURL));
-                if (proVersion === true)
-                    jQuery('#easy2mapphotologo').remove();
+                        jQuery('#divPreview').html(replaceAll(template.TemplateHTML, '[siteurl]', $pluginsURL));
+                        if (proVersion === true)
+                            jQuery('#easy2mapphotologo').remove();
 
-                jQuery('[id ^= styleElement]').each(function() {
-                    jQuery('#divMapParent').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
-                });
+                        jQuery('[id ^= styleElement]').each(function() {
+                            jQuery('#divMapParent').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
+                        });
 
-                jQuery('[id ^= stylePhotoElement]').each(function() {
+                        jQuery('[id ^= stylePhotoElement]').each(function() {
 
-                    if (jQuery(this).attr('item') === "width") {
-                        jQuery('#divMapParent').css("width", jQuery(this).attr('value'));
-                        jQuery('#easy2mapmainimage').css("width", '');
+                            if (jQuery(this).attr('item') === "width") {
+                                jQuery('#divMapParent').css("width", jQuery(this).attr('value'));
+                                jQuery('#easy2mapmainimage').css("width", '');
 
-                    } else {
-                        jQuery('#easy2mapmainimage').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
-                    }
-                });
+                            } else {
+                                jQuery('#easy2mapmainimage').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
+                            }
+                        });
 
-                jQuery('[id ^= styleMapElement]').each(function() {
-                    jQuery('#divMap').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
-                });
+                        jQuery('[id ^= styleMapElement]').each(function() {
+                            jQuery('#divMap').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
+                        });
 
-                jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
-                jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
-                jQuery("#easy2mapIimgShadow").css('marginLeft', jQuery("#divMapParent").css('marginLeft'));
-                jQuery("#easy2mapIimgShadow").css('marginRight', jQuery("#divMapParent").css('marginRight'));
+                        jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
+                        jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
+                        jQuery("#easy2mapIimgShadow").css('marginLeft', jQuery("#divMapParent").css('marginLeft'));
+                        jQuery("#easy2mapIimgShadow").css('marginRight', jQuery("#divMapParent").css('marginRight'));
 
-            }
-        }
+                    }
+                }
 
-        //save the map to the database if required to do so
-        if (!!saveMapToDatabase) {
-            easy2map_imgmap_functions.saveMap(false, false);
-        }
+                //save the map to the database if required to do so
+                if (!!saveMapToDatabase) {
+                    easy2map_imgmap_functions.saveMap(false, false);
+                }
 
-        easy2map_imgmap_functions.displayGoogleMap();
+                easy2map_imgmap_functions.displayGoogleMap();
 
-        google.maps.event.addDomListener(window, 'load', easy2map_imgmappin_functions.retrieveMapPoints());
+                google.maps.event.addDomListener(window, 'load', easy2map_imgmappin_functions.retrieveMapPoints());
 
-    };
+            };
 
     //retrieve map's CSS elements for saving to the database
     retrieveMapCSS = function() {
 
         var arrCSS = [];
@@ -251,21 +251,54 @@ var easy2map_imgmap_functions = (function() {
             }
 
             $styleElementIndex = i;
             $styleSelectedElement = element;
             jQuery('div[id ^= div_edit_]').hide();
-
+            
             switch (attribute) {
 
                 case "border_style":
                     {
                         jQuery('#tdheading_style').html("Border Style");
                         jQuery('#div_edit_style').modal();
                         jQuery('#txtDefaultValue_style').val(value).focus();
                         break;
                     }
 
+                case "font_family":
+                    {
+                        jQuery('#tdheading_fontfamily').html("Font Family");
+                        jQuery('#div_edit_fontfamily').modal();
+                        jQuery('#txtDefaultValue_fontfamily').val(value).focus();
+                        break;
+                    }
+
+                case "text_align":
+                    {
+                        jQuery('#tdheading_textalign').html("Text Align");
+                        jQuery('#div_edit_textalign').modal();
+                        jQuery('#txtDefaultValue_textalign').val(value).focus();
+                        break;
+                    }
+
+                case "font_weight":
+                    {
+                        jQuery('#tdheading_fontweight').html("Font Weight");
+                        jQuery('#div_edit_fontweight').modal();
+                        jQuery('#txtDefaultValue_fontweight').val(value).focus();
+                        break;
+                    }
+
+                case "font_size":
+                    {
+                        jQuery('#tdheading_em').html("Font Size");
+                        jQuery('#div_edit_em').modal();
+                        jQuery('#txtDefaultValue_em').val(value).focus();
+                        jQuery('#txtDefaultValue_em').val(type).prop('disabled', false);
+                        break;
+                    }
+
                 case "box_shadow":
                     {
                         jQuery('#tdheading_style').html("Shadow Style");
                         jQuery('#div_edit_shadow').modal();
                         jQuery('#txtDefaultValue_shadow').val(value).focus();
@@ -407,10 +440,21 @@ var easy2map_imgmap_functions = (function() {
                         jQuery('#colourpicker').attr('data-color', hexToRgb(value));
                         jQuery('#liDefaultValue_color').css('background-color', value);
                         break;
                     }
 
+                case "color":
+                    {
+                        jQuery('#tdheading_color').html("Color");
+                        jQuery('#div_edit_color').modal();
+                        jQuery('#txtDefaultValue_color').val(value).focus();
+                        jQuery('#txtDefaultValue_color').css('background-color', value);
+                        jQuery('#colourpicker').attr('data-color', hexToRgb(value));
+                        jQuery('#liDefaultValue_color').css('background-color', value);
+                        break;
+                    }
+
             }
 
         },
         //change a map's template
         changeMapTemplate: function() {
@@ -751,10 +795,36 @@ var easy2map_imgmap_functions = (function() {
             else
                 attribute = jQuery('#styleMapElement' + $styleElementIndex).attr('item');
 
             var alteredValue = '';
             switch (attribute) {
+                case "font_family":
+                    {
+                        alteredValue = jQuery('#txtDefaultValue_fontfamily').val();
+                        jQuery('#div_edit_fontfamily').hide();
+                        break;
+                    }
+
+                case "text_align":
+                    {
+                        alteredValue = jQuery('#txtDefaultValue_textalign').val();
+                        jQuery('#div_edit_textalign').hide();
+                        break;
+                    }
+                case "font_weight":
+                    {
+                        alteredValue = jQuery('#txtDefaultValue_fontweight').val();
+                        jQuery('#div_edit_fontweight').hide();
+                        break;
+                    }
+                case "font_size":
+                    {
+                        alteredValue = jQuery('#txtDefaultValue_em').val();
+                        jQuery('#div_edit_em').hide();
+                        break;
+
+                    }
                 case "border_style":
                     {
                         alteredValue = jQuery('#txtDefaultValue_style').val()
                         jQuery('#div_edit_style').hide();
                         break;
@@ -838,10 +908,17 @@ var easy2map_imgmap_functions = (function() {
                         alteredValue = jQuery('#txtDefaultValue_color').val();
                         jQuery('#tdItemElementValue').css('background-Color', jQuery('#txtDefaultValue_color').val());
                         jQuery('#div_edit_color').hide();
                         break;
                     }
+                case "color":
+                    {
+                        alteredValue = jQuery('#txtDefaultValue_color').val();
+                        jQuery('#tdItemElementValue').css('color', jQuery('#txtDefaultValue_color').val());
+                        jQuery('#div_edit_color').hide();
+                        break;
+                    }
                 case "z-index":
                     {
                         alteredValue = jQuery('#txtDefaultValue_pixel').val();
                         jQuery('#div_edit_pixel').hide();
                         break;
@@ -969,10 +1046,12 @@ var easy2map_imgmap_functions = (function() {
                     }
                     $mapID = mapID;
                     //set the action of the pin upload form to reflect the new mapID!
                     jQuery('#formAddPinIcon').attr('action', '?page=easy2mapimg&action=mappiniconsave&map_id=' + $mapID);
                     jQuery('#formAddPinImage').attr('action', '?page=easy2mapimg&action=mappinimageupload&map_id=' + $mapID);
+                    jQuery('#formPhotoImport').attr('action', '?page=easy2mapimg&action=photoimport&map_id=' + $mapID);
+                    jQuery('#formRefresh').attr('action', '?page=easy2mapimg&action=edit&map_id=' + $mapID);
 
                 },
                 error: function(XMLHttpRequest, textStatus, errorThrown) {
                     alert(errorThrown);
                 }
diff --git a/scripts/functions.imgmappin.admin.js b/scripts/functions.imgmappin.admin.js
index a55df58..89a29f3 100644
--- a/scripts/functions.imgmappin.admin.js
+++ b/scripts/functions.imgmappin.admin.js
@@ -1,69 +1,71 @@
-var easy2map_imgmappin_functions = (function(){
-    
+var easy2map_imgmappin_functions = (function() {
+
     /*clear the array that contains all pins located on the map*/
-    clearPinArray = function(){
-        
+    clearPinArray = function() {
+
         if ($pinsArray) {
             for (i in $pinsArray) {
                 $pinsArray[i].setMap(null);
                 $pinsArray[i].setAnimation(null);
             }
         }
-        if ($pinsArray) $pinsArray.length = 0;
+        if ($pinsArray)
+            $pinsArray.length = 0;
         $selectedPin = null;
-        
+
     };
-    
+
     /*add the selected pin onto the Google map*/
-    addPinToMap = function (objPointDetails){
+    addPinToMap = function(objPointDetails) {
 
         this.selectedMapPoint = objPointDetails;
 
         var marker = new google.maps.Marker({
-            position	: new google.maps.LatLng(this.selectedMapPoint.lattitude, this.selectedMapPoint.longitude),
-            draggable	: true,
-            map		: $map,
-            title           : this.selectedMapPoint.title.replace(/\\/gi, ''),
-            ID              : this.selectedMapPoint.ID,
-            icon            : this.selectedMapPoint.icon,
-            settings        : this.selectedMapPoint.settings,
-            small           : this.selectedMapPoint.small,
-            medium          : this.selectedMapPoint.medium,
-            large           : this.selectedMapPoint.large,
-            pinHTML         : this.selectedMapPoint.pinhtml,
-            pinText         : this.selectedMapPoint.pintext,
-            visible         : false
+            position: new google.maps.LatLng(this.selectedMapPoint.lattitude, this.selectedMapPoint.longitude),
+            draggable: true,
+            map: $map,
+            title: this.selectedMapPoint.title.replace(/\\/gi, ''),
+            ID: this.selectedMapPoint.ID,
+            icon: this.selectedMapPoint.icon,
+            settings: this.selectedMapPoint.settings,
+            small: this.selectedMapPoint.small,
+            medium: this.selectedMapPoint.medium,
+            large: this.selectedMapPoint.large,
+            pinHTML: this.selectedMapPoint.pinhtml,
+            pinText: this.selectedMapPoint.pintext,
+            visible: false
         });
-        
+
         $pinsArray.push(marker);
         //insert the pin onto the map here
-        google.maps.event.addListener(marker, "dragend", function (mEvent) {
+        google.maps.event.addListener(marker, "dragend", function(mEvent) {
             $latlng = mEvent.latLng;
             showLatLong();
             updateMapPinLocation(marker.ID);
         });
-        
+
         //show the pin's info window when it is clicked
-        google.maps.event.addListener(marker, "click", function (mEvent) {
-            
+        google.maps.event.addListener(marker, "click", function(mEvent) {
+
             var pinContent = "";
-            
+
             var lines = marker.pinHTML.split('\n');
-            for(var i = 0; i < lines.length; i++){
-                if (i > 0) pinContent += "<br>";
+            for (var i = 0; i < lines.length; i++) {
+                if (i > 0)
+                    pinContent += "<br>";
                 pinContent += lines[i];
             }
-            
-        //var infoWindow = new google.maps.InfoWindow();
-        //infoWindow.setContent(pinContent);
-        //infoWindow.open(marker.map, marker);
+
+            //var infoWindow = new google.maps.InfoWindow();
+            //infoWindow.setContent(pinContent);
+            //infoWindow.open(marker.map, marker);
         });
     };
-    
-    clearTextOfAllFormatting = function(html){
-        
+
+    clearTextOfAllFormatting = function(html) {
+
         //remove MS Word formatting
         html = replaceAll(html, "&quot;Arial&quot;", "Arial");
         html = replaceAll(html, "&quot;Times New Roman&quot;", "Arial");
         html = replaceAll(html, "&quot;sans-serif&quot;", "sans-serif");
         html = replaceAll(html, 'class="MsoNormal"', '');
@@ -71,99 +73,101 @@ var easy2map_imgmappin_functions = (function(){
         html = html.replace(/ – /g, " - ");
 
         //gmail does not render line-height correctly
         html = replaceAll(html, "line-height:", "min-height:");
 
-        if (html.indexOf('<p') != -1){
+        if (html.indexOf('<p') != -1) {
             html = replaceAll(html, "'", '&#39;');
         }
 
         html = replaceAll(html, '<p>', '<p style="margin:0; padding:0;">');
         html = replaceAll(html, '<p style="text-align: left;">', '<p style="text-align: left;margin:0; padding:0;">');
         html = replaceAll(html, '<p style="text-align: right;">', '<p style="text-align: left;margin:0; padding:0;">');
         html = replaceAll(html, '<p style="text-align: center;">', '<p style="text-align: left;margin:0; padding:0;">');
 
         //remove MS Word formatting
-        if (html.indexOf('[endif]') != -1){
+        if (html.indexOf('[endif]') != -1) {
             html = html.substring(html.lastIndexOf('[endif]') + 10);
         }
-        
+
         return html;
     };
-    
+
     //function used as object for saving details of pins in a loop
-    listedMapPin = function(objPinDetails){
+    listedMapPin = function(objPinDetails) {
         this.pinDetails = objPinDetails;
     };
-    
+
     //set the current pins image
-    setPinImage = function (img){
+    setPinImage = function(img) {
         jQuery('#draggable').attr('src', jQuery(img).attr('src'));
         jQuery('#mapPinIconList').modal('hide');
-        
+
         if ($pinsArray) {
             for (i in $pinsArray) {
-                
-                if (!!$selectedPin == false) continue;
-                if (typeof $pinsArray[i].ID == "undefined" || typeof $selectedPin.ID == "undefined") continue;
-                if ($pinsArray[i].ID == $selectedPin.ID) $pinsArray[i].setIcon(jQuery(img).attr('src'));
+
+                if (!!$selectedPin == false)
+                    continue;
+                if (typeof $pinsArray[i].ID == "undefined" || typeof $selectedPin.ID == "undefined")
+                    continue;
+                if ($pinsArray[i].ID == $selectedPin.ID)
+                    $pinsArray[i].setIcon(jQuery(img).attr('src'));
             }
         }
     };
-    
+
     //show lat/lng of current pin
-    showLatLong = function (){
+    showLatLong = function() {
         jQuery('#latLongParent').show();
         jQuery('#divLatLong').html('Position of Pin: ' + $latlng);
     };
-    
+
     //update the lat lng of the current pin after it is dragged and dropped
-    updateMapPinLocation = function(mapPinID){
-               
+    updateMapPinLocation = function(mapPinID) {
+
         jQuery.ajax({
-            type : 'POST',
-            url : ajaxurl,
-            dataType : 'json',
+            type: 'POST',
+            url: ajaxurl,
+            dataType: 'json',
             data: {
-                mapPointID : mapPinID,
-                latLong : $latlng + '',
-                action : "e2m_img_update_map_pin_location"
+                mapPointID: mapPinID,
+                latLong: $latlng + '',
+                action: "e2m_img_update_map_pin_location"
             }
         });
     };
-       
+
     return{
-        
         //prepare the front-end to allow the user to add a new marker to the map
-        addNewMapMarker : function(){
-            
+        addNewMapMarker: function() {
+
             jQuery('.fileupload').fileupload('clear');
             jQuery('#AddMarkerOrSave').hide();
             jQuery('#tblAddMapMarker').show();
-                        
+
         },
-        
         //hide all edit controls from view
-        cancelSaveMapPin : function (){
-            
+        cancelSaveMapPin: function() {
+
             jQuery('#pinDescriptionParent').hide();
             jQuery('#divAddressSearch').hide();
             jQuery('#divDrag').hide();
             jQuery('#divDrag2').hide();
             jQuery('#btnCancelPin').hide();
             jQuery('#pinImageUploadParent').show();
+            jQuery('#zipUpload').show();
             jQuery('#pinImageParent').hide();
-            
+
             jQuery('#AddMarkerOrSave').hide();
             jQuery('#tblAddMapMarker').hide();
-            
+
             jQuery('#address').attr('placeholder', "Enter address where this picture was taken");
-            
+
             document.getElementById('MapTemplateName').style.visibility = 'visible';
-            
+
             var proVersion = !!jQuery("#photoSize").attr("proVersion");
-            if (proVersion == false){
+            if (proVersion == false) {
                 document.getElementById('mapSize').style.visibility = 'hidden';
                 document.getElementById('photoSize').style.visibility = 'hidden';
                 document.getElementById('mapType').style.visibility = 'hidden';
                 document.getElementById('markerZoom').style.visibility = 'hidden';
             } else {
@@ -171,31 +175,32 @@ var easy2map_imgmappin_functions = (function(){
                 document.getElementById('photoSize').style.visibility = 'visible';
                 document.getElementById('mapType').style.visibility = 'visible';
                 document.getElementById('markerZoom').style.visibility = 'visible';
             }
             document.getElementById('easy2mapmainimage').style.backgroundImage = "none";
-            
+
             jQuery('#draganddrop').show();
             jQuery('#AddEditPinTitle').html('Add New Photo').show();
             jQuery('#divPinAddEditParent').hide();
             jQuery('#easy2mapslidertext').html('').hide();
-            
+
             jQuery('#pinDescription').data("wysihtml5").editor.clear();
-            
+
             jQuery('#btnDeletePin').hide();
             jQuery('#btnSavePin').hide();
             jQuery('#latLongParent').hide();
             jQuery('#draggable').attr("src", $mapSettings.DefaultPinImage);
-            if ($selectedPin) $selectedPin.setAnimation(null);
+            if ($selectedPin)
+                $selectedPin.setAnimation(null);
             $selectedPin = null;
-            
+
             //prepare the pin for dragging onto the map
             easy2map_imgmappin_functions.setIconDraggable();
-            
+
             jQuery('td [id ^= imageTd]').removeClass('highlighted');
             jQuery('td [id ^= nameTd]').removeClass('highlighted');
-            
+
             //remove the current pin from the public array
             if ($pinsArray) {
                 for (i in $pinsArray) {
                     if ($pinsArray[i].ID == 0) {
                         $pinsArray[i].setMap(null);
@@ -203,338 +208,338 @@ var easy2map_imgmappin_functions = (function(){
                         $pinsArray[i].setVisible(false);
                         $pinsArray.splice(i, 1);
                     }
                 }
             }
-            
+
             jQuery('tr [id ^=divPinInstructions]').show();
             jQuery('#draganddrop').show();
             $mapPinID = 0;
         },
-        
         //allow the user to change the pin template
-        changeMapPinTemplate : function(){
-    
+        changeMapPinTemplate: function() {
+
             var templateID = parseInt(jQuery("#MapPinTemplateName").val());
-    
-            for(var t = 0; t < $arrTemplates.length; t++){
-        
+
+            for (var t = 0; t < $arrTemplates.length; t++) {
+
                 var template = $arrTemplates[t];
-                if (parseInt(template.ID) == templateID){
+                if (parseInt(template.ID) == templateID) {
                     jQuery('#MapTemplateExampleImg').html(template.TemplateHTML);
-                }        
+                }
             }
         },
-        
         //deleting map pin
-        deleteSelectedPoint : function (){
+        deleteSelectedPoint: function() {
+
+            if (!confirm('Are you sure you wish to delete this marker? This action is not reversible!'))
+                return;
 
-            if (!confirm('Are you sure you wish to delete this marker? This action is not reversible!')) return;
-            
             jQuery.ajax({
-                type : 'POST',
-                url : ajaxurl,
-                dataType : 'json',
+                type: 'POST',
+                url: ajaxurl,
+                dataType: 'json',
                 data: {
-                    MapPointID : $mapPinID,
+                    MapPointID: $mapPinID,
                     action: 'e2m_img_delete_map_point'
                 },
-                success : function(returnData){
+                success: function(returnData) {
 
-                    if (returnData.length > 0){
+                    if (returnData.length > 0) {
                         alert(returnData);
                         return;
                     }
-                    
+
                     clearPinArray();
-                    if ($pinsArray) $pinsArray.length = 0;
+                    if ($pinsArray)
+                        $pinsArray.length = 0;
                     easy2map_imgmappin_functions.retrieveMapPoints();
                 },
-                error : function(XMLHttpRequest, textStatus, errorThrown) {
-                    if (errorThrown.length > 0) alert(errorThrown);
+                error: function(XMLHttpRequest, textStatus, errorThrown) {
+                    if (errorThrown.length > 0)
+                        alert(errorThrown);
                 }
             });
         },
-        
         //prepare a pin item for editing
-        editPinItem : function(index){
-            
-            for (i = 0; i < $pinsArray.length; i++){
+        editPinItem: function(index) {
+
+            for (i = 0; i < $pinsArray.length; i++) {
                 $pinsArray[i].setVisible(false);
             }
-            
+
             var pinDetails = $markersArray[index].pinDetails;
             $latlng = new google.maps.LatLng(pinDetails.lattitude, pinDetails.longitude);
             $selectedPin = $pinsArray[index];
             $selectedPin.setVisible(true);
             showLatLong();
-            
+
             $selectedPin.setAnimation(google.maps.Animation.BOUNCE);
-            setTimeout(function(){
+            setTimeout(function() {
                 $selectedPin.setAnimation(null);
             }, 1500);
-            $map.setCenter($latlng);            
-            
+            $map.setCenter($latlng);
+
             jQuery('td [id ^= imageTd]').removeClass('highlighted');
             jQuery('td [id ^= nameTd]').removeClass('highlighted');
-            
+
             jQuery('#imageTd' + index).addClass('highlighted');
             jQuery('#nameTd' + index).addClass('highlighted');
             document.getElementById('mapSize').style.visibility = 'hidden';
             document.getElementById('photoSize').style.visibility = 'hidden';
             document.getElementById('mapType').style.visibility = 'hidden';
             document.getElementById('markerZoom').style.visibility = 'hidden';
-            document.getElementById('MapTemplateName').style.visibility = 'hidden';  
-            
+            document.getElementById('MapTemplateName').style.visibility = 'hidden';
+
             jQuery('#pinDescriptionParent').show();
             jQuery('#divAddressSearch').show();
             jQuery('#address').attr('placeholder', "Change Photo Marker's Location");
-            
+
             jQuery('#AddMarkerOrSave').hide();
             jQuery('#tblAddMapMarker').show();
-            
-            jQuery('#pinImagePreview').attr('src', pinDetails.large); 
+
+            jQuery('#pinImagePreview').attr('src', pinDetails.large);
             jQuery('#pinImageUploadParent').hide();
+            jQuery('#zipUpload').hide();
             //jQuery('#pinImageParent').show();
-            
+
             jQuery('#draganddrop').hide();
             jQuery('#btnCancelPin').show();
             jQuery('#AddEditPinTitle').html('Edit Photo Details').show();
             jQuery('#btnUploadIcon').html('Change Icon');
             jQuery('#divDrag').hide();
             jQuery('#divPinAddEditParent').show();
-            
+
             jQuery('#pinName').val(pinDetails.title.replace(/\\/gi, ''));
             jQuery('#pinDescription').data("wysihtml5").editor.setValue(pinDetails.pintext);
-            
+
             jQuery('#small').val(pinDetails.small);
             jQuery('#medium').val(pinDetails.medium);
             jQuery('#large').val(pinDetails.large);
             jQuery('#easy2mapmainimage').css({
-                'background-image' : 'url(' + pinDetails.large + ')', 
-                'background-repeat': 'no-repeat', 
+                'background-image': 'url(' + pinDetails.large + ')',
+                'background-repeat': 'no-repeat',
                 'background-position': 'center'
             }).fadeIn();
             jQuery('#easy2mapslidertext').html(pinDetails.pintext).show();
-                                    
-            
+
+
             $mapPinID = pinDetails.ID;
             jQuery('#btnDeletePin').show();
             jQuery('#btnSavePin').show();
             jQuery('tr [id ^=divPinInstructions]').hide();
             jQuery('#draggable').attr('src', pinDetails.icon);
             easy2map_imgmappin_functions.setIconNotDraggable();
             easy2map_imgmap_functions.disableHover();
-            
+
         },
-        
-        hidePreviewPage : function (){
+        hidePreviewPage: function() {
             jQuery('#divMultipleLocations').fadeOut();
         },
-        
-        imageNotSuccessfullyUploaded : function (){
-            
-            if (document.getElementById('pinimage').value != ""){
-                jQuery('#photoUploadError').modal();    
+        imageNotSuccessfullyUploaded: function() {
+
+            if (document.getElementById('pinimage').value != "") {
+                jQuery('#photoUploadError').modal();
                 notBusy();
             }
-            
+
         },
-        
-        imageSuccessfullyUploaded : function (smallImage, mediumImage, largeImage, lat, lng){
-            
+        imageSuccessfullyUploaded: function(smallImage, mediumImage, largeImage, lat, lng) {
+
             jQuery('#easy2mapmainimage').css({
-                'background-image' : 'url(' + largeImage + ')', 
-                'background-repeat': 'no-repeat', 
+                'background-image': 'url(' + largeImage + ')',
+                'background-repeat': 'no-repeat',
                 'background-position': 'center'
             });
-                        
-            for (i = 0; i < $pinsArray.length; i++){                
+
+            for (i = 0; i < $pinsArray.length; i++) {
                 $pinsArray[i].setVisible(false);
             }
-            
+
             //jQuery('#pinImagePreview').attr('src', largeImage); 
             jQuery('#small').val(smallImage);
             jQuery('#medium').val(mediumImage);
             jQuery('#large').val(largeImage);
             jQuery('#pinImageUploadParent').hide();
+            jQuery('#zipUpload').show();
             document.getElementById('mapSize').style.visibility = 'hidden';
             document.getElementById('photoSize').style.visibility = 'hidden';
             document.getElementById('mapType').style.visibility = 'hidden';
             document.getElementById('markerZoom').style.visibility = 'hidden';
             document.getElementById('MapTemplateName').style.visibility = 'hidden';
             jQuery('#AddEditPinTitle').html('Specify Photo\'s Location');
             jQuery('#btnSavePin').hide();
             jQuery('#btnDeletePin').hide();
             jQuery('#btnCancelPin').show();
+            jQuery('#zipUpload').hide();
             jQuery('#divPinAddEditParent').show();
             $selectedPin = null;
             //jQuery('#draggable').attr('src', smallImage);
-            
-            if (lat === 0 && lng === 0){ 
-                
+
+            if (lat === 0 && lng === 0) {
+
                 jQuery('#divAddressSearch').show();
                 jQuery('#divDrag').show();
                 jQuery('#divDrag2').show();
-                           
+
             } else {
-                easy2map_imgmappin_functions.SetPinPosition(lat, lng); 
+                easy2map_imgmappin_functions.SetPinPosition(lat, lng);
             }
-            
+
             easy2map_imgmap_functions.disableHover();
             jQuery('#easy2mapslidertext').html('').hide();
-            jQuery('#pinimage').val('');            
+            jQuery('#pinimage').val('');
             notBusy();
-            
+
         },
-        
         //retrieve all pin icons associated with this map
-        openImagesDirectory : function (selectedImage){
-            
+        openImagesDirectory: function(selectedImage) {
+
             jQuery.ajax({
-                type            : 'POST',
-                url             : ajaxurl,
-                dataType        : 'json',
+                type: 'POST',
+                url: ajaxurl,
+                dataType: 'json',
                 data: {
-                    mapID : $mapID,
-                    action : 'e2m_img_retrieve_pin_icons'
+                    mapID: $mapID,
+                    action: 'e2m_img_retrieve_pin_icons'
                 },
-                success : function(returnData){
+                success: function(returnData) {
 
                     jQuery('#tblPinImages').find('tr').remove();
                     var iCounter = 0;
-                    for (var i = 0; i < returnData.length; i++){
-                        if (iCounter % 6 == 0){
+                    for (var i = 0; i < returnData.length; i++) {
+                        if (iCounter % 6 == 0) {
                             var tr = document.createElement('tr');
                             document.getElementById('tblPinImages').appendChild(tr);
                         }
 
-                        var imageTd                 = document.createElement('td');
-                        imageTd.align               = "center";
+                        var imageTd = document.createElement('td');
+                        imageTd.align = "center";
                         imageTd.style.borderColor = "#FFFFFF";
-                        imageTd.style.padding       = "2px";
-                        if (returnData[i] == selectedImage){
+                        imageTd.style.padding = "2px";
+                        if (returnData[i] == selectedImage) {
                             imageTd.style.borderColor = "#EBEBEB";
                             imageTd.style.borderWidth = "2px";
                             imageTd.style.borderStyle = "solid";
-                            imageTd.style.borderRadius  = "3px"
+                            imageTd.style.borderRadius = "3px"
                         }
 
                         var image = document.createElement('img');
                         image.style.cursor = "pointer";
                         image.setAttribute("onClick", "easy2map_imgmappin_functions.setMapPinImage(this)");
-                        
+
                         image.src = returnData[i];
                         imageTd.appendChild(image);
                         tr.appendChild(imageTd);
                         iCounter += 1;
                     }
-                    
+
                     jQuery('#mapPinIconList').modal();
                 },
-                error : function(XMLHttpRequest, textStatus, errorThrown) {
+                error: function(XMLHttpRequest, textStatus, errorThrown) {
                     alert(errorThrown);
                 }
             });
         },
-        
         //run this function when a pin is dropped onto a map - setup controls for creating pin
-        placePin : function (location, bounce) {
-            
-            for (i = 0; i < $pinsArray.length; i++){
+        placePin: function(location, bounce) {
+
+            for (i = 0; i < $pinsArray.length; i++) {
                 $pinsArray[i].setVisible(false);
             }
-            
+
             var marker = new google.maps.Marker({
-                position    : location,
-                ID          : 0,
-                draggable   : true,
-                bouncy      : true,
-                title       : 'Click on icon to edit details',
-                map         : $map,
-                icon        : jQuery('#draggable').attr('src')
+                position: location,
+                ID: 0,
+                draggable: true,
+                bouncy: true,
+                title: 'Click on icon to edit details',
+                map: $map,
+                icon: jQuery('#draggable').attr('src')
             });
-            
+
             $latlng = marker.position;
             $pinsArray.push(marker);
             $selectedPin = $pinsArray[$pinsArray.length - 1];
             showLatLong();
-            
-            if (!!bounce){
+
+            if (!!bounce) {
                 $selectedPin.setAnimation(google.maps.Animation.BOUNCE);
-                setTimeout(function(){
+                setTimeout(function() {
                     $selectedPin.setAnimation(null);
                 }, 1500);
             }
-            
+
             jQuery('#pinDescriptionParent').show();
             jQuery('#divAddressSearch').hide();
             document.getElementById('mapSize').style.visibility = 'hidden';
             document.getElementById('photoSize').style.visibility = 'hidden';
             document.getElementById('mapType').style.visibility = 'hidden';
             document.getElementById('markerZoom').style.visibility = 'hidden';
             document.getElementById('MapTemplateName').style.visibility = 'hidden';
-            
+
             jQuery('#draganddrop').hide();
             jQuery('#btnCancelPin').show();
             jQuery('#AddEditPinTitle').hide();
             jQuery('#btnUploadIcon').html('Change Icon');
             jQuery('#address').attr('placeholder', "Change Marker's Location");
             jQuery('#divDrag').hide();
             jQuery('#divPinAddEditParent').show();
-            
+
             jQuery('tr [id ^=divPinInstructions]').hide();
             jQuery('#pinDescription').focus();
-                        
+
             jQuery('#btnSavePin').show();
             easy2map_imgmappin_functions.setIconNotDraggable();
-            
-            google.maps.event.addListener(marker, "dragend", function (mEvent) {
+
+            google.maps.event.addListener(marker, "dragend", function(mEvent) {
                 $latlng = mEvent.latLng;
                 showLatLong();
             });
-            
-            google.maps.event.addListener(marker, "click", function (mEvent) {
+
+            google.maps.event.addListener(marker, "click", function(mEvent) {
                 $latlng = mEvent.latLng;
                 showLatLong();
             });
-            
+
             easy2map_imgmap_functions.disableHover();
-            
+
         },
-        
         //retrieve all points associated with this map
-        retrieveMapPoints : function (){
-            
+        retrieveMapPoints: function() {
+
             busy();
-            
+
             var data = {
                 action: 'e2m_img_retrieve_map_points',
-                MapID : $mapID
+                MapID: $mapID
             };
-            
+
             //clear all controls for blank slate
             easy2map_imgmappin_functions.cancelSaveMapPin();
             easy2map_imgmap_functions.disableHover();
-        
+
             jQuery.ajax({
                 type: "POST",
                 url: ajaxurl,
                 data: data,
-                dataType : 'json',
+                dataType: 'json',
                 success: function(returnData) {
-                    
+
                     jQuery('#tblMapMarkers').show().find('tr').remove();
                     jQuery('#Easy2MapSliderParent').show().find('li').remove();
-                    
+
                     var noPinsFound = false;
-                    
-                    if (typeof returnData == "undefined" || typeof returnData == "null") noPinsFound = true;
-                    if (!returnData) noPinsFound = true;
-                    if (returnData.length == 0)  noPinsFound = true;
-                    
-                    if (noPinsFound){
+
+                    if (typeof returnData == "undefined" || typeof returnData == "null")
+                        noPinsFound = true;
+                    if (!returnData)
+                        noPinsFound = true;
+                    if (returnData.length == 0)
+                        noPinsFound = true;
+
+                    if (noPinsFound) {
                         //if no pins are found, prompt the user to add a new pin
                         jQuery('#AddMarkerOrSave').hide();
                         jQuery('#tblAddMapMarker').show();
                         easy2mapimg_functions.noPinsLoaded();
                         notBusy();
@@ -542,53 +547,54 @@ var easy2map_imgmappin_functions = (function(){
                     } else {
                         //show all pins associated with the map
                         jQuery('#AddMarkerOrSave').show();
                         jQuery('#tblAddMapMarker').hide();
                     }
-                    
-                    if ($markersArray) $markersArray.length = 0;
+
+                    if ($markersArray)
+                        $markersArray.length = 0;
                     clearPinArray();
-                                                           
-                    for(var t = 0; t < returnData.length; t++){
-                        
+
+                    for (var t = 0; t < returnData.length; t++) {
+
                         var arrLatLng = replaceAll(replaceAll(replaceAll(returnData[t].LatLong, ' ', ''), '(', ''), ')', '').split(',');
                         var objMapPoint = {
-                            lattitude : arrLatLng[0],
-                            longitude : arrLatLng[1],
-                            ID : returnData[t].ID,
-                            title : returnData[t].Title,
-                            icon : returnData[t].ImageURL,
-                            settings : returnData[t].Settings,
-                            small : returnData[t].PinImageSmall,
-                            medium : returnData[t].PinImageMedium,
-                            large : returnData[t].PinImageLarge,
-                            pinhtml : returnData[t].MapPinHTML,
-                            pintext : returnData[t].MapPinText
+                            lattitude: arrLatLng[0],
+                            longitude: arrLatLng[1],
+                            ID: returnData[t].ID,
+                            title: returnData[t].Title,
+                            icon: returnData[t].ImageURL,
+                            settings: returnData[t].Settings,
+                            small: returnData[t].PinImageSmall,
+                            medium: returnData[t].PinImageMedium,
+                            large: returnData[t].PinImageLarge,
+                            pinhtml: returnData[t].MapPinHTML,
+                            pintext: returnData[t].MapPinText
                         }
-                        
+
                         $markersArray.push(new listedMapPin(objMapPoint));
                     }
-                    
+
                     var sliderImages = [];
-                    for (var i = 0; i < $markersArray.length; i++){
-                        
+                    for (var i = 0; i < $markersArray.length; i++) {
+
                         var selectedListItem = $markersArray[i].pinDetails;
                         addPinToMap(selectedListItem);
-                        
-                        if (document.getElementById('Easy2MapSliderParent')){
+
+                        if (document.getElementById('Easy2MapSliderParent')) {
                             var li = document.createElement('li');
                             li.className = "easy2mapslide";
-                            
+
                             li.setAttribute("sliderID", selectedListItem.ID);
                             li.setAttribute("onClick", "easy2mapimg_functions.clickPinItem(" + selectedListItem.ID + ")");
                             document.getElementById('Easy2MapSliderParent').appendChild(li);
                             sliderImages.push(selectedListItem.medium);
                         }
-                       
+
                         var tr = document.createElement('tr');
                         document.getElementById('tblMapMarkers').appendChild(tr);
-                       
+
                         var imageTd = document.createElement('td');
                         imageTd.id = "imageTd" + i;
                         imageTd.align = "center";
                         imageTd.style.textAlign = "center";
                         var image = document.createElement('img');
@@ -596,11 +602,11 @@ var easy2map_imgmappin_functions = (function(){
                         image.setAttribute("onClick", "easy2map_imgmappin_functions.editPinItem(" + i + ")");
                         image.src = selectedListItem.icon;
                         imageTd.style.minWidth = '10px';
                         imageTd.style.verticalAlign = 'middle';
                         imageTd.appendChild(image);
-                        
+
                         var imageTd2 = document.createElement('td');
                         imageTd2.id = "imageTd2" + i;
                         imageTd2.align = "center";
                         imageTd2.style.textAlign = "center";
                         var image2 = document.createElement('img');
@@ -609,11 +615,11 @@ var easy2map_imgmappin_functions = (function(){
                         image2.setAttribute("onClick", "easy2map_imgmappin_functions.editPinItem(" + i + ")");
                         image2.src = selectedListItem.medium;
                         imageTd2.title = selectedListItem.title.replace(/\\/gi, '');
                         imageTd2.appendChild(image2);
                         imageTd2.style.width = '60%';
-                        
+
                         var editTd = document.createElement('td');
                         editTd.id = "editTd" + i;
                         editTd.style.minWidth = '10%';
                         editTd.style.textAlign = 'center';
                         var editLink = document.createElement('a');
@@ -621,212 +627,228 @@ var easy2map_imgmappin_functions = (function(){
                         editLink.textContent = 'edit';
                         editLink.href = '#';
                         editLink.setAttribute('className', 'smallE2MLink');
                         editLink.setAttribute('onclick', "easy2map_imgmappin_functions.editPinItem(" + i + ")");
                         editTd.appendChild(editLink);
-                        
+
                         tr.appendChild(imageTd);
                         tr.appendChild(imageTd2);
                         tr.appendChild(editTd);
-                       
+
                     }
-                    
-                    if (sliderImages.length > 0){
-                        jQuery.preloadImages(sliderImages, function initSliderImages(){
+
+                    if (sliderImages.length > 0) {
+                        jQuery.preloadImages(sliderImages, function initSliderImages() {
                             jQuery('#easy2mapslider').imgSlider(sliderImages);
                         });
                     }
-                    
+
                     jQuery('#tblMapMarkers').removeClass('table-striped').addClass('table-striped');
-                    
-                    jQuery("#Easy2MapSliderParent li:first").each(function(){
+
+                    jQuery("#Easy2MapSliderParent li:first").each(function() {
                         easy2mapimg_functions.clickPinItem(jQuery(this).attr('sliderID'));
                     });
-                    
+
                     if ($markersArray.length > 1) {
                         easy2map_imgmap_functions.enableHover();
                     } else {
                         jQuery("#easy2mapslider").hide();
                     }
-                    
+
                     notBusy();
                 },
-                error : function(XMLHttpRequest, textStatus, errorThrown) {
+                error: function(XMLHttpRequest, textStatus, errorThrown) {
                     notBusy();
                 }
             });
         },
-        
         //save map pin to database
-        saveMapPin : function (){
-            
+        saveMapPin: function() {
+
             var pinText = clearTextOfAllFormatting(jQuery('#pinDescription').val());
-            
+
             var pinHTML = "<div style='padding:3px;margin:5px;border:1px solid #EBEBEB' align='center'><img src='" + jQuery('#large').val() + "'>";
-            if (pinText.length > 0) pinHTML += "<div style='text-align:left;margin:0px;padding:0px;'>" + pinText + "</div>";
+            if (pinText.length > 0)
+                pinHTML += "<div style='text-align:left;margin:0px;padding:0px;'>" + pinText + "</div>";
             pinHTML += "</div>";
-            
+
             busy();
-            
+
             //convert pin settings to XML
             //var pinSettings = {
             //    load : jQuery('#PinLoad option:selected').val(),
             //    url : jQuery('#PinURL').val()
             //}
             //var options                             = { formatOutput: true, rootTagName: 'settings'};
             //var PinSettingsXML                      = jQuery.json2xml(pinSettings, options);
-            
+
             jQuery.ajax({
-                type 	: 'POST',
-                url 	: ajaxurl,
-                dataType : 'json',
+                type: 'POST',
+                url: ajaxurl,
+                dataType: 'json',
                 data: {
-                    mapPointID : $mapPinID,
-                    action : "e2m_img_save_map_pin",
-                    latLong : $latlng + '',
-                    icon : jQuery('#draggable').attr('src'), 
-                    pinTitle : '',
-                    small : jQuery('#small').val(),
-                    medium : jQuery('#medium').val(),
-                    large : jQuery('#large').val(),
-                    pinSettingsXML : '',
-                    pinHTML : pinHTML,
-                    pinText : pinText,
-                    mapID : $mapID
+                    mapPointID: $mapPinID,
+                    action: "e2m_img_save_map_pin",
+                    latLong: $latlng + '',
+                    icon: jQuery('#draggable').attr('src'),
+                    pinTitle: '',
+                    small: jQuery('#small').val(),
+                    medium: jQuery('#medium').val(),
+                    large: jQuery('#large').val(),
+                    pinSettingsXML: '',
+                    pinHTML: pinHTML,
+                    pinText: pinText,
+                    mapID: $mapID
                 },
-                success : function(mapPinID){
+                success: function(mapPinID) {
                     easy2map_imgmappin_functions.retrieveMapPoints();
                     $selectedPin = null;
                 },
-                error : function(XMLHttpRequest, textStatus, errorThrown) {
+                error: function(XMLHttpRequest, textStatus, errorThrown) {
                     alert(errorThrown);
                     notBusy();
                 }
             });
-            
+
         },
-        
-        setCurrentPosition : function (lat,lng){
+        setCurrentPosition: function(lat, lng) {
             var location = new google.maps.LatLng(lat, lng);
             $latlng = location;
         },
-        
         //save default image associated with map pins
-        setMapPinImage :  function (img){
-        
+        setMapPinImage: function(img) {
+
             jQuery.ajax({
-                type : 'POST',
-                url : ajaxurl,
-                dataType : 'json',
+                type: 'POST',
+                url: ajaxurl,
+                dataType: 'json',
                 data: {
-                    MapID : $mapID,
-                    PinImage : encodeURIComponent(jQuery(img).attr('src')),
-                    action : "e2m_img_save_default_pin_image"
+                    MapID: $mapID,
+                    PinImage: encodeURIComponent(jQuery(img).attr('src')),
+                    action: "e2m_img_save_default_pin_image"
                 },
-                success : function(returnImage){
+                success: function(returnImage) {
                     jQuery('#draggable').attr('src', jQuery(img).attr('src'));
                     jQuery('#mapPinIconList').modal('hide');
                     $mapSettings.DefaultPinImage = returnImage;
                     setPinImage(img);
                 },
-                error : function(XMLHttpRequest, textStatus, errorThrown) {
+                error: function(XMLHttpRequest, textStatus, errorThrown) {
                     alert(errorThrown);
                 }
             });
 
         },
-        
         //set the pin's lat-lng position
-        SetPinPosition : function (lat,lng){
-            
+        SetPinPosition: function(lat, lng) {
+
             var location = new google.maps.LatLng(lat, lng);
             $latlng = location;
             if ($selectedPin == null) {
-                
+
                 easy2map_imgmappin_functions.placePin(location, true);
-                
+
                 //set map center, and save settings to map settings
                 $map.setCenter(location);
                 $map.setZoom(parseInt(jQuery('#markerZoom').val()));
                 var settings = jQuery.xml2json($mapSettings.Settings);
                 settings.lattitude = lat;
                 settings.longitude = lng;
-                settings.zoom =  $map.getZoom();
+                settings.zoom = $map.getZoom();
 
                 var options = {
-                    formatOutput: true, 
+                    formatOutput: true,
                     rootTagName: 'settings'
                 };
                 $mapSettings.Settings = jQuery.json2xml(settings, options);
-                
-                
+
+
             }
-            else $selectedPin.setPosition(location);
-            
-            setTimeout("jQuery('#address').val('')", 1500); 
+            else
+                $selectedPin.setPosition(location);
+
+            setTimeout("jQuery('#address').val('')", 1500);
         },
-        
         //prepare the icon to be dragged onto the map
-        setIconDraggable : function(){
-            
+        setIconDraggable: function() {
+
             jQuery("#draggable").css('cursor', 'move');
-            jQuery("#draggable").draggable({                    
+            jQuery("#draggable").draggable({
                 appendTo: '#bodyTag',
                 scroll: false,
                 helper: 'clone',
                 stop: function(e) {
-                    
+
                     var bounds = $map.getBounds();
                     var latLngSouthW = bounds.getSouthWest();
                     var latLngNorthE = bounds.getNorthEast();
                     var position = jQuery('#divMap').offset();
-                    var point = new google.maps.Point(e.pageX - position.left,e.pageY -position.top + 22);
+                    var point = new google.maps.Point(e.pageX - position.left, e.pageY - position.top + 22);
                     var item = $overlay.getProjection().fromContainerPixelToLatLng(point);
-                    if (latLngSouthW.lng() > 0 && (item.lng() > 0 && item.lng() < latLngSouthW.lng())) return;
-                    if (latLngSouthW.lng() < 0 && (item.lng() < 0 && item.lng() < latLngSouthW.lng())) return;
-                    
-                    if (latLngNorthE.lng() > 0 && (item.lng() > 0 && item.lng() > latLngNorthE.lng())) return;
-                    if (latLngNorthE.lng() < 0 && (item.lng() < 0 && item.lng() > latLngNorthE.lng())) return;
-                    
+                    if (latLngSouthW.lng() > 0 && (item.lng() > 0 && item.lng() < latLngSouthW.lng()))
+                        return;
+                    if (latLngSouthW.lng() < 0 && (item.lng() < 0 && item.lng() < latLngSouthW.lng()))
+                        return;
+
+                    if (latLngNorthE.lng() > 0 && (item.lng() > 0 && item.lng() > latLngNorthE.lng()))
+                        return;
+                    if (latLngNorthE.lng() < 0 && (item.lng() < 0 && item.lng() > latLngNorthE.lng()))
+                        return;
+
                     easy2map_imgmappin_functions.placePin(item);
                 }
-                
+
             });
-            
+
         },
-        
-        setIconNotDraggable : function(){
+        setIconNotDraggable: function() {
             jQuery('#draggable').css('cursor', 'default').draggable('destroy');
         },
-
         //verify that the pin icon is a valid image file
-        uploadPinIcon : function (){
-                
+        uploadPinIcon: function() {
+
             var validateFileType = checkFileExtensionSilent(document.getElementById('pinicon'));
-            if (validateFileType != ''){
+            if (validateFileType != '') {
                 alert('Invalid file, only the following image types are allowed: ' + validateFileType + '. Please upload a different image.');
                 return;
             }
             document.formAddPinIcon.submit();
         },
-        
         //verify that the pin icon is a valid image file
-        uploadPinPicture : function (){
+        uploadZippedFile: function() {
+
+            var validateFileType = checkFileExtensionSilent(document.getElementById('zipfile'));
+            if (validateFileType !== '') {
+                alert('Invalid file, only the following image types are allowed: ' + validateFileType + '. Please upload a different image.');
+                return false;
+            } else {
+                return true;
+            }
+        },
+        uploadZippedFileResult: function(successMessage){
             
-            if (document.getElementById('pinimage').value === "") return;
+            jQuery('#resultMessage').html(successMessage);
+            jQuery('#popupModalZipImport').modal();
+            
+        },
+        //verify that the pin icon is a valid image file
+        uploadPinPicture: function() {
+
+            if (document.getElementById('pinimage').value === "")
+                return;
             var bContinue = true;
-                
+
             var validateFileType = checkFileExtensionSilent(document.getElementById('pinimage'));
-            if (validateFileType != ''){
+            if (validateFileType != '') {
                 alert('Invalid file, only the following image types are allowed: ' + validateFileType + '. Please upload a different image.');
                 bContinue = false;
                 return;
             }
-            
-            if (bContinue == true){
+
+            if (bContinue == true) {
                 busy();
                 document.formAddPinImage.submit();
             }
         }
     }
-    
+
 })();
\ No newline at end of file

Vulnerable code: #easy2mapslidertext {display:none;text-align:center;color:#FFFFFF;font-family:Arial, Helvetica, sans-serif;font-size:0.9em;position:absolute;width:100%;top:15px;font-weight:bold;z-index:999;border-color:transparent;border-radius:0px;border-style:solid;border-width:1px;text-shadow:#171717 0.1em 0.1em 0.1em;background-color:transparent;white-space:nowrap;}

            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
            
            
            
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
            
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
            
            '<settings width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',
            
             $SQLInsert15 = "UPDATE `$map_templates_table`
             
             $wpdb->query($SQLInsert15);
             
             $SQLInsert16 = "UPDATE `$map_templates_table`
             
             $wpdb->query($SQLInsert16);
            
            
            include('CopyMapSettings.php');    
        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "activation") == 0) {
            include('Validation.php');
        
        if (strlen($code) == "") $code = get_option('phe_171323_transient_17666766');
        
        $wpdb->query(sprintf("UPDATE $mapsTable
            $wpdb->query(sprintf("
                    urldecode($_REQUEST['mapSettingsXML']), 
                    urldecode($_REQUEST["parentCSSXML"]),
                    urldecode($_REQUEST["photoCSSXML"]), 
                    urldecode($_REQUEST["mapCSSXML"]), 
                    urldecode($_REQUEST["mapHTML"]), $mapID));
            if (!$wpdb->query(sprintf("
                    urldecode($_REQUEST['mapSettingsXML']), 
                    urldecode($_REQUEST["parentCSSXML"]), 
                    urldecode($_REQUEST["photoCSSXML"]), 
                    urldecode($_REQUEST["mapCSSXML"]), 
                    urldecode($_REQUEST["mapHTML"])))) {
        $wpdb->query(sprintf("
        
                                                                                                        <button onclick="window.location='?page=easy2mapimg&action=viewMaps'" type="button" 
                                                                                                                style="margin-left:30px;width:100px;" 
                                                                                                                class="btn">Back</button> 
</form>                    
    
    $arrImage = array();
    if (extension_loaded('exif')) {
        $arrImage = exif_read_data($uploadedFile, 0, true);
    }
    
    if (isset($arrImage['GPS'])){
    
        $GPS = $arrImage['GPS'];
        
        if (isset($GPS['GPSLatitudeRef']) && isset($GPS['GPSLatitude'])){

            //LATITUDE
            $LatitudeRef = $GPS['GPSLatitudeRef'];
            $Latitude = $GPS['GPSLatitude'];
            
            $arrLatDegrees = explode("/", $Latitude[0]);
            $arrLatMinutes = explode("/", $Latitude[1]);
            $arrLatSeconds = explode("/", $Latitude[2]);
            
            $latDegrees = floatval($arrLatDegrees[0] / $arrLatDegrees[1]);
            $latMinutes = floatval($arrLatMinutes[0] / $arrLatMinutes[1]);
            $latSeconds = floatval($arrLatSeconds[0] / $arrLatSeconds[1]);
            
            echo $latDegrees . '|' . $latMinutes . '|' . $latSeconds . '|';

            //LONGITUDE
            $LongitudeRef = $GPS['GPSLongitudeRef'];
            $Longitude = $GPS['GPSLongitude'];
            
            $arrLngDegrees = explode("/", $Longitude[0]);
            $arrLngMinutes = explode("/", $Longitude[1]);
            $arrLngSeconds = explode("/", $Longitude[2]);
            
            $lngDegrees = floatval($arrLngDegrees[0] / $arrLngDegrees[1]);
            $lngMinutes = floatval($arrLngMinutes[0] / $arrLngMinutes[1]);
            $lngSeconds = floatval($arrLngSeconds[0] / $arrLngSeconds[1]);

            $lat = DMStoDEC($latDegrees,$latMinutes,$latSeconds);
            if (strcasecmp($LatitudeRef, "S") === 0) $lat = -1 * $lat;

            $lng = DMStoDEC($lngDegrees,$lngMinutes,$lngSeconds);
            if (strcasecmp($LongitudeRef, "W") === 0) $lng = -1 * $lng;
        }
function DMStoDEC($deg,$min,$sec)
{

// Converts DMS ( Degrees / minutes / seconds ) 
// to decimal format longitude / latitude
    return $deg+((($min*60)+($sec))/3600);
} 
  Version: 1.0.9 
Tested up to: 3.6.1
Stable tag: 1.0.9
* Various fixes and enhancements
        var templateID = parseInt(jQuery("#MapTemplateName").val());
        var proVersion = !!jQuery("#photoSize").attr("proVersion");
        for (var t = 0; t < $arrTemplates.length; t++) {
            var template = $arrTemplates[t];
            if (parseInt(template.ID) == templateID) {
                jQuery('#divPreview').html(replaceAll(template.TemplateHTML, '[siteurl]', $pluginsURL));
                if (proVersion === true)
                    jQuery('#easy2mapphotologo').remove();
                jQuery('[id ^= styleElement]').each(function() {
                    jQuery('#divMapParent').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                });
                jQuery('[id ^= stylePhotoElement]').each(function() {
                    if (jQuery(this).attr('item') === "width") {
                        jQuery('#divMapParent').css("width", jQuery(this).attr('value'));
                        jQuery('#easy2mapmainimage').css("width", '');
                    } else {
                        jQuery('#easy2mapmainimage').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                    }
                });
                jQuery('[id ^= styleMapElement]').each(function() {
                    jQuery('#divMap').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                });
                jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
                jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
                jQuery("#easy2mapIimgShadow").css('marginLeft', jQuery("#divMapParent").css('marginLeft'));
                jQuery("#easy2mapIimgShadow").css('marginRight', jQuery("#divMapParent").css('marginRight'));
            }
        }
        //save the map to the database if required to do so
        if (!!saveMapToDatabase) {
            easy2map_imgmap_functions.saveMap(false, false);
        }
        easy2map_imgmap_functions.displayGoogleMap();
        google.maps.event.addDomListener(window, 'load', easy2map_imgmappin_functions.retrieveMapPoints());
    };

var easy2map_imgmappin_functions = (function(){
    
    clearPinArray = function(){
        
        if ($pinsArray) $pinsArray.length = 0;
        
    
    addPinToMap = function (objPointDetails){
            position	: new google.maps.LatLng(this.selectedMapPoint.lattitude, this.selectedMapPoint.longitude),
            draggable	: true,
            map		: $map,
            title           : this.selectedMapPoint.title.replace(/\\/gi, ''),
            ID              : this.selectedMapPoint.ID,
            icon            : this.selectedMapPoint.icon,
            settings        : this.selectedMapPoint.settings,
            small           : this.selectedMapPoint.small,
            medium          : this.selectedMapPoint.medium,
            large           : this.selectedMapPoint.large,
            pinHTML         : this.selectedMapPoint.pinhtml,
            pinText         : this.selectedMapPoint.pintext,
            visible         : false
        
        google.maps.event.addListener(marker, "dragend", function (mEvent) {
        
        google.maps.event.addListener(marker, "click", function (mEvent) {
            
            
            for(var i = 0; i < lines.length; i++){
                if (i > 0) pinContent += "<br>";
            
        //var infoWindow = new google.maps.InfoWindow();
        //infoWindow.setContent(pinContent);
        //infoWindow.open(marker.map, marker);
    
    clearTextOfAllFormatting = function(html){
        
        if (html.indexOf('<p') != -1){
        if (html.indexOf('[endif]') != -1){
        
    
    listedMapPin = function(objPinDetails){
    
    setPinImage = function (img){
        
                
                if (!!$selectedPin == false) continue;
                if (typeof $pinsArray[i].ID == "undefined" || typeof $selectedPin.ID == "undefined") continue;
                if ($pinsArray[i].ID == $selectedPin.ID) $pinsArray[i].setIcon(jQuery(img).attr('src'));
    
    showLatLong = function (){
    
    updateMapPinLocation = function(mapPinID){
               
            type : 'POST',
            url : ajaxurl,
            dataType : 'json',
                mapPointID : mapPinID,
                latLong : $latlng + '',
                action : "e2m_img_update_map_pin_location"
       
        
        addNewMapMarker : function(){
            
                        
        
        cancelSaveMapPin : function (){
            
            
            
            
            
            if (proVersion == false){
            
            
            
            if ($selectedPin) $selectedPin.setAnimation(null);
            
            
            
            
        
        changeMapPinTemplate : function(){
    
    
            for(var t = 0; t < $arrTemplates.length; t++){
        
                if (parseInt(template.ID) == templateID){
                }        
        
        deleteSelectedPoint : function (){
            if (!confirm('Are you sure you wish to delete this marker? This action is not reversible!')) return;
            
                type : 'POST',
                url : ajaxurl,
                dataType : 'json',
                    MapPointID : $mapPinID,
                success : function(returnData){
                    if (returnData.length > 0){
                    
                    if ($pinsArray) $pinsArray.length = 0;
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                    if (errorThrown.length > 0) alert(errorThrown);
        
        editPinItem : function(index){
            
            for (i = 0; i < $pinsArray.length; i++){
            
            
            setTimeout(function(){
            $map.setCenter($latlng);            
            
            
            document.getElementById('MapTemplateName').style.visibility = 'hidden';  
            
            
            
            jQuery('#pinImagePreview').attr('src', pinDetails.large); 
            
            
            
                'background-image' : 'url(' + pinDetails.large + ')', 
                'background-repeat': 'no-repeat', 
                                    
            
            
        
        hidePreviewPage : function (){
        
        imageNotSuccessfullyUploaded : function (){
            
            if (document.getElementById('pinimage').value != ""){
                jQuery('#photoUploadError').modal();    
            
        
        imageSuccessfullyUploaded : function (smallImage, mediumImage, largeImage, lat, lng){
            
                'background-image' : 'url(' + largeImage + ')', 
                'background-repeat': 'no-repeat', 
                        
            for (i = 0; i < $pinsArray.length; i++){                
            
            
            if (lat === 0 && lng === 0){ 
                
                           
                easy2map_imgmappin_functions.SetPinPosition(lat, lng); 
            
            jQuery('#pinimage').val('');            
            
        
        openImagesDirectory : function (selectedImage){
            
                type            : 'POST',
                url             : ajaxurl,
                dataType        : 'json',
                    mapID : $mapID,
                    action : 'e2m_img_retrieve_pin_icons'
                success : function(returnData){
                    for (var i = 0; i < returnData.length; i++){
                        if (iCounter % 6 == 0){
                        var imageTd                 = document.createElement('td');
                        imageTd.align               = "center";
                        imageTd.style.padding       = "2px";
                        if (returnData[i] == selectedImage){
                            imageTd.style.borderRadius  = "3px"
                        
                    
                error : function(XMLHttpRequest, textStatus, errorThrown) {
        
        placePin : function (location, bounce) {
            
            for (i = 0; i < $pinsArray.length; i++){
            
                position    : location,
                ID          : 0,
                draggable   : true,
                bouncy      : true,
                title       : 'Click on icon to edit details',
                map         : $map,
                icon        : jQuery('#draggable').attr('src')
            
            
            if (!!bounce){
                setTimeout(function(){
            
            
            
                        
            
            google.maps.event.addListener(marker, "dragend", function (mEvent) {
            
            google.maps.event.addListener(marker, "click", function (mEvent) {
            
            
        
        retrieveMapPoints : function (){
            
            
                MapID : $mapID
            
        
                dataType : 'json',
                    
                    
                    
                    if (typeof returnData == "undefined" || typeof returnData == "null") noPinsFound = true;
                    if (!returnData) noPinsFound = true;
                    if (returnData.length == 0)  noPinsFound = true;
                    
                    if (noPinsFound){
                    
                    if ($markersArray) $markersArray.length = 0;
                                                           
                    for(var t = 0; t < returnData.length; t++){
                        
                            lattitude : arrLatLng[0],
                            longitude : arrLatLng[1],
                            ID : returnData[t].ID,
                            title : returnData[t].Title,
                            icon : returnData[t].ImageURL,
                            settings : returnData[t].Settings,
                            small : returnData[t].PinImageSmall,
                            medium : returnData[t].PinImageMedium,
                            large : returnData[t].PinImageLarge,
                            pinhtml : returnData[t].MapPinHTML,
                            pintext : returnData[t].MapPinText
                        
                    
                    for (var i = 0; i < $markersArray.length; i++){
                        
                        
                        if (document.getElementById('Easy2MapSliderParent')){
                            
                       
                       
                        
                        
                        
                       
                    
                    if (sliderImages.length > 0){
                        jQuery.preloadImages(sliderImages, function initSliderImages(){
                    
                    
                    jQuery("#Easy2MapSliderParent li:first").each(function(){
                    
                    
                error : function(XMLHttpRequest, textStatus, errorThrown) {
        
        saveMapPin : function (){
            
            
            if (pinText.length > 0) pinHTML += "<div style='text-align:left;margin:0px;padding:0px;'>" + pinText + "</div>";
            
            
            
                type 	: 'POST',
                url 	: ajaxurl,
                dataType : 'json',
                    mapPointID : $mapPinID,
                    action : "e2m_img_save_map_pin",
                    latLong : $latlng + '',
                    icon : jQuery('#draggable').attr('src'), 
                    pinTitle : '',
                    small : jQuery('#small').val(),
                    medium : jQuery('#medium').val(),
                    large : jQuery('#large').val(),
                    pinSettingsXML : '',
                    pinHTML : pinHTML,
                    pinText : pinText,
                    mapID : $mapID
                success : function(mapPinID){
                error : function(XMLHttpRequest, textStatus, errorThrown) {
            
        
        setCurrentPosition : function (lat,lng){
        
        setMapPinImage :  function (img){
        
                type : 'POST',
                url : ajaxurl,
                dataType : 'json',
                    MapID : $mapID,
                    PinImage : encodeURIComponent(jQuery(img).attr('src')),
                    action : "e2m_img_save_default_pin_image"
                success : function(returnImage){
                error : function(XMLHttpRequest, textStatus, errorThrown) {
        
        SetPinPosition : function (lat,lng){
            
                
                
                settings.zoom =  $map.getZoom();
                    formatOutput: true, 
                
                
            else $selectedPin.setPosition(location);
            
            setTimeout("jQuery('#address').val('')", 1500); 
        
        setIconDraggable : function(){
            
            jQuery("#draggable").draggable({                    
                    
                    var point = new google.maps.Point(e.pageX - position.left,e.pageY -position.top + 22);
                    if (latLngSouthW.lng() > 0 && (item.lng() > 0 && item.lng() < latLngSouthW.lng())) return;
                    if (latLngSouthW.lng() < 0 && (item.lng() < 0 && item.lng() < latLngSouthW.lng())) return;
                    
                    if (latLngNorthE.lng() > 0 && (item.lng() > 0 && item.lng() > latLngNorthE.lng())) return;
                    if (latLngNorthE.lng() < 0 && (item.lng() < 0 && item.lng() > latLngNorthE.lng())) return;
                    
                
            
        
        setIconNotDraggable : function(){

        uploadPinIcon : function (){
                
            if (validateFileType != ''){
        
        uploadPinPicture : function (){
            if (document.getElementById('pinimage').value === "") return;
                
            if (validateFileType != ''){
            
            if (bContinue == true){
    
Fixed code: #easy2mapslidertext {display:none;text-align:center;position:absolute;width:100%;top:15px;z-index:999;border-color:transparent;border-radius:0px;border-style:solid;border-width:1px;text-shadow:#171717 0.1em 0.1em 0.1em;background-color:transparent;white-space:nowrap;}
<div id="div_edit_textalign" style="width:600px;" 
     class="modal hide fade" tabindex="-1" 
     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
        <h3>Alter Style Value</h3>
    </div>
    <div class="modal-body" style="max-height: 300px">
        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_textalign" name="txtDefaultValue_textalign">
            <option value="left">Left</option>
            <option value="center">Center</option> 
            <option value="right">Right</option>
        </select> 
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
    </div>
</div>

<div id="div_edit_fontweight" style="width:600px;" 
     class="modal hide fade" tabindex="-1" 
     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
        <h3>Alter Style Value</h3>
    </div>
    <div class="modal-body" style="max-height: 300px;font-w">
        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_fontweight" name="txtDefaultValue_fontweight">
            <option value="normal">Normal</option>
            <option value="bold">Bold</option> 
            <option value="bolder">Bolder</option>
            <option value="lighter">Lighter</option>
        </select> 
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
    </div>
</div>

<div id="div_edit_em" style="width:600px" 
     class="modal hide fade" tabindex="-1" 
     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
        <h3>Alter Style Value</h3>
    </div>
    <div class="modal-body" style="max-height: 300px">
        <select class="Heading3" style="width:200px;height:28px" id="txtDefaultValue_em" name="txtDefaultValue_em">
            <option value="0.1em">0.1em</option>
            <option value="0.15em">0.15em</option>
            <option value="0.2em">0.2em</option>
            <option value="0.25em">0.25em</option>
            <option value="0.3em">0.3em</option>
            <option value="0.35em">0.35em</option>
            <option value="0.4em">0.4em</option>
            <option value="0.45em">0.45em</option>
            <option value="0.5em">0.5em</option>
            <option value="0.55em">0.55em</option>
            <option value="0.6em">0.6em</option> 
            <option value="0.65em">0.65em</option>
            <option value="0.7em">0.7em</option>
            <option value="0.75em">0.75em</option>
            <option value="0.8em">0.8em</option>
            <option value="0.85em">0.85em</option>
            <option value="0.9em">0.9em</option>
            <option value="0.95em">0.95em</option>
            <option value="1.0em">1.0em</option>
            <option value="1.05em">1.05em</option>
            <option value="1.1em">1.1em</option>
            <option value="1.15em">1.15em</option>
            <option value="1.2em">1.2em</option>
            <option value="1.25em">1.25em</option>
            <option value="1.3em">1.3em</option>
            <option value="1.35em">1.35em</option>
            <option value="1.4em">1.4em</option>
            <option value="1.45em">1.45em</option>
            <option value="1.5em">1.5em</option>
            <option value="1.55em">1.55em</option>
            <option value="1.6em">1.6em</option> 
            <option value="1.65em">1.65em</option>
            <option value="1.7em">1.7em</option>
            <option value="1.75em">1.75em</option>
            <option value="1.8em">1.8em</option>
            <option value="1.85em">1.85em</option>
            <option value="1.9em">1.9em</option>
            <option value="1.95em">1.95em</option>
            <option value="2.0em">2.0em</option>
            <option value="2.1em">2.1em</option>
            <option value="2.2em">2.2em</option>
            <option value="2.3em">2.3em</option>
            <option value="2.4em">2.4em</option>
            <option value="2.5em">2.5em</option>
            <option value="2.6em">2.6em</option> 
            <option value="2.7em">2.7em</option>
            <option value="2.8em">2.8em</option>
            <option value="2.9em">2.9em</option>
            <option value="3.0em">3.0em</option>
        </select> 
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
    </div>
</div>

<div id="div_edit_fontfamily" style="width:600px" 
     class="modal hide fade" tabindex="-1" 
     role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
        <h3>Alter Style Value</h3>
    </div>
    <div class="modal-body" style="max-height: 300px">
        <select class="Heading3" style="width:300px;height:28px" id="txtDefaultValue_fontfamily" name="txtDefaultValue_fontfamily">
            <option value="Georgia, serif">Georgia, serif</option>
            <option value='Palatino, serif'>Palatino, serif</option> 
            <option value='Times, serif'>Times, serif</option>
            <option value='Arial, Helvetica, sans-serif'>Arial, Helvetica, sans-serif</option>
            <option value="Gadget, sans-serif">Gadget, sans-serif</option>
            <option value="cursive, sans-serif">cursive, sans-serif</option>
            <option value="Impact, Charcoal, sans-serif">Impact, Charcoal, sans-serif</option>
            <option value="Tahoma, Geneva, sans-serif">Tahoma, Geneva, sans-serif</option>
            <option value="Helvetica, sans-serif">Helvetica, sans-serif</option>
            <option value="Verdana, Geneva, sans-serif">Verdana, Geneva, sans-serif</option>
            <option value="Courier, monospace">Courier, monospace</option>
            <option value="Monaco, monospace">Monaco, monospace</option>
        </select> 
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmap_functions.saveItemValue();" aria-hidden="true">Save changes</button>
    </div>
</div>

    //MERCURIAL COMMIT TEST 2
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',
            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#faf9f9\" background-color=\"#faf9f9\" />',

            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',



            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',

            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',

            '<settings font-weight=\"bold\" color=\"#FFFFFF\" font-size=\"0.9em\" font-family=\"Arial, Helvetica, sans-serif\" width=\"520px\" height=\"390px\" border-style=\"solid\" border-radius=\"0px\" border-width=\"1px\" border-color=\"#272727\" background-color=\"#faf9f9\" />',

            $SQLInsert15 = "UPDATE `$map_templates_table`

            $wpdb->query($SQLInsert15);

            $SQLInsert16 = "UPDATE `$map_templates_table`
            $wpdb->query($SQLInsert16);
            include('CopyMapSettings.php');
        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "copymapsettings") == 0 && isset($_GET["map_id"])) {
            include('CopyMapSettings.php');
        } else if (isset($_GET["action"]) && strcasecmp($_GET["action"], "photoimport") == 0 && isset($_GET["map_id"])) {
            include('ZipPhotoImport.php');

        if (strlen($code) == "")
            $code = get_option('phe_171323_transient_17666766');

        $wpdb->query($wpdb->prepare("UPDATE $mapsTable
            $wpdb->query($wpdb->prepare("
                    stripcslashes(urldecode($_REQUEST['mapSettingsXML'])), 
                    stripcslashes(urldecode($_REQUEST["parentCSSXML"])),
                    stripcslashes(urldecode($_REQUEST["photoCSSXML"])), 
                    stripcslashes(urldecode($_REQUEST["mapCSSXML"])), 
                    stripcslashes(urldecode($_REQUEST["mapHTML"])), $mapID));
            if (!$wpdb->query($wpdb->prepare("
                    stripcslashes(urldecode($_REQUEST['mapSettingsXML'])), 
                    stripcslashes(urldecode($_REQUEST["parentCSSXML"])), 
                    stripcslashes(urldecode($_REQUEST["photoCSSXML"])), 
                    stripcslashes(urldecode($_REQUEST["mapCSSXML"])), 
                    stripcslashes(urldecode($_REQUEST["mapHTML"]))))) {
        $wpdb->query($wpdb->prepare("
function extractLocationFromImageExif($uploadedFile) {

    $arrImage = array();
    $arrResult = array(0, 0);
    $lat = 0;
    $lng = 0;

    try {

        if (extension_loaded('exif')) {
            $arrImage = exif_read_data($uploadedFile, 0, true);
        }

        if (isset($arrImage['GPS'])) {

            $GPS = $arrImage['GPS'];

            if (isset($GPS['GPSLatitudeRef']) && isset($GPS['GPSLatitude'])) {

                //LATITUDE
                $LatitudeRef = $GPS['GPSLatitudeRef'];
                $Latitude = $GPS['GPSLatitude'];

                $arrLatDegrees = explode("/", $Latitude[0]);
                $arrLatMinutes = explode("/", $Latitude[1]);
                $arrLatSeconds = explode("/", $Latitude[2]);

                $latDegrees = floatval($arrLatDegrees[0] / $arrLatDegrees[1]);
                $latMinutes = floatval($arrLatMinutes[0] / $arrLatMinutes[1]);
                $latSeconds = floatval($arrLatSeconds[0] / $arrLatSeconds[1]);

                //LONGITUDE
                $LongitudeRef = $GPS['GPSLongitudeRef'];
                $Longitude = $GPS['GPSLongitude'];

                $arrLngDegrees = explode("/", $Longitude[0]);
                $arrLngMinutes = explode("/", $Longitude[1]);
                $arrLngSeconds = explode("/", $Longitude[2]);

                $lngDegrees = floatval($arrLngDegrees[0] / $arrLngDegrees[1]);
                $lngMinutes = floatval($arrLngMinutes[0] / $arrLngMinutes[1]);
                $lngSeconds = floatval($arrLngSeconds[0] / $arrLngSeconds[1]);

                $lat = DMStoDEC($latDegrees, $latMinutes, $latSeconds);
                if (strcasecmp($LatitudeRef, "S") === 0)
                    $lat = -1 * $lat;

                $lng = DMStoDEC($lngDegrees, $lngMinutes, $lngSeconds);
                if (strcasecmp($LongitudeRef, "W") === 0)
                    $lng = -1 * $lng;
            }
        }
    } catch (Exception $e) {
        
    }

    $arrResult = array($lat, $lng);
    return $arrResult;
}

function DMStoDEC($deg, $min, $sec) {

// Converts DMS ( Degrees / minutes / seconds ) 
// to decimal format longitude / latitude

    return $deg + ((($min * 60) + ($sec)) / 3600);
}


                                                                                                                <button onclick="window.location='?page=easy2mapimg&action=viewMaps'" type="button" 
                                                                                                                        style="margin-left:30px;width:100px;" 
                                                                                                                        class="btn">Back</button> 
                                    
                                    
                                    <tr id="zipUpload" style="display:none;"><td align="center" style="text-align:center" colspan="2">
                                        
                                        
                                        <h5><a href="#" onclick="document.formPhotoImport.photoSize.value=document.formAddPinImage.photoSize.value;jQuery('#mapZipImport').modal();">Upload  Zip File of Geotagged Images</a></h5>
                                        
                                        
                                    </tr>
</form>
<form name="formPhotoImport" 
      enctype="multipart/form-data"
      target="frameAddPinIcon" 
      id="formPhotoImport"
      onsubmit="return easy2map_imgmappin_functions.uploadZippedFile();"
      action="?page=easy2mapimg&action=photoimport&map_id=<?php echo $mapID; ?>"
      method="post">
    
    

    <div id="mapZipImport" style="width:600px" 
         class="modal hide fade" tabindex="-1" 
         role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
            <h3>Upload Zip File of Geotagged Images</h3>
        </div>
        <div class="modal-body" style="max-height: 400px">

            <input type="hidden" name="photoSize" value="<?php echo $_REQUEST["photoSize"]; ?>" />

            <table style="background-color:#EBEBEB;width:60%;margin-left:auto;margin-right:auto;margin-top:10px;" cellspacing="3" cellpadding="3" class="table table-bordered">
                <tr>
                    <td class="instructions"><h5>Note: only geotagged images will be uploaded</h5>
                    </td>
                </tr>

                <tr><td align="center" style="text-align:center">

                        <h5><input type='file' name='zipfile' 
                                   id='zipfile' 
                                   size='30' style="width:300px;vertical-align:middle;"
                                   acceptedFileList='ZIP'
                                   accept='zip/*'></h5>
                        <h6><i>(Only Valid ZIP Files Accepted)</i></h6>
                    </td></tr>
            </table>

        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" data-dismiss="modal" 
                    onclick="document.formPhotoImport.submit();"
                    aria-hidden="true">Upload Zip File</button>

        </div>
    </div>

</form>






<form name="formAddPinIcon" 
      target="frameAddPinIcon" 
      enctype="multipart/form-data" 
      id="formAddPinIcon"
      action="?page=easy2mapimg&action=mappiniconsave&map_id=<?php echo $mapID; ?>"
      method="post">

    <div id="mapPinIconList" style="width:600px" 
         class="modal hide fade" tabindex="-1" 
         role="dialog" aria-labelledby="winSettingsModalLabel" data-keyboard="true" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
            <h3>My map icons</h3>
        </div>
        <div class="modal-body" style="max-height: 400px">
            <h5>                
                <?php if (self::easy2MapPhotoCodeValidator('') === false) { ?>
                    <i>(Please upgrade to the Pro Version to upload your own custom icons)</i>
                    <br><br>
                <?php } else { ?>  
                    Upload own icon: 
                    <input type='file' name='pinicon' 
                           id='pinicon' 
                           size='30' style="width:300px;vertical-align:middle;"
                           acceptedFileList='JPG;JPEG;PJPEG;GIF;PNG;X-PNG'
                           accept='image/*'></h5>
                <h6><i>Valid image files accepted (.jpg, .png, .gif) with a maximum file size of 5MB.</i></h6>
            <?php } ?>
            <table style="width:96%" 
                   cellpadding="4" 
                   cellspacing="4" id="tblPinImages"></table>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <?php if (self::easy2MapPhotoCodeValidator('') === true) { ?><button class="btn btn-primary" data-dismiss="modal" onclick="easy2map_imgmappin_functions.uploadPinIcon()" aria-hidden="true">Upload Icon</button><?php } ?>
        </div>
    </div> 

</form>
                    
<form name="formRefresh" 
      id="formRefresh"
      action="?page=easy2mapimg&action=edit&map_id=<?php echo $mapID; ?>"
      method="post">                    
<div id="popupModalZipImport" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">Zip File Upload Result</h4>
                </div>
                <div class="modal-body">
                    <p style="font-size:1.5em;font-weight:bold;" id="resultMessage"></p>
                </div>
                <div class="modal-footer">
                    <button type="button" onclick="document.formRefresh.submit();" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</form>
var_dump($_REQUEST);

    $arrLatLng = extractLocationFromImageExif($uploadedFile);
    if (is_array($arrLatLng) && count($arrLatLng) == 2
            && is_numeric($arrLatLng[0])
            && is_numeric($arrLatLng[1]))
    {
        $lat = $arrLatLng[0];
        $lng = $arrLatLng[1];
   
  Version: 1.1.0 
Tested up to: 4.4.2
Stable tag: 1.1.0
= 1.1.0 = 
* Plugin made WP 4.2.2 compliant
* SQL injection vulnerabilities plugged

* Various fixes and enhancements

= 1.1.0 = 
* Plugin made WP 4.2.2 compliant
* SQL injection vulnerabilities plugged
                var templateID = parseInt(jQuery("#MapTemplateName").val());
                var proVersion = !!jQuery("#photoSize").attr("proVersion");
                for (var t = 0; t < $arrTemplates.length; t++) {
                    var template = $arrTemplates[t];
                    if (parseInt(template.ID) == templateID) {
                        jQuery('#divPreview').html(replaceAll(template.TemplateHTML, '[siteurl]', $pluginsURL));
                        if (proVersion === true)
                            jQuery('#easy2mapphotologo').remove();
                        jQuery('[id ^= styleElement]').each(function() {
                            jQuery('#divMapParent').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                        });
                        jQuery('[id ^= stylePhotoElement]').each(function() {
                            if (jQuery(this).attr('item') === "width") {
                                jQuery('#divMapParent').css("width", jQuery(this).attr('value'));
                                jQuery('#easy2mapmainimage').css("width", '');
                            } else {
                                jQuery('#easy2mapmainimage').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                            }
                        });
                        jQuery('[id ^= styleMapElement]').each(function() {
                            jQuery('#divMap').css(replaceAll(jQuery(this).attr('item'), "_", "-"), jQuery(this).attr('value'));
                        });
                        jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
                        jQuery("#easy2mapIimgShadow").width(jQuery("#divMapParent").width());
                        jQuery("#easy2mapIimgShadow").css('marginLeft', jQuery("#divMapParent").css('marginLeft'));
                        jQuery("#easy2mapIimgShadow").css('marginRight', jQuery("#divMapParent").css('marginRight'));
                    }
                }
                //save the map to the database if required to do so
                if (!!saveMapToDatabase) {
                    easy2map_imgmap_functions.saveMap(false, false);
                }
                easy2map_imgmap_functions.displayGoogleMap();
                google.maps.event.addDomListener(window, 'load', easy2map_imgmappin_functions.retrieveMapPoints());
            };
            
                case "font_family":
                    {
                        jQuery('#tdheading_fontfamily').html("Font Family");
                        jQuery('#div_edit_fontfamily').modal();
                        jQuery('#txtDefaultValue_fontfamily').val(value).focus();
                        break;
                    }

                case "text_align":
                    {
                        jQuery('#tdheading_textalign').html("Text Align");
                        jQuery('#div_edit_textalign').modal();
                        jQuery('#txtDefaultValue_textalign').val(value).focus();
                        break;
                    }

                case "font_weight":
                    {
                        jQuery('#tdheading_fontweight').html("Font Weight");
                        jQuery('#div_edit_fontweight').modal();
                        jQuery('#txtDefaultValue_fontweight').val(value).focus();
                        break;
                    }

                case "font_size":
                    {
                        jQuery('#tdheading_em').html("Font Size");
                        jQuery('#div_edit_em').modal();
                        jQuery('#txtDefaultValue_em').val(value).focus();
                        jQuery('#txtDefaultValue_em').val(type).prop('disabled', false);
                        break;
                    }

                case "color":
                    {
                        jQuery('#tdheading_color').html("Color");
                        jQuery('#div_edit_color').modal();
                        jQuery('#txtDefaultValue_color').val(value).focus();
                        jQuery('#txtDefaultValue_color').css('background-color', value);
                        jQuery('#colourpicker').attr('data-color', hexToRgb(value));
                        jQuery('#liDefaultValue_color').css('background-color', value);
                        break;
                    }

                case "font_family":
                    {
                        alteredValue = jQuery('#txtDefaultValue_fontfamily').val();
                        jQuery('#div_edit_fontfamily').hide();
                        break;
                    }

                case "text_align":
                    {
                        alteredValue = jQuery('#txtDefaultValue_textalign').val();
                        jQuery('#div_edit_textalign').hide();
                        break;
                    }
                case "font_weight":
                    {
                        alteredValue = jQuery('#txtDefaultValue_fontweight').val();
                        jQuery('#div_edit_fontweight').hide();
                        break;
                    }
                case "font_size":
                    {
                        alteredValue = jQuery('#txtDefaultValue_em').val();
                        jQuery('#div_edit_em').hide();
                        break;

                    }
                case "color":
                    {
                        alteredValue = jQuery('#txtDefaultValue_color').val();
                        jQuery('#tdItemElementValue').css('color', jQuery('#txtDefaultValue_color').val());
                        jQuery('#div_edit_color').hide();
                        break;
                    }
                    jQuery('#formPhotoImport').attr('action', '?page=easy2mapimg&action=photoimport&map_id=' + $mapID);
                    jQuery('#formRefresh').attr('action', '?page=easy2mapimg&action=edit&map_id=' + $mapID);
var easy2map_imgmappin_functions = (function() {

    clearPinArray = function() {

        if ($pinsArray)
            $pinsArray.length = 0;


    addPinToMap = function(objPointDetails) {
            position: new google.maps.LatLng(this.selectedMapPoint.lattitude, this.selectedMapPoint.longitude),
            draggable: true,
            map: $map,
            title: this.selectedMapPoint.title.replace(/\\/gi, ''),
            ID: this.selectedMapPoint.ID,
            icon: this.selectedMapPoint.icon,
            settings: this.selectedMapPoint.settings,
            small: this.selectedMapPoint.small,
            medium: this.selectedMapPoint.medium,
            large: this.selectedMapPoint.large,
            pinHTML: this.selectedMapPoint.pinhtml,
            pinText: this.selectedMapPoint.pintext,
            visible: false

        google.maps.event.addListener(marker, "dragend", function(mEvent) {

        google.maps.event.addListener(marker, "click", function(mEvent) {


            for (var i = 0; i < lines.length; i++) {
                if (i > 0)
                    pinContent += "<br>";

            //var infoWindow = new google.maps.InfoWindow();
            //infoWindow.setContent(pinContent);
            //infoWindow.open(marker.map, marker);

    clearTextOfAllFormatting = function(html) {

        if (html.indexOf('<p') != -1) {
        if (html.indexOf('[endif]') != -1) {


    listedMapPin = function(objPinDetails) {

    setPinImage = function(img) {


                if (!!$selectedPin == false)
                    continue;
                if (typeof $pinsArray[i].ID == "undefined" || typeof $selectedPin.ID == "undefined")
                    continue;
                if ($pinsArray[i].ID == $selectedPin.ID)
                    $pinsArray[i].setIcon(jQuery(img).attr('src'));

    showLatLong = function() {

    updateMapPinLocation = function(mapPinID) {

            type: 'POST',
            url: ajaxurl,
            dataType: 'json',
                mapPointID: mapPinID,
                latLong: $latlng + '',
                action: "e2m_img_update_map_pin_location"

        addNewMapMarker: function() {


        cancelSaveMapPin: function() {

            jQuery('#zipUpload').show();




            if (proVersion == false) {



            if ($selectedPin)
                $selectedPin.setAnimation(null);




        changeMapPinTemplate: function() {


            for (var t = 0; t < $arrTemplates.length; t++) {

                if (parseInt(template.ID) == templateID) {
                }
        deleteSelectedPoint: function() {

            if (!confirm('Are you sure you wish to delete this marker? This action is not reversible!'))
                return;
                type: 'POST',
                url: ajaxurl,
                dataType: 'json',
                    MapPointID: $mapPinID,
                success: function(returnData) {
                    if (returnData.length > 0) {

                    if ($pinsArray)
                        $pinsArray.length = 0;
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    if (errorThrown.length > 0)
                        alert(errorThrown);
        editPinItem: function(index) {

            for (i = 0; i < $pinsArray.length; i++) {


            setTimeout(function() {
            $map.setCenter($latlng);


            document.getElementById('MapTemplateName').style.visibility = 'hidden';



            jQuery('#pinImagePreview').attr('src', pinDetails.large);
            jQuery('#zipUpload').hide();



                'background-image': 'url(' + pinDetails.large + ')',
                'background-repeat': 'no-repeat',



        hidePreviewPage: function() {
        imageNotSuccessfullyUploaded: function() {

            if (document.getElementById('pinimage').value != "") {
                jQuery('#photoUploadError').modal();

        imageSuccessfullyUploaded: function(smallImage, mediumImage, largeImage, lat, lng) {

                'background-image': 'url(' + largeImage + ')',
                'background-repeat': 'no-repeat',

            for (i = 0; i < $pinsArray.length; i++) {

            jQuery('#zipUpload').show();
            jQuery('#zipUpload').hide();

            if (lat === 0 && lng === 0) {


                easy2map_imgmappin_functions.SetPinPosition(lat, lng);

            jQuery('#pinimage').val('');

        openImagesDirectory: function(selectedImage) {

                type: 'POST',
                url: ajaxurl,
                dataType: 'json',
                    mapID: $mapID,
                    action: 'e2m_img_retrieve_pin_icons'
                success: function(returnData) {
                    for (var i = 0; i < returnData.length; i++) {
                        if (iCounter % 6 == 0) {
                        var imageTd = document.createElement('td');
                        imageTd.align = "center";
                        imageTd.style.padding = "2px";
                        if (returnData[i] == selectedImage) {
                            imageTd.style.borderRadius = "3px"


                error: function(XMLHttpRequest, textStatus, errorThrown) {
        placePin: function(location, bounce) {

            for (i = 0; i < $pinsArray.length; i++) {

                position: location,
                ID: 0,
                draggable: true,
                bouncy: true,
                title: 'Click on icon to edit details',
                map: $map,
                icon: jQuery('#draggable').attr('src')


            if (!!bounce) {
                setTimeout(function() {





            google.maps.event.addListener(marker, "dragend", function(mEvent) {

            google.maps.event.addListener(marker, "click", function(mEvent) {


        retrieveMapPoints: function() {


                MapID: $mapID


                dataType: 'json',



                    if (typeof returnData == "undefined" || typeof returnData == "null")
                        noPinsFound = true;
                    if (!returnData)
                        noPinsFound = true;
                    if (returnData.length == 0)
                        noPinsFound = true;

                    if (noPinsFound) {

                    if ($markersArray)
                        $markersArray.length = 0;

                    for (var t = 0; t < returnData.length; t++) {

                            lattitude: arrLatLng[0],
                            longitude: arrLatLng[1],
                            ID: returnData[t].ID,
                            title: returnData[t].Title,
                            icon: returnData[t].ImageURL,
                            settings: returnData[t].Settings,
                            small: returnData[t].PinImageSmall,
                            medium: returnData[t].PinImageMedium,
                            large: returnData[t].PinImageLarge,
                            pinhtml: returnData[t].MapPinHTML,
                            pintext: returnData[t].MapPinText


                    for (var i = 0; i < $markersArray.length; i++) {


                        if (document.getElementById('Easy2MapSliderParent')) {








                    if (sliderImages.length > 0) {
                        jQuery.preloadImages(sliderImages, function initSliderImages() {


                    jQuery("#Easy2MapSliderParent li:first").each(function() {


                error: function(XMLHttpRequest, textStatus, errorThrown) {
        saveMapPin: function() {


            if (pinText.length > 0)
                pinHTML += "<div style='text-align:left;margin:0px;padding:0px;'>" + pinText + "</div>";



                type: 'POST',
                url: ajaxurl,
                dataType: 'json',
                    mapPointID: $mapPinID,
                    action: "e2m_img_save_map_pin",
                    latLong: $latlng + '',
                    icon: jQuery('#draggable').attr('src'),
                    pinTitle: '',
                    small: jQuery('#small').val(),
                    medium: jQuery('#medium').val(),
                    large: jQuery('#large').val(),
                    pinSettingsXML: '',
                    pinHTML: pinHTML,
                    pinText: pinText,
                    mapID: $mapID
                success: function(mapPinID) {
                error: function(XMLHttpRequest, textStatus, errorThrown) {

        setCurrentPosition: function(lat, lng) {
        setMapPinImage: function(img) {

                type: 'POST',
                url: ajaxurl,
                dataType: 'json',
                    MapID: $mapID,
                    PinImage: encodeURIComponent(jQuery(img).attr('src')),
                    action: "e2m_img_save_default_pin_image"
                success: function(returnImage) {
                error: function(XMLHttpRequest, textStatus, errorThrown) {
        SetPinPosition: function(lat, lng) {



                settings.zoom = $map.getZoom();
                    formatOutput: true,


            else
                $selectedPin.setPosition(location);

            setTimeout("jQuery('#address').val('')", 1500);
        setIconDraggable: function() {

            jQuery("#draggable").draggable({

                    var point = new google.maps.Point(e.pageX - position.left, e.pageY - position.top + 22);
                    if (latLngSouthW.lng() > 0 && (item.lng() > 0 && item.lng() < latLngSouthW.lng()))
                        return;
                    if (latLngSouthW.lng() < 0 && (item.lng() < 0 && item.lng() < latLngSouthW.lng()))
                        return;

                    if (latLngNorthE.lng() > 0 && (item.lng() > 0 && item.lng() > latLngNorthE.lng()))
                        return;
                    if (latLngNorthE.lng() < 0 && (item.lng() < 0 && item.lng() > latLngNorthE.lng()))
                        return;



        setIconNotDraggable: function() {
        uploadPinIcon: function() {

            if (validateFileType != '') {
        uploadZippedFile: function() {

            var validateFileType = checkFileExtensionSilent(document.getElementById('zipfile'));
            if (validateFileType !== '') {
                alert('Invalid file, only the following image types are allowed: ' + validateFileType + '. Please upload a different image.');
                return false;
            } else {
                return true;
            }
        },
        uploadZippedFileResult: function(successMessage){
            jQuery('#resultMessage').html(successMessage);
            jQuery('#popupModalZipImport').modal();
            
        },
        //verify that the pin icon is a valid image file
        uploadPinPicture: function() {

            if (document.getElementById('pinimage').value === "")
                return;

            if (validateFileType != '') {

            if (bContinue == true) {