Error parsing template "Designs/SSTemplate/_parsed/subpage.parsed.cshtml"
Line 464: (463:9) - Encountered end tag "div" with no matching start tag.  Are your start/end tags properly balanced?

1 @using System.Web.Mvc; 2 @using System.Text.RegularExpressions; 3 @using System.Web; 4 @using System.IO; 5 @using System.Linq; 6 @using Dynamicweb; 7 @{ 8 string basecss = "/Files/Templates/Designs/SSTemplate/css/base.css"; 9 string ifolder = basecss.Substring(0, basecss.LastIndexOf("/")).ToString(); 10 string ifolderOnDisk = System.Web.HttpContext.Current.Server.MapPath(ifolder); 11 DirectoryInfo idirectoryInfo = new System.IO.DirectoryInfo(ifolderOnDisk); 12 string idatefetch=@idirectoryInfo+"\\base.css"; 13 DateTime ilastmodified = File.GetLastWriteTime(@idatefetch); 14 basecss=@basecss+"?modified="+@ilastmodified.ToString("yyyy-MM-ddTHH:mm:ss"); 15 string stylecss = "/Files/Templates/Designs/SSTemplate/css/styles.css"; 16 string ufolder = stylecss.Substring(0, stylecss.LastIndexOf("/")).ToString(); 17 string ufolderOnDisk = System.Web.HttpContext.Current.Server.MapPath(ufolder); 18 DirectoryInfo udirectoryInfo = new System.IO.DirectoryInfo(ufolderOnDisk); 19 string udatefetch=@udirectoryInfo+"\\styles.css"; 20 DateTime ulastmodified = File.GetLastWriteTime(@udatefetch); 21 stylecss=@stylecss+"?modified="+@ulastmodified.ToString("yyyy-MM-ddTHH:mm:ss"); 22 string breadactive=""; 23 }@if(GetBoolean("Item.ShowBradcrumbs") == true) { 24 breadactive="breadactive"; 25 }@{ 26 string logo=@GetString("Item.Area.Design.Logo"); 27 }<!DOCTYPE html> 28 <html lang="fo">@{ 29 string pageid=@GetString("DwPageID"); 30 string readspeak=@GetString("Item.Area.Funktionalitetir.BaseUr")+"?id="+pageid; 31 string pagenametit=@GetString("DwPageName"); 32 string pagearea=@GetString("DwPageID_1"); 33 pagearea="top"+pagearea; 34 ViewBag.BaseUrl = @GetString("Item.Area.Funktionalitetir.BaseUr"); 35 ViewBag.StoddStarvs = @GetString("Item.Page.StoddStarv"); 36 }<head> 37 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 38 <meta charset="utf-8"> 39 40 <meta name="viewport" content="width=device-width, initial-scale=1"> 41 42 <meta name="author" content=""> 43 <meta property="og:url" content="@readspeak"> 44 <meta property="og:locale" content="fo_FO"> 45 <meta property="og:description" content="@GetString(" meta.description")"=""> 46 <meta property="og:type" content="website"> 47 <meta property="og:locale" content="fo_FO"> 48 <meta property="og:title" content="@pagenametit"> 49 <meta name="google-site-verification" content="_8UkOXR321xXc60VV1folaRbl3pukMQpv1ifNUwjZXU"> 50 @RenderSnippet("FBimg") 51 <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600" rel="stylesheet"> 52 <link href="https://fonts.googleapis.com/css?family=Muli:400,400i,700,700i" rel="stylesheet"> 53 <!-- <link rel="stylesheet" href="https://d1azc1qln24ryf.cloudfront.net/136306/Apoteksverkid/style-cf.css?319v5o"> --> 54 <link rel="stylesheet" href="https://cdn.icomoon.io/136306/Apoteksverkid/style-cf.css?fcds4f"> 55 <link rel="shortcut icon" type="image/ico" href="/Files/Templates/Designs/SSTemplate/img/favicon.ico"> 56 <link rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/bootstrap.min.css"> 57 <link rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/meanmenu.css?build=25"> 58 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/lightgallery/css/lightgallery.css"> 59 <link rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/tablesaw.css"> 60 <link rel="stylesheet" href="@basecss"> 61 <link rel="stylesheet" href="@stylecss"> 62 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/base-mobil.css"> 63 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/styles-mobil.css"> 64 <script type="text/javascript" src="/Files/Templates/Designs/SSTemplate/Fontur/Javascript-2/Apotek.fo.js"></script> 65 66 @RenderParagraphContent(441) 67 @GetString("Item.CustomCode") 68 <meta name="google-site-verification" content="yk970pDKLw2g6gpmOki6lHB2xFurox3LU0O1L3uExJ0"> 69 <style> 70 #menu{ 71 position:relative;} 72 #searchform-desktop{ 73 position:absolute; 74 left:0px; 75 width:100%; 76 display:none; 77 } 78 79 #searchform-desktop{ 80 z-index:100; 81 82 } 83 #searchform-desktop input{ 84 85 border-radius: 3px; 86 background: #FFF; 87 border:none !important; 88 89 /* shadow */ 90 box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05); 91 92 left:0px; 93 width:100%; 94 height:56px; 95 line-height:56px; 96 top:-2px; 97 position:relative; 98 padding:0px 50px 0px 15px; 99 } 100 .lup{ 101 position:absolute; 102 right:12px; 103 top:50%; 104 margin-top:-17px;} 105 .lup:hover{cursor:pointer;} 106 </style> 107 @GetValue("CopyRightNotice") 108 @GetValue("MetaTags") 109 @GetValue("Stylesheets") 110 @GetValue("Javascripts") 111 </head> 112 @{ 113 string bodyclass="sida"+@GetInteger("DwPageID").ToString(); 114 } 115 116 <body class="@breadactive @bodyclass relative"> 117 118 119 120 <script src="https://consent.cookiefirst.com/banner.js" data-cookiefirst-key="80fbdf87-db0c-4a95-a933-cbf276ddc4fb"></script> 121 122 123 124 125 126 127 128 <div class="megamenitem megaheiluvagur Heilivágur"> 129 <div class="container"> 130 <div class="row"> 131 <div class="col-3"> 132 @RenderPageContent(251) 133 </div> 134 <div class="col-3"> 135 @RenderPageContent(252) 136 </div> 137 <div class="col-3"> 138 @RenderPageContent(253) 139 </div> 140 <div class="col-3"> 141 @RenderPageContent(254) 142 </div> 143 </div> 144 </div> 145 </div> 146 147 <div class="megamenitem megamedisinskutgerd Medicinskútgerð" style="display:none;"> 148 <div class="container"> 149 <div class="row"> 150 <div class="col-3"> 151 @RenderPageContent(677) 152 </div> 153 <div class="col-3"> 154 @RenderPageContent(678) 155 </div> 156 <div class="col-3"> 157 @RenderPageContent(679) 158 </div> 159 <div class="col-3"> 160 @RenderPageContent(680) 161 </div> 162 </div> 163 </div> 164 </div> 165 166 <div class="megamenitem megagodrad Heilsa"> 167 <div class="container"> 168 <div class="row"> 169 <div class="col-3"> 170 @RenderPageContent(259) 171 </div> 172 <div class="col-3"> 173 @RenderPageContent(261) 174 </div> 175 <div class="col-3"> 176 @RenderPageContent(260) 177 </div> 178 <div class="col-3"> 179 @RenderPageContent(263) 180 @RenderPageContent(264) 181 </div> 182 </div> 183 </div> 184 </div> 185 186 <div class="megamenitem megaheilsutaenastur Heilsutænastur"> 187 <div class="container"> 188 <div class="row"> 189 <div class="col-3"> 190 191 </div> 192 <div class="col-3"> 193 194 </div> 195 <div class="col-3"> 196 @RenderPageContent(265) 197 </div> 198 <div class="col-3"> 199 @RenderPageContent(266) 200 </div> 201 </div> 202 </div> 203 </div> 204 205 <div class="megamenitem megaheilsutaenastur Umokkum"> 206 <div class="container"> 207 <div class="row"> 208 <div class="col-3"> 209 @RenderPageContent(255) 210 </div> 211 <div class="col-3"> 212 @RenderPageContent(256) 213 </div> 214 <div class="col-3"> 215 @RenderPageContent(257) 216 </div> 217 <div class="col-3"> 218 @RenderPageContent(258) 219 </div> 220 </div> 221 </div> 222 </div> 223 224 225 226 <div class="mynav d-md-none d-lg-none d-xl-none"> 227 @GetValue("DwNavigation(mobmen)") 228 229 </div><!-- #dl-menu end --> 230 231 232 @GetString("Item.Area.FacebookJaascriptSDK") 233 <div class="toptopmenu container d-none d-sm-none d-md-block"> 234 <div class="row"> 235 236 237 238 <div class="col-2"><a class="toplanglink" href="/default.aspx?id=299">EN</a> / <a class="toplanglink" href="/default.aspx?id=192"> DK</a></div> 239 240 <div class="col-10 textright"> 241 242 @{ 243 bool vorurikurv=false; 244 bool solustadikurv=false; 245 int amountikurv=0; 246 string kurvid="354"; 247 } 248 249 @foreach(LoopItem i in GetLoop("OrderContextCarts")){ 250 <text> 251 @if(@i.GetString("Ecom:OrderContext.ID")=="Solustod"){ 252 <text> 253 @if(@i.GetInteger("Ecom:Order.OrderLines.TotalQuantity")!=0){ 254 amountikurv=@i.GetInteger("Ecom:Order.OrderLines.TotalQuantity"); 255 vorurikurv=true; 256 solustadikurv=true; 257 kurvid="288"; 258 } 259 </text> 260 } 261 </text> 262 } 263 264 @if(@solustadikurv!=true){ 265 <text> 266 @foreach(LoopItem i in GetLoop("OrderContextCarts")){ 267 <text> 268 @if(@i.GetInteger("Ecom:Order.OrderLines.TotalQuantity")!=0){ 269 amountikurv=@i.GetInteger("Ecom:Order.OrderLines.TotalQuantity"); 270 vorurikurv=true; 271 } 272 </text> 273 } 274 </text> 275 276 } 277 278 279 280 @if(@amountikurv!=0){ 281 <a class="minicart" href="/default.aspx?id=@kurvid"> 282 <span class="counter">@amountikurv</span> 283 <span class="icon-cart"></span> 284 <span class="minkurv">Mín kurv</span> 285 </a> 286 } 287 288 @GetValue("DwNavigation(leftnavigation)") 289 290 </div> 291 </div> 292 </div> 293 294 <nav class="navbar navbar-expand-md mt-2 mb-2 d-none d-sm-none d-md-block"> 295 <div class="container"> 296 <a class="navbar-brand" href="#"><img class="img-fluid mainlogo" src="@logo"></a> 297 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample04" aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation"> 298 <span class="navbar-toggler-icon"></span> 299 </button> 300 301 <div class="collapse navbar-collapse hide" id="menu"> 302 @GetValue("DwNavigation(topmen1)") 303 <div class="search-trigger"> 304 305 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none"> 306 <path fill-rule="evenodd" clip-rule="evenodd" d="M15.5587 5.11321C14.1162 3.67069 12.3695 2.94547 10.336 2.94547C8.30239 2.94547 6.55569 3.67069 5.11318 5.11321C3.67066 6.55572 2.94543 8.30242 2.94543 10.336C2.94543 12.3695 3.67066 14.1162 5.11318 15.5588C6.55569 17.0013 8.30239 17.7265 10.336 17.7265C11.9667 17.7265 13.4426 17.2404 14.7553 16.2715L19.2049 20.7211C19.3876 20.9343 19.6538 21.0546 19.9637 21.0546C20.2634 21.0546 20.5275 20.9473 20.7373 20.7396C20.9473 20.5276 21.0545 20.2634 21.0545 19.9637C21.0545 19.6539 20.9343 19.3877 20.7034 19.1885L16.2714 14.7553C17.2404 13.4426 17.7265 11.9668 17.7265 10.336C17.7265 8.30242 17.0012 6.55572 15.5587 5.11321ZM14.3323 14.3324C13.2275 15.4372 11.9025 15.9853 10.336 15.9853C8.76945 15.9853 7.44443 15.4372 6.33956 14.3324C5.23469 13.2275 4.68663 11.9025 4.68663 10.336C4.68663 8.76948 5.23469 7.44446 6.33956 6.33959C7.44443 5.23472 8.76945 4.68666 10.336 4.68666C11.9025 4.68666 13.2275 5.23472 14.3323 6.33959C15.4372 7.44446 15.9853 8.76948 15.9853 10.336C15.9853 11.9025 15.4372 13.2275 14.3323 14.3324Z" fill="white"></path> 307 </svg> 308 </div> 309 <div id="searchform-desktop" style="display:none;"> 310 <input class="desktopSearchInput" type="text" alt=""> 311 <div class="lup"> 312 <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewbox="0 0 23 23" fill="none"> 313 <path fill-rule="evenodd" clip-rule="evenodd" d="M14.9105 4.90014C13.5281 3.51773 11.8541 2.82272 9.9053 2.82272C7.95647 2.82272 6.28255 3.51773 4.90014 4.90014C3.51773 6.28255 2.82272 7.95647 2.82272 9.9053C2.82272 11.8541 3.51773 13.5281 4.90014 14.9105C6.28255 16.2929 7.95647 16.9879 9.9053 16.9879C11.4681 16.9879 12.8825 16.5221 14.1405 15.5935L18.4047 19.8577C18.5798 20.0621 18.8349 20.1773 19.1319 20.1773C19.4191 20.1773 19.6722 20.0745 19.8733 19.8754C20.0745 19.6722 20.1773 19.4191 20.1773 19.1319C20.1773 18.8349 20.0621 18.5798 19.8407 18.389L15.5934 14.1405C16.5221 12.8825 16.9879 11.4681 16.9879 9.9053C16.9879 7.95647 16.2929 6.28255 14.9105 4.90014ZM13.7352 13.7352C12.6763 14.794 11.4065 15.3192 9.9053 15.3192C8.40408 15.3192 7.13426 14.794 6.07543 13.7352C5.0166 12.6763 4.49137 11.4065 4.49137 9.9053C4.49137 8.40408 5.0166 7.13426 6.07543 6.07543C7.13426 5.0166 8.40408 4.49137 9.9053 4.49137C11.4065 4.49137 12.6763 5.0166 13.7352 6.07543C14.794 7.13426 15.3192 8.40408 15.3192 9.9053C15.3192 11.4065 14.794 12.6763 13.7352 13.7352Z" fill="#333333"></path> 314 </svg> 315 </div> 316 </div> 317 318 319 </div> 320 </div> 321 </nav> <!--- NAVIGATION ---> 322 323 324 @if(GetBoolean("Item.ShowBradcrumbs") == true || GetBoolean("Item.ApotekSida")==true) 325 {<text> 326 <div class="container-fluid mb-0 bread bread-parent"> 327 <div class="container"> 328 <div class="row"> 329 <div class="bread col my-2"> 330 @GetValue("DwNavigation(bread)") 331 </div> 332 </div> 333 </div> 334 </div> 335 </text> 336 } 337 <!--- BREADCRUMB ---> 338 339 @using System.Text.RegularExpressions; 340 @using System.Web; 341 342 343 @{ 344 string mynd=@GetString("Item.Area.Design.FacebookDeilFallback"); 345 } 346 @if(!String.IsNullOrEmpty(@GetString("Item.FacebookDeilMynd"))){ 347 mynd = @GetString("Item.FacebookDeilMynd"); 348 } 349 350 351 @SnippetStart("FBimg") 352 <meta property="og:image" content="@ViewBag.BaseUrl@mynd"> 353 @SnippetEnd("FBimg") 354 355 356 <div class="container"> 357 <div class="row"> 358 <div class="col-sm-3 d-none d-sm-none d-md-block"> 359 @if(GetString("Item.Area.Design.Vinstramenu")=="Leftmen1"){ 360 <text> 361 <nav class="nav flex-column"> 362 @GetValue("DwNavigation(leftmen1)") 363 </nav> 364 </text> 365 } 366 367 @if(GetString("Item.Area.Design.Vinstramenu")=="Leftmen2"){ 368 <text> 369 <nav class="nav flex-column"> 370 @GetValue("DwNavigation(leftmen2)") 371 </nav> 372 </text> 373 } 374 </div> <!--- SIDEBAR MENU ---> 375 376 <div class="col-sm-9 col-12" id="subpage-hogra">@GetValue("DwContent(subpagehogra)")</div> 377 <div class="container"> 378 <div class="col-12 text-center"> 379 <a class="scrolltop"> <span class="icon-backtotop"><span class="path1"></span><span class="path2"></span></span></a> 380 </div> 381 </div> 382 383 384 385 386 387 388 <style> 389 .footerAniversary{ 390 background-color: #04163F; 391 display:flex; 392 width:100%; 393 align-items:center; 394 justify-content:center; 395 padding:50px 0px; 396 margin-top:150px; 397 } 398 .search-trigger:hover{ 399 cursor:pointer; 400 } 401 .search-trigger{ 402 403 position: absolute; 404 405 right: 10px; 406 407 top: 28px; 408 } 409 </style> 410 @if(GetBoolean("Item.ApotekAniversary")){ 411 <style> 412 .scrolltop{ 413 display:none !important;} 414 </style> 415 <div class="container-fluid footerAniversary"> 416 <img src="/Files/Templates/Designs/SSTemplate/img/footer-logo.svg" alt=""> 417 </div> 418 } 419 else{ 420 <text> 421 422 423 <div class="container-fluid footer"> 424 <div class="container relative"> 425 @if(!String.IsNullOrEmpty(@GetString("Item.SeinastDagfort"))){ 426 <text> 427 428 <div class="seinastdagfort">Dagført @GetDate("Item.SeinastDagfort").ToString("dd'/'MM'/'yyyy")</div> 429 </text> 430 } 431 432 <div class="row "> 433 434 <div class="col-xl-3 col-md-12 col-sm-12 col-12 mt-5"> 435 @RenderParagraphContent(27) 436 </div> 437 <div class="col-xl-3 col-md-6 col-sm-6 col-12 mt-5"> 438 @RenderParagraphContent(28) 439 </div> 440 <div class="col-xl-3 col-md-6 col-sm-6 col-12 mt-5"> 441 @RenderParagraphContent(1055) 442 </div> 443 <div class="col-xl-3 col-md-12 col-sm-12 col-12 mt-5"> 444 @RenderParagraphContent(30) 445 446 </div> 447 <div class="col-md-3 col-sm-3 col-12 mt-5 text-right hide"> 448 <a href="https://www.facebook.com/Tjaldursapotek/" target="_blank"><span class="icon-facebook-footer"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span></a> 449 </div> 450 </div> 451 </div> 452 </div> 453 454 </text> 455 <div class="container-fluid footerbottom"> 456 <div class="container"> 457 <div class="row"> 458 <div class="col-12 text-center"> 459 <a class="kolofon" target="_blank" href="//www.sendistovan.fo"><img src="/Files/Templates/Designs/SSTemplate/img/kolofon.svg" alt="Sendistovan">Ein loysn frá Sendistovuni</a> 460 </div> 461 </div> 462 </div> 463 </div> 464 </div> 465 </div> 466 } 467 <div class="mob-search"> 468 <form method="post" action="?id=47" id="mob-searchform"> 469 <input type="submit" class="hide"> 470 <input class="mobinput" name="q" type="text" placeholder="Leita á apotek.fo"><span class="icon-search mob-searchicon mob-submit"></span> 471 <span class="icon-menu-close mob-search-close"></span> 472 473 </form> 474 </div> 475 476 @{ 477 string prodtransl="vørur"; 478 string logdtrans="lagdar"; 479 } 480 @if(@amountikurv==1) { 481 prodtransl="vøra"; 482 logdtrans="løgd"; 483 } 484 @if(@amountikurv!=0){ 485 <text> 486 487 <a class="mobuppl d-md-none d-lg-none d-xl-none" href="/default.aspx?id=@kurvid"> 488 <span class="icon-cart"></span> @amountikurv @prodtransl @logdtrans í keypskurv 489 </a> 490 491 </text> 492 } 493 else{ 494 495 <a href="/?id=399" class="mobuppl d-md-none d-lg-none d-xl-none"> 496 <span class="icon-location"></span> Upplatingartíðir 497 </a> 498 } 499 500 501 502 <div class="mobilmenpush hide"> 503 504 @GetValue("DwNavigation(mobtoptopnav)") 505 506 507 </div> 508 509 510 <script src="/Files/Templates/Designs/SSTemplate/js/tablesaw.js"></script> 511 <script src="/Files/Templates/Designs/SSTemplate/js/tablesaw-init.js"></script> 512 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 513 514 515 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> 516 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lightgallery.min.js"></script> 517 518 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-thumbnail.js"></script> 519 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-zoom.js"></script> 520 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-video.js"></script> 521 <script src="/Files/Templates/Designs/SSTemplate/js/meanmenu.js?build=24"></script> 522 <script src="/Files/Templates/Designs/SSTemplate/js/ssscript.js?v=2"></script> 523 <script> 524 // Find all elements with the classname "megalink" 525 var elements = document.getElementsByClassName("mega-link"); 526 527 // Iterate through each element 528 for (var i = 0; i < elements.length; i++) { 529 var element = elements[i]; 530 531 // Get the current value of the "rel" parameter 532 var rel = element.getAttribute("rel"); 533 534 // Remove whitespace from the "rel" parameter 535 var updatedRel = rel.replace(/\s/g, ""); 536 537 // Update the "rel" parameter with the whitespace removed 538 element.setAttribute("rel", updatedRel); 539 } 540 </script> 541 542 @GetString("Item.Area.Funktionalitetir.FacebookTrackingPixul") 543 544 545 <script> 546 // JavaScript 547 document.addEventListener('DOMContentLoaded', function() { 548 // Get the input field and the "lup" div 549 const searchInput = document.querySelector('.desktopSearchInput'); 550 const lupDiv = document.querySelector('.lup'); 551 552 // Function to redirect with the query parameter 553 function searchRedirect() { 554 const query = searchInput.value.trim(); // Get the value and trim any whitespace 555 if (query) { 556 // Redirect to the new URL with the 'q' parameter 557 window.location.href = `/default.aspx?id=47&q=${encodeURIComponent(query)}`; 558 } 559 } 560 561 // Add 'keydown' event listener for the 'Enter' key 562 searchInput.addEventListener('keydown', function(event) { 563 if (event.key === 'Enter') { 564 searchRedirect(); 565 } 566 }); 567 568 // Add 'click' event listener to the "lup" div 569 lupDiv.addEventListener('click', function() { 570 searchRedirect(); 571 }); 572 }); 573 </script> 574 575 <script> 576 // Wait until the DOM is fully loaded 577 document.addEventListener("DOMContentLoaded", function() { 578 // Select the element with the class "search-trigger" 579 const searchTrigger = document.querySelector('.search-trigger'); 580 // Select the element with the ID "searchform-desktop" 581 const searchFormDesktop = document.getElementById('searchform-desktop'); 582 // Select the input field with the class "desktopSearchInput" 583 const desktopSearchInput = document.querySelector('.desktopSearchInput'); 584 585 // Add a click event listener to the search-trigger element 586 if (searchTrigger && searchFormDesktop && desktopSearchInput) { 587 searchTrigger.addEventListener('click', function() { 588 // Set the display of #searchform-desktop to block 589 searchFormDesktop.style.display = 'block'; 590 // Focus the input field with class "desktopSearchInput" 591 desktopSearchInput.focus(); 592 }); 593 594 // Add a click event listener to the document to hide searchFormDesktop when clicking outside 595 document.addEventListener('click', function(event) { 596 // Check if the click is outside the #searchform-desktop and the .search-trigger 597 if (searchFormDesktop.style.display === 'block' && !searchFormDesktop.contains(event.target) && !searchTrigger.contains(event.target)) { 598 // Set the display of #searchform-desktop to none (hide it) 599 searchFormDesktop.style.display = 'none'; 600 } 601 }); 602 } 603 }); 604 605 </script> 606 607 608 <script> 609 document.addEventListener('DOMContentLoaded', function () { 610 // Function to handle hover and click events 611 function handleLinkEvents(relValue, pageId) { 612 const $link = $('a[rel="' + relValue + '"]'); 613 const $megamenItems = $('.megamenitem'); 614 615 // Click event handler 616 $link.on('click', function (event) { 617 event.preventDefault(); // Prevent default anchor behavior 618 window.location.href = '/default.aspx?id=' + pageId; // Redirect to the given page id 619 }); 620 621 // Hover event handler (mouseenter and mouseleave) 622 $link.hover( 623 function () { // On mouse enter 624 $megamenItems.stop(true, true).fadeOut(100); // Hide with a slow fade effect 625 }, 626 /*function () { // On mouse leave 627 $megamenItems.stop(true, true).show(); // Show with a slow fade effect 628 }*/ 629 ); 630 } 631 632 // Initialize events for Talgildaapotekið and Okkaravørur 633 handleLinkEvents('Talgildaapotekið', 710); 634 handleLinkEvents('Okkaravørur', 664); 635 636 637 // Select the <a> tag inside the <ul> with the class "meanmenu" 638 $('ul.meanmenu>li>a[data-toggle]').on('click', function(event) { 639 if ($(this).text().trim() === 'Talgilda apotekið') { // Check if the inner text matches 640 event.preventDefault(); // Prevent default anchor behavior 641 window.location.href = '/default.aspx?id=710'; // Redirect to the desired page 642 } 643 else if ($(this).text().trim() === 'Okkara vørur') { // Check if the inner text matches 644 event.preventDefault(); // Prevent default anchor behavior 645 window.location.href = '/default.aspx?id=664'; // Redirect to the desired page 646 } 647 else { 648 // Click the next sibling with class "mean-expand" if text does not match 649 $(this).next('.mean-expand').trigger('click'); 650 } 651 }); 652 }); 653 </script> 654 </body> 655 </html> 656 657 658