function popup_now(popuplink) {

  popup = window.open(popuplink,"SiteWindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=250,height=300,copyhistory=0");

}

name = "hauptfenster";



function openwin(verweis) {

  fenster = open(verweis,"Shopinfo","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,height=850,width=750");

}

function picwin(verweis) {

  fenster = open(verweis,"Detail","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,height=450,width=450");

}

function infowin(verweis) {

  fenster = open(verweis,"Detail","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,height=450,width=560,resizable=yes");

}

function wk_weiter(verweis) {

  fenster = open(verweis,"WKInfo","toolbar=no,scrollbars=0,location=no,status=no,menubar=no,height=150,width=200");

}

function wk_aktual(verweis) {

  fenster = open(verweis,"WKInfo","toolbar=no,scrollbars=0,location=no,status=no,menubar=no,height=150,width=200");

}

function popup() {

  alert(shoptext_119);

}

function open_zs_popup(seite) { // Zusatzseiten-Popup

  f_url = seite;

  f_name = "zs_popup";

  f_props = "width=644,height=550,left=100,top=100,scrollbars=yes,resizable=yes";

  f = open(f_url,f_name,f_props);

  f.focus();

  if (open_zs_popup.arguments[1]) f.print();

}

function open_versandkosten_popup(seite) { // Versandkosten-Popup

  f_url = seite;

  f_name = "versandkosten_popup";

  f_props = "width=500,height=540,left=200,top=200,scrollbars=yes,resizable=yes";

  f = open(f_url,f_name,f_props);

  f.focus();

  if (open_versandkosten_popup.arguments[1]) f.print();

}

function wk_check( form) {

    if( maxAusfuehrungen > 0) {

      for( i = 0; i < maxAusfuehrungen; i++)   {

         valField = eval("form.wkausf"+i+".value");

         if( valField == "xxnoinputxx" || valField == "xxnoinputxx2" || valField == "")  {

             //            alert( shoptext_19);

            return false;

         }

      }

    }

    return true;

}

function feld_not_ok(feld,msg) {

  alert(msg);

  feld.select();

   feld.focus();

}

function format_price(price){

  price = parseFloat(price);

  price *=100;

  price = Math.round(price);

  price /= 100;

  strP = new String(price);

  var tmp = strP.split(".");

  if(!tmp[1])

    tmp[1] = "00";

  else

    if(tmp[1].length==1)tmp[1]*=10;

  strP = tmp[0] + "," + tmp[1];

  return strP;

}

function show_lieferblock (value) {

  var lieferblock = el('lieferblock');

  if(!lieferblock)return;

  if (value == true)

    lieferblock.style.display='inline';

  else

    lieferblock.style.display='none';

}

function show_packstation (value) {

  LiefFields = new Array("land_lief", "land_lief_stern", "firma_lief_label", "firma_lief_value", "firma_lief_stern", "strasse_lief_label", "strasse_lief_value", "strasse_lief_stern");

  PackFields = new Array("land_pack", "firma_pack_label", "firma_pack_value", "firma_pack_stern", "strasse_pack_label", "strasse_pack_value", "strasse_pack_stern");

  if (value == true) {

    for (i = 0; i < LiefFields.length; i++)

      el(LiefFields[i]).style.display='none';

    for (i = 0; i < PackFields.length; i++)

      el(PackFields[i]).style.display='inline';

  } else {

    for (i = 0; i < LiefFields.length; i++)

      el(LiefFields[i]).style.display='inline';

    for (i = 0; i < PackFields.length; i++)

      el(PackFields[i]).style.display='none';

  }

}

function find_blz (blzfeld, errorstring) {

    var blz = blzfeld.value;

    blzfeld.value = blzfeld.value.replace(/\\D/, "");

    if (blz.length > 8)

	blzfeld.value = blzfeld.value.substring(0,8);

    if (document.all && (blz) && (blz.length == 8)) {

	document.all.Bankleitzahlen.object.Filter = 'BLZ = '+blz;

	document.all.Bankleitzahlen.Reset();

	document.all.Anzeigetabelle.dataSrc = "\#Bankleitzahlen";

        el('Bankplatzhalter').style.display = 'none';

        if (document.all.Bankleitzahlen.recordset && document.all.Bankleitzahlen.recordset.recordCount > 0)	{

 	    document.all.Anzeigetabelle.style.display = "inline";

       } else {

	    el('Bankplatzhalter').innerHTML = '<font color="red">'+errorstring+'</font>';

	    el('Bankplatzhalter').style.display = 'inline';

	}

    }

}

function toggle_zahlart(za_id)  {

    top.za_id = za_id;

    if (el('bankdaten_tabelle')) {

	if ((zahlart_kennung[za_id] != "Einzug") && (zahlart_kennung[za_id] != "Sofortueberweisung"))

	    el('bankdaten_tabelle').style.display = 'none';

        else

	    el('bankdaten_tabelle').style.display = 'inline';

    }

    if (el('kkdaten_tabelle')) {

	if ((zahlart_kennung[za_id] != "Kreditkarte") && (zahlart_kennung[za_id] != "CC-Bank"))

	    el('kkdaten_tabelle').style.display = 'none';

        else

	{

	    el('kkdaten_tabelle').style.display = 'inline';

	    if ((zahlart_namen[za_id].search(/visa/ig) >= 0) || ((zahlart_namen[za_id].search(/master/ig) >= 0) && (zahlart_namen[za_id].search(/card/ig) >= 0)))

	    {

		el('best_kknummer_block1').style.width = "40px";

		el('best_kknummer_block2').style.display = "inline";

		el('best_kknummer_block3').style.display = "inline";

		el('best_kknummer_block4').style.display = "inline";

	    }

	    else

	    {

		el('best_kknummer_block1').style.width = "175px";

		el('best_kknummer_block2').style.display = "none";

		el('best_kknummer_block3').style.display = "none";

		el('best_kknummer_block4').style.display = "none";

	    }

	}

    }



    //Zusatzinfos zur Zahlung:

    var zusatzInfoCont =  el('za_zusatzinfo');

    if(registeredZAInfo[zahlart_kennung[za_id]]){

          zusatzInfoCont.innerHTML =  registeredZAInfo[zahlart_kennung[za_id]];

    }else{

         zusatzInfoCont.innerHTML = '';

    }

}

function toggle_versandart(va_id) {

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

	if (va_id && zahlart_namen[i]) {

	    key = (100 * i) + Math.floor(va_id);

	    if (el('zahlart_'+i)) {

		if (zahl_versand_kombi[key] == true)

		    el('zahlart_'+i).style.display='inline';

		else

		    el('zahlart_'+i).style.display='none';

	    }

	}

    }

}



/*ermöglicht mehrfaches, voneinander unabhängiges Setzen von onload-Handlern */



function addLoadEvent(func) {

  var oldonload = window.onload;

  if (typeof window.onload != 'function') {

    window.onload = func;

  } else {

    window.onload = function() {

      if (oldonload) {

        oldonload();

      }

      func();

    }

  }

}



/*wrapper um document.getElementById

    aufruf á la: el('preisanzeige').innerHTML='xxx'; */

function el(id){

    return document.getElementById(id);

}



function check_kk_feld (feld, naechstes)

{

    if ((zahlart_namen[top.za_id].search(/visa/ig) >= 0) || ((zahlart_namen[top.za_id].search(/master/ig) >= 0) && (zahlart_namen[top.za_id].search(/card/ig) >= 0)))

    {

	feld.value = feld.value.replace(/\\D/, "");

	if (feld.value.length > 4)

	    feld.value = feld.value.substr(0,4);

	if (feld.value.length == 4)

	    document.getElementById(naechstes).focus();

    }

}



function changePicQuicktime () {

    document.getElementById("quicktime").style.display = 'inline';

    document.getElementById("quicktime_icon").style.display = 'none';

    if( document.getElementById("flash"))

      document.getElementById("flash").style.display = 'none';

    if( document.getElementById("flash_icon"))

      document.getElementById("flash_icon").style.display = 'inline';

    if( document.getElementById("flashzoomer"))

      document.getElementById("flashzoomer").style.display = 'none';

    if( document.getElementById("flashzoomer_icon"))

      document.getElementById("flashzoomer_icon").style.display = 'inline';



    document.getElementById("hbildcontainer").style.display = 'none';

    if (document.getElementById("hbildsmall"))

      document.getElementById("hbildsmall").style.display = 'inline';

    if( document.getElementById("hauptbild_icon"))

      document.getElementById("hauptbild_icon").style.display = 'inline';

}



function changePicFlash () {

    document.getElementById("flash").style.display = 'inline';

    document.getElementById("flash_icon").style.display = 'none';

    if( document.getElementById("flashzoomer"))

      document.getElementById("flashzoomer").style.display = 'none';

    if( document.getElementById("flashzoomer_icon"))

      document.getElementById("flashzoomer_icon").style.display = 'inline';

    if( document.getElementById("quicktime"))

      document.getElementById("quicktime").style.display = 'none';

    if( document.getElementById("quicktime_icon"))

      document.getElementById("quicktime_icon").style.display = 'inline';



    document.getElementById("hbildcontainer").style.display = 'none';

    if (document.getElementById("hbildsmall"))

      document.getElementById("hbildsmall").style.display = 'inline';

    if( document.getElementById("hauptbild_icon"))

      document.getElementById("hauptbild_icon").style.display = 'inline';

}



function changePicFlashZoomer () {

    document.getElementById("flashzoomer").style.display = 'inline';

    document.getElementById("flashzoomer_icon").style.display = 'none';



    if( document.getElementById("quicktime"))

      document.getElementById("quicktime").style.display = 'none';

    if( document.getElementById("quicktime_icon"))

      document.getElementById("quicktime_icon").style.display = 'inline';

    if( document.getElementById("flash"))

      document.getElementById("flash").style.display = 'none';

    if( document.getElementById("flash_icon"))

      document.getElementById("flash_icon").style.display = 'inline';



    document.getElementById("hbildcontainer").style.display = 'none';

    if (document.getElementById("hbildsmall"))

      document.getElementById("hbildsmall").style.display = 'inline';

    if( document.getElementById("hauptbild_icon"))

      document.getElementById("hauptbild_icon").style.display = 'inline';

}



function open_newsletter(form){

  var email = form.email.value

  if(!email || email==form.email.defaultValue ) return false;

  f_url = "";

  f_name= "newsletter";

  f_props = "left=500,top=300,width=200,height=200,resizable=yes";

  f = open(f_url,f_name,f_props);

  f.focus();

  return true;

}

var wkid;
function checkImporter() {
    var country;
    if (document.getElementById('abweich') && document.getElementById('abweich').checked) {
        country = document.getElementById('lief_land').options[document.getElementById('lief_land').selectedIndex].value;
    } else if (document.getElementById('pack') && document.getElementById('pack').checked) {
        country = document.getElementById('pack_land').options[document.getElementById('pack_land').selectedIndex].value;
    } else {
        country = document.getElementById('best_land').options[document.getElementById('best_land').selectedIndex].value;
    }
    jQuery.getJSON('/cgi-bin/cosmoshop/lshop.cgi?action=get_importer&ssl=1&wkid=' + wkid + '&country=' + country, setImporter);

    return true;
}

var switched = 0;
function setImporter(data) {
    if (data && data.importer) {
        if (switched) {
            jQuery("#importer div").css("color", "#ff0000");
            window.setTimeout(function(){
                jQuery("#importer div").css("color", "#000000")
            }, 500);
            window.setTimeout(function(){
                jQuery("#importer div").css("color", "#ff0000")
            }, 1000);
            window.setTimeout(function(){
                jQuery("#importer div").css("color", "#000000")
            }, 1500);
        }
        jQuery('#addr_name').html(data.importer.adresse.name);
        jQuery('#addr_firma').html(data.importer.adresse.firma);
        jQuery('#addr_strasse').html(data.importer.adresse.strasse);
        jQuery('#addr_plz_ort').html(data.importer.adresse.plz_ort);
        jQuery('#addr_mail').html(data.importer.adresse.mail);
        jQuery('#addr_tel').html(data.importer.adresse.tel);
        jQuery('#addr_fax').html(data.importer.adresse.fax);
        jQuery('#distributor_text').html(data.importer.adresse.distributor_text);
        jQuery('#distributor_bild').html(data.importer.adresse.distributor_bild);

        jQuery('#importer').fadeIn();
        jQuery('#anfragetext').fadeIn();
        jQuery(':image.order').hide();
        jQuery(':image.inquiry').fadeIn();
        switched = 1;
    } else if (switched) {
        switched = 0;
        jQuery('#importer').fadeOut();
        if (land_select.options[land_select.selectedIndex].value != 56) {
            jQuery(':image.inquiry').hide();
            jQuery(':image.order').fadeIn();
        }
        jQuery('#anfragetext').fadeOut();
    }
}

var bundeslaender_definition = {};
var global_land_select;

function toggleBLandDropdown(land_select,bland_sel_name,type){

    global_land_select = land_select;
    if (!checkImporter()) {
        return;
    }


    var sel_land = land_select.options[land_select.selectedIndex].value;

    if (sel_land == 56) {
        jQuery(':image.order').hide();
        jQuery(':image.inquiry').fadeIn();
        jQuery('#' + type + '_land_sonstiges').show();
    } else {
        jQuery(':image.inquiry').hide();
        jQuery(':image.order').fadeIn();
        jQuery('#' + type + '_land_sonstiges').hide();
    }

    //das JS-Array bundeslaender_definition muss auf der seite definiert sein

    var bundeslaender = bundeslaender_definition[sel_land];



    var bland_select =    el(bland_sel_name);

    //var bland_container = el(bland_sel_name + '_container');

    var bland_container = jQuery('#'+bland_sel_name + '_container');

    if(bundeslaender){

        //bland_container.style.display = 'table-row';

        bland_container.show();

        formLib_setOptions(bland_select,formLib_getOptionHashFromArray(bundeslaender));

    }else{

        //bland_container.style.display = 'none';

        bland_container.hide();

    }



}

jQuery(document).ready(function() {
	if (document.getElementById('best_land')) {
		toggleBLandDropdown(document.getElementById('best_land'), 'best_bundesland', 'best');
		if (document.getElementById('abweich') && document.getElementById('abweich').checked) {
			toggleBLandDropdown(document.getElementById('lief_land'), 'lief_bundesland', 'lief');
		}
	}
});


function validate_email(e) { // Email Validation. Written by PerlScriptsJavaScripts.com

  ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";



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

    if(ok.indexOf(e.charAt(i))<0){ 

      return (false);

    }	

  } 



  if (document.images) {

    re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;

    re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,8}|[0-9]{1,3})(\]?)$/;

    if (!e.match(re) && e.match(re_two)) {

      return (-1);		

    } 

  }

}



function open_layer_view (url) {

    if (ajax_layer(url)) {

        el('black_overlay').style.display='inline';

        el('layer_view').style.display='inline';

        return false;

    }

    return true;

}



function close_layer_view () {

    el('black_overlay').style.display='none';

    el('layer_view').style.display='none';

    el('layer_view_container').innerHTML = '';

}



function ajax_layer (url){         

    url = url.replace(/lshop\.cgi/, "lshopAJAX.cgi");

    try{

        req = new XMLHttpRequest();

        req.open("GET", url, true);

    }

    catch (e){

        try{

            req = new ActiveXObject("Msxml2.XMLHTTP");

            req.open("GET", url, true);

        } 

        catch (e){

            try{

                req = new ActiveXObject("Microsoft.XMLHTTP");

                req.open("GET", url, true);

            } 

            catch (failed){

                req = null;

            }

        }  

    }

    if (req == null)

        return false;

    req.onreadystatechange = handle_ajax_layer;

    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

    req.send(null);

    return true;

}



function handle_ajax_layer () {

    switch(req.readyState) {

    case 4:

        if (req.status == 0)

            break;

        if(req.status!=200) {

            //            alert("Fehler:"+req.status); 

        } else {

            xml = req.responseXML;

            var html_code = xml.getElementsByTagName("html")[0].firstChild.nodeValue;

            var init_code = xml.getElementsByTagName("init")[0].firstChild.nodeValue;

            if (el('layer_view_container'))

                el('layer_view_container').innerHTML = html_code;

            if (init_code.length > 0)

                eval(init_code);

        }

        break;

    default:

        return false;

        break;     

    }

}



function vkr_toggle_land (id) {

    js_land = id;

}



function vkr_toggle_zahlart (id) {

    js_zahlart = id;

}



function vkr_toggle_versandart (id) {

    js_versandart = id;

}



function vk_rechner () {

    var alle_versandarten = new Array();

    var alle_zahlarten = new Array();

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

        if (land_versandarten[i]) {

            var temp_versandarten = land_versandarten[i].split(/\,/);

            for (j = 0; j < temp_versandarten.length; j++)

                alle_versandarten[temp_versandarten[j]] = temp_versandarten[j]; 

        }

    }        

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

        if (land_zahlarten[i]) {

            var temp_zahlarten = land_zahlarten[i].split(/\,/);

            for (j = 0; j < temp_zahlarten.length; j++)

                alle_zahlarten[temp_zahlarten[j]] = temp_zahlarten[j]; 

        }

    }        

    

    var this_versandarten = land_versandarten[js_land].split(/\,/);

    var this_zahlarten = land_zahlarten[js_land].split(/\,/);

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

        if (alle_versandarten[i]) {

            gefunden = false;

            for (j = 0; j < this_versandarten.length; j++) {

                if (alle_versandarten[i] == this_versandarten[j]) 

                    gefunden = true;

            }

            if (gefunden) {

                var key = (100 * Math.abs(js_zahlart)) + Math.abs(+alle_versandarten[i]);

                if (zahl_versand_kombi[key]) {

                    if (el('vkr_versandart_label_'+alle_versandarten[i]))

                        el('vkr_versandart_label_'+alle_versandarten[i]).style.color = 'black';

                } else {

                    if (el('vkr_versandart_label_'+alle_versandarten[i]))

                        el('vkr_versandart_label_'+alle_versandarten[i]).style.color = 'red';

                }

                if (el('vkr_versandart_radio_'+alle_versandarten[i]))

                    el('vkr_versandart_radio_'+alle_versandarten[i]).disabled = false;

            } else {

                if (el('vkr_versandart_label_'+alle_versandarten[i]))

                    el('vkr_versandart_label_'+alle_versandarten[i]).style.color = '#AAAAAA';

                if (el('vkr_versandart_radio_'+alle_versandarten[i]))

                    el('vkr_versandart_radio_'+alle_versandarten[i]).disabled = true;

            }

        }

    }

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

        if (alle_zahlarten[i]) {

            gefunden = false;

            for (j = 0; j < this_zahlarten.length; j++) {

                if (alle_zahlarten[i] == this_zahlarten[j])

                    gefunden = true;

            }

            if (gefunden) {

                var key = (100 * Math.abs(alle_zahlarten[i])) + Math.abs(+js_versandart);

                if (zahl_versand_kombi[key]) {

                    if (el('vkr_zahlart_label_'+alle_zahlarten[i]))

                        el('vkr_zahlart_label_'+alle_zahlarten[i]).style.color = 'black';

                } else {

                    if (el('vkr_zahlart_label_'+alle_zahlarten[i]))

                        el('vkr_zahlart_label_'+alle_zahlarten[i]).style.color = 'red';

                }

                if (el('vkr_zahlart_radio_'+alle_zahlarten[i]))

                    el('vkr_zahlart_radio_'+alle_zahlarten[i]).disabled = false;

            } else {

                if (el('vkr_zahlart_label_'+alle_zahlarten[i]))

                    el('vkr_zahlart_label_'+alle_zahlarten[i]).style.color = '#999999';

                if (el('vkr_zahlart_radio_'+alle_zahlarten[i]))

                    el('vkr_zahlart_radio_'+alle_zahlarten[i]).disabled = true;

            }

        }

    }

    var key = (100 * Math.abs(js_zahlart)) + Math.abs(js_versandart);

    var gesamt = '---';

    if ((el('vkr_zahlart_radio_'+js_zahlart).disabled == false) && (el('vkr_versandart_radio_'+js_versandart).disabled == false) && (zahl_versand_kombi[key])) {

        this_zahlungskosten = 1 * kosten_zahlart[js_zahlart];

        this_vkfrei = 1 * land_vk_frei[js_land];

        this_versandkosten = (1 * kosten_versandart[js_versandart]) + (1 * kosten_land[js_land]);

        if ((this_vkfrei > 0) && ((1 * warenwert) >= this_vkfrei) && !vkfreigrenzeign_versandart[js_versandart])

            this_versandkosten = 0;

        el('js_zahlungskosten').innerHTML = waehrung+' '+format_price(this_zahlungskosten);

        if (this_vkfrei == 0) {

            if (el('js_vkfrei'))

                el('js_vkfrei').innerHTML = '---';

        } else {

            if (el('js_vkfrei'))

                el('js_vkfrei').innerHTML = waehrung+' '+format_price(this_vkfrei);

        }

        el('js_versandkosten').innerHTML = waehrung+' '+format_price(this_versandkosten);

        el('js_gesamt').innerHTML = waehrung+' '+format_price(this_zahlungskosten + this_versandkosten + (1 * warenwert));

    } else {

        el('js_zahlungskosten').innerHTML = '---';

        if (el('js_vkfrei'))

            el('js_vkfrei').innerHTML = '---';

        el('js_versandkosten').innerHTML = '---';

        el('js_gesamt').innerHTML = '---';

    }

}



function toggle_versand (id) {

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

        var box = el('boxinfo_versandart_'+versandarten[i]);

        if (box) {

            if (versandarten[i] == id)

                box.style.display = 'inline';

            else

                box.style.display = 'none';

        }

    }

    var erlaubte_zahlarten = zahlarten_kombi[id].split(/\,/);

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

        var radio = el('best_zahlart_'+zahlarten[i]);

        var label = el('zahlart_label_'+zahlarten[i]);

        if (radio) {

            var erlaubt = false;

            for (j = 0; j < erlaubte_zahlarten.length; j++)

                if (zahlarten[i] == erlaubte_zahlarten[j])

                    erlaubt = true;

            if (erlaubt) {

                radio.disabled = false;

                if (label)

                    label.style.color = 'black';

                //                    label.style.fontWeight = 'bold';

            } else {

                radio.disabled = true;

                radio.checked = false;

                if (label)

                    label.style.color = '#888888';

                //                    label.style.fontWeight = 'normal';

            }

        }

        

    }    

}



function toggle_zahlung (id) {

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

        var box = el('boxinfo_zahlart_'+zahlarten[i]);

        if (box) {

            if (zahlarten[i] == id)

                box.style.display = 'inline';

            else

                box.style.display = 'none';

        }

    }

}

/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
var tipobj;

function load_ddrivetip() {
    if (ie||ns6)
    tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
}

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

function ddrivetip(thetext, thecolor, thewidth){
    if (!tipobj) {
        return;
    }
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
    if (!tipobj) {
        return;
    }
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
    if (!tipobj) {
        return;
    }
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

