www.webdeveloper.com
Results 1 to 6 of 6

Thread: There supposedly is a mistake in my javascript, but what is it?? Help anybody...?

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    2

    There supposedly is a mistake in my javascript, but what is it?? Help anybody...?

    Type of html:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    within header:

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


    body {
    scrollbar-arrow-color: deepskyblue;
    scrollbar-base-color: lightkyblue;
    scrollbar-dark-shadow-color: lightskyblue;
    scrollbar-track-color: lightskyblue;
    scrollbar-face-color: lightskyblue;
    scrollbar-shadow-color: deepskyblue;
    scrollbar-highlight-color: deepskyblue;
    scrollbar-3d-light-color: deepskyblue;
    }
    </style>

    <style type="text/css">
    <!--
    A:link {text-decoration: none}
    A:visited {text-decoration: none}
    A:active {text-decoration: none}
    A:hover {text-decoration: underline}
    -->
    </style>


    <style type="text/css">

    #dropmenudiv{
    position:absolute;
    border:1px solid black;
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    }

    #dropmenudiv a{
    width: 200%;
    display: block;
    text-indent: 3px;
    border-bottom: 1px solid black;
    padding: 1px 0;
    text-decoration: none;
    font-weight: bold;
    }

    #dropmenudiv a:hover{ /*hover background color*/
    background-color: yellow;
    }

    </style>

    <script type="text/javascript">


    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a
    href="http://www.angelfire.com/super2/greece/lesvoshotelsnl.html">ALLE
    HOTELS</a>'
    menu1[1]='<a
    href="http://www.angelfire.com/super2/greece/anessisstudios-lesbosnl.html">Anaxos
    Beach - Anessis Studios</a>'
    menu1[2]='<a
    href="http://www.angelfire.com/super2/greece/eftalounl.html">Eftalou -
    Alkaios Hotel</a>'
    menu1[3]='<a
    href="http://www.angelfire.com/super2/greece/olivegrove-lesbosnl.html">Golf
    van Gera - Olive Grove</a>'
    menu1[4]='<a
    href="http://www.angelfire.com/super2/greece/pension-lesbosnl.html">Molyvos
    - Schoolmistress Pension</a>'
    menu1[5]='<a
    href="http://www.angelfire.com/super2/greece/nassosnl.html">Molyvos - Nassos
    Guesthouse</a>'
    menu1[6]='<a
    href="http://www.angelfire.com/super2/greece/captainnl.html">Molyvos -
    Captains View</a>'
    menu1[7]='<a
    href="http://www.angelfire.com/super2/greece/kyparisisnl.html">Mystegna -
    Kyparisis Beach Houses</a>'
    menu1[8]='<a
    href="http://www.angelfire.com/super2/greece/ikies-lesbosnl.html">Neapoly -
    Ikies Small Elegant Houses</a>'
    menu1[9]='<a
    href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Defkalion
    Hotel</a>'
    menu1[10]='<a
    href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Toula
    Appartementen</a>'
    menu1[11]='<a
    href="http://www.angelfire.com/super2/greece/plomarinl.html">Plomari -
    Sellados Luxury Villas</a>'
    menu1[12]='<a
    href="http://www.angelfire.com/super2/greece/passionenl.html">Skala Eressos
    Beach - Villa La Skala</a>'
    menu1[13]='<a
    href="http://www.angelfire.com/super2/greece/imertihotelnl.html">Skala
    Kallonis - Imerti Resort Hotel</a>'
    menu1[14]='<a
    href="http://www.angelfire.com/super2/greece/votsalanl.html">Thermi - Lesvos
    Inn Resort Spa Hotel</a>'
    menu1[15]='<a
    href="http://www.angelfire.com/super2/greece/madonnanl.html">Vatera Beach -
    Madonna Studios</a>'
    menu1[16]='<a
    href="http://www.angelfire.com/super2/greece/aphroditehotel-lesbosnl.html">Vatera
    Beach - Aphrodite Beach Hotel</a>'

    var menuwidth='165px' //default menu width
    var menubgcolor='lightskyblue' //menu bgcolor
    var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick="yes" //hide menu when user clicks within menu?

    /////No further editting needed

    var ie4=document.all
    var ns6=document.getElementById&&!document.all

    if (ie4||ns6)
    document.write('<div id="dropmenudiv"
    style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'"
    onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :
    totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }


    function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    if (menuwidth!=""){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
    }
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
    else if (e.type=="click")
    obj.visibility=hidden
    }

    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")?
    document.documentElement : document.body
    }

    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollLeft+iecompattest().clientWidth-15 :
    window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
    var topedge=ie4 && !window.opera? iecompattest().scrollTop :
    window.pageYOffset
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollTop+iecompattest().clientHeight-15 :
    window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no g?od either?
    edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
    }
    return edgeoffset
    }

    function populatemenu(what){
    if (ie4||ns6)
    dropmenuobj.innerHTML=what.join("")
    }


    function dropdownmenu(obj, e, menucontents, menuwidth){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv")
    : dropmenudiv
    populatemenu(menucontents)

    if (ie4||ns6){
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,
    "bottomedge")+obj.offsetHeight+"px"
    }

    return clickreturnvalue()
    }

    function clickreturnvalue(){
    if (ie4||ns6) return false
    else return true
    }

    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }

    function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
    delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&&
    !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhidemenu()
    }

    function hidemenu(e){
    if (typeof dropmenuobj!="undefined"){
    if (ie4||ns6)
    dropmenuobj.style.visibility="hidden"
    }
    }

    function delayhidemenu(){
    if (ie4||ns6)
    delayhide=setTimeout("hidemenu()",disappeardelay)
    }

    function clearhidemenu(){
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
    }

    if (hidemenu_onclick=="yes")
    document.onclick=hidemenu

    </script>






    Within body:

    <BODY BGCOLOR="lightskyblue">
    <TABLE BORDER="0" BGCOLOR="lightskyblue" align="left">
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="http://www.angelfire.com/super2/greece/indexnl.html"><font
    color="white"><B>&nbsp;De Griekse Eilanden</b></font></a></TD>
    </TR>
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="http://www.angelfire.com/super2/greece/lesboshotelsnl.html"><font
    color="white"><B>&nbsp;Lesbos HOME</b></font></a></TD>
    </TR>
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="lesboshotels.html" onClick="return clickreturnvalue()"
    onMouseover="dropdownmenu(this, event, menu1, '150px')"
    onMouseout="delayhidemenu()"><font color="white"><B>&nbsp;Lesbos
    Hotels</b></font></a></TD>
    </TR>
    </table>



    <br><a href="http://validator.w3.org/check uri=referer"><img
    src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01
    Transitional" height="31" width="88"></a>
    </body>
    </HTML>

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,684
    string deginitions have line feeds causing the error

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    
    <style type="text/css">
    <!--
    body {
    scrollbar-arrow-color: deepskyblue;
    scrollbar-base-color: lightkyblue;
    scrollbar-dark-shadow-color: lightskyblue;
    scrollbar-track-color: lightskyblue;
    scrollbar-face-color: lightskyblue;
    scrollbar-shadow-color: deepskyblue;
    scrollbar-highlight-color: deepskyblue;
    scrollbar-3d-light-color: deepskyblue;
    }
    </style>
    
    <style type="text/css">
    <!--
    A:link {text-decoration: none}
    A:visited {text-decoration: none}
    A:active {text-decoration: none}
    A:hover {text-decoration: underline}
    -->
    </style>
    
    
    <style type="text/css">
    
    #dropmenudiv{
    position:absolute;
    border:1px solid black;
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    }
    
    #dropmenudiv a{
    width: 200%;
    display: block;
    text-indent: 3px;
    border-bottom: 1px solid black;
    padding: 1px 0;
    text-decoration: none;
    font-weight: bold;
    }
    
    #dropmenudiv a:hover{ /*hover background color*/
    background-color: yellow;
    }
    
    </style>
    
    <script type="text/javascript">
    
    
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.angelfire.com/super2/greece/lesvoshotelsnl.html">ALLE HOTELS</a>'
    menu1[1]='<a href="http://www.angelfire.com/super2/greece/anessisstudios-lesbosnl.html">Anaxos Beach - <br>Anessis Studios</a>'
    menu1[2]='<a href="http://www.angelfire.com/super2/greece/eftalounl.html">Eftalou - Alkaios Hotel</a>'
    menu1[3]='<a href="http://www.angelfire.com/super2/greece/olivegrove-lesbosnl.html">Golf van Gera - Olive Grove</a>'
    menu1[4]='<a href="http://www.angelfire.com/super2/greece/pension-lesbosnl.html">Molyvos - Schoolmistress Pension</a>'
    menu1[5]='<a href="http://www.angelfire.com/super2/greece/nassosnl.html">Molyvos - Nassos Guesthouse</a>'
    menu1[6]='<a href="http://www.angelfire.com/super2/greece/captainnl.html">Molyvos - Captains View</a>'
    menu1[7]='<a href="http://www.angelfire.com/super2/greece/kyparisisnl.html">Mystegna - Kyparisis Beach Houses</a>'
    menu1[8]='<a href="http://www.angelfire.com/super2/greece/ikies-lesbosnl.html">Neapoly - Ikies Small Elegant Houses</a>'
    menu1[9]='<a href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Defkalion Hotel</a>'
    menu1[10]='<a href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Toula Appartementen</a>'
    menu1[11]='<a href="http://www.angelfire.com/super2/greece/plomarinl.html">Plomari -  Sellados Luxury Villas</a>'
    menu1[12]='<a href="http://www.angelfire.com/super2/greece/passionenl.html">Skala Eressos Beach - Villa La Skala</a>'
    menu1[13]='<a href="http://www.angelfire.com/super2/greece/imertihotelnl.html">Skala Kallonis - Imerti Resort Hotel</a>'
    menu1[14]='<a href="http://www.angelfire.com/super2/greece/votsalanl.html">Thermi - Lesvos Inn Resort Spa Hotel</a>'
    menu1[15]='<a href="http://www.angelfire.com/super2/greece/madonnanl.html">Vatera Beach - Madonna Studios</a>'
    menu1[16]='<a href="http://www.angelfire.com/super2/greece/aphroditehotel-lesbosnl.html">Vatera Beach - Aphrodite Beach Hotel</a>'
    
    var menuwidth='165px' //default menu width
    var menubgcolor='lightskyblue' //menu bgcolor
    var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick="yes" //hide menu when user clicks within menu?
    
    /////No further editting needed
    
    var ie4=document.all
    var ns6=document.getElementById&&!document.all
    
    if (ie4||ns6)
    document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
    
    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :
    totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }
    
    
    function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    if (menuwidth!=""){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
    }
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
    else if (e.type=="click")
    obj.visibility=hidden
    }
    
    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")?
    document.documentElement : document.body
    }
    
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollLeft+iecompattest().clientWidth-15 :
    window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
    var topedge=ie4 && !window.opera? iecompattest().scrollTop :
    window.pageYOffset
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollTop+iecompattest().clientHeight-15 :
    window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no g?od either?
    edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
    }
    return edgeoffset
    }
    
    function populatemenu(what){
    if (ie4||ns6)
    dropmenuobj.innerHTML=what.join("")
    }
    
    
    function dropdownmenu(obj, e, menucontents, menuwidth){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv")
    : dropmenudiv
    populatemenu(menucontents)
    
    if (ie4||ns6){
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,
    "bottomedge")+obj.offsetHeight+"px"
    }
    
    return clickreturnvalue()
    }
    
    function clickreturnvalue(){
    if (ie4||ns6) return false
    else return true
    }
    
    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }
    
    function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
    delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&&
    !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhidemenu()
    }
    
    function hidemenu(e){
    if (typeof dropmenuobj!="undefined"){
    if (ie4||ns6)
    dropmenuobj.style.visibility="hidden"
    }
    }
    
    function delayhidemenu(){
    if (ie4||ns6)
    delayhide=setTimeout("hidemenu()",disappeardelay)
    }
    
    function clearhidemenu(){
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
    }
    
    if (hidemenu_onclick=="yes")
    document.onclick=hidemenu
    
    </script>
    
    
    
    
    <BODY BGCOLOR="lightskyblue">
    <TABLE BORDER="0" BGCOLOR="lightskyblue" align="left">
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="http://www.angelfire.com/super2/greece/indexnl.html"><font
    color="white"><B>&nbsp;De Griekse Eilanden</b></font></a></TD>
    </TR>
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="http://www.angelfire.com/super2/greece/lesboshotelsnl.html"><font
    color="white"><B>&nbsp;Lesbos HOME</b></font></a></TD>
    </TR>
    <TR>
    <TD BGCOLOR="Midnightblue" WIDTH="190" HEIGHT="25" align="left"><a
    href="lesboshotels.html" onClick="return clickreturnvalue()"
    onMouseover="dropdownmenu(this, event, menu1, '150px')"
    onMouseout="delayhidemenu()"><font color="white"><B>&nbsp;Lesbos
    Hotels</b></font></a></TD>
    </TR>
    </table>
    
    
    
    <br><a href="http://validator.w3.org/check uri=referer"><img
    src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01
    Transitional" height="31" width="88"></a>
    </body>
    </HTML>
    <body>
    
    </body>
    
    </html>
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Nov 2013
    Posts
    2

    ....

    Hello, thanks for your quick reply... I should have told you to tell them that the script works but the page where it is build in can not be validated at
    http://validator.w3.org

    that is our problem!

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    deleted
    Last edited by Padonak; 11-23-2013 at 09:26 AM.
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,366
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  6. #6
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,684
    your markup needs to match the doc type
    to validate for the javascript errors you need( marked in red)

    Code:
    <script language="JavaScript" type="text/javascript">
    /*<![CDATA[*/
    
    
    
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.angelfire.com/super2/greece/lesvoshotelsnl.html">ALLE HOTELS</a>'
    menu1[1]='<a href="http://www.angelfire.com/super2/greece/anessisstudios-lesbosnl.html">Anaxos Beach - <br>Anessis Studios</a>'
    menu1[2]='<a href="http://www.angelfire.com/super2/greece/eftalounl.html">Eftalou - Alkaios Hotel</a>'
    menu1[3]='<a href="http://www.angelfire.com/super2/greece/olivegrove-lesbosnl.html">Golf van Gera - Olive Grove</a>'
    menu1[4]='<a href="http://www.angelfire.com/super2/greece/pension-lesbosnl.html">Molyvos - Schoolmistress Pension</a>'
    menu1[5]='<a href="http://www.angelfire.com/super2/greece/nassosnl.html">Molyvos - Nassos Guesthouse</a>'
    menu1[6]='<a href="http://www.angelfire.com/super2/greece/captainnl.html">Molyvos - Captains View</a>'
    menu1[7]='<a href="http://www.angelfire.com/super2/greece/kyparisisnl.html">Mystegna - Kyparisis Beach Houses</a>'
    menu1[8]='<a href="http://www.angelfire.com/super2/greece/ikies-lesbosnl.html">Neapoly - Ikies Small Elegant Houses</a>'
    menu1[9]='<a href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Defkalion Hotel</a>'
    menu1[10]='<a href="http://www.angelfire.com/super2/greece/petranl.html">Petra - Toula Appartementen</a>'
    menu1[11]='<a href="http://www.angelfire.com/super2/greece/plomarinl.html">Plomari -  Sellados Luxury Villas</a>'
    menu1[12]='<a href="http://www.angelfire.com/super2/greece/passionenl.html">Skala Eressos Beach - Villa La Skala</a>'
    menu1[13]='<a href="http://www.angelfire.com/super2/greece/imertihotelnl.html">Skala Kallonis - Imerti Resort Hotel</a>'
    menu1[14]='<a href="http://www.angelfire.com/super2/greece/votsalanl.html">Thermi - Lesvos Inn Resort Spa Hotel</a>'
    menu1[15]='<a href="http://www.angelfire.com/super2/greece/madonnanl.html">Vatera Beach - Madonna Studios</a>'
    menu1[16]='<a href="http://www.angelfire.com/super2/greece/aphroditehotel-lesbosnl.html">Vatera Beach - Aphrodite Beach Hotel</a>'
    
    var menuwidth='165px' //default menu width
    var menubgcolor='lightskyblue' //menu bgcolor
    var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick="yes" //hide menu when user clicks within menu?
    
    /////No further editting needed
    
    var ie4=document.all
    var ns6=document.getElementById&&!document.all
    
    if (ie4||ns6)
    document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
    
    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :
    totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }
    
    
    function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    if (menuwidth!=""){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
    }
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
    else if (e.type=="click")
    obj.visibility=hidden
    }
    
    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")?
    document.documentElement : document.body
    }
    
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollLeft+iecompattest().clientWidth-15 :
    window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
    var topedge=ie4 && !window.opera? iecompattest().scrollTop :
    window.pageYOffset
    var windowedge=ie4 && !window.opera?
    iecompattest().scrollTop+iecompattest().clientHeight-15 :
    window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no g?od either?
    edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
    }
    return edgeoffset
    }
    
    function populatemenu(what){
    if (ie4||ns6)
    dropmenuobj.innerHTML=what.join("")
    }
    
    
    function dropdownmenu(obj, e, menucontents, menuwidth){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv")
    : dropmenudiv
    populatemenu(menucontents)
    
    if (ie4||ns6){
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,
    "bottomedge")+obj.offsetHeight+"px"
    }
    
    return clickreturnvalue()
    }
    
    function clickreturnvalue(){
    if (ie4||ns6) return false
    else return true
    }
    
    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }
    
    function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
    delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&&
    !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhidemenu()
    }
    
    function hidemenu(e){
    if (typeof dropmenuobj!="undefined"){
    if (ie4||ns6)
    dropmenuobj.style.visibility="hidden"
    }
    }
    
    function delayhidemenu(){
    if (ie4||ns6)
    delayhide=setTimeout("hidemenu()",disappeardelay)
    }
    
    function clearhidemenu(){
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
    }
    
    if (hidemenu_onclick=="yes")
    document.onclick=hidemenu
    
    /*]]>*/
    </script>
    but you have many other errors on the page you will need to sort out yourself
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles