mh_crn_divElem = ""; var MH_crn_link = new Array(); MH_crn_link[0] = new Array('mh_crn_popup_item_add','mh_crn_getHotel','mh_crn_span_add','Add','0px 0px'); MH_crn_link[1] = new Array('mh_crn_popup_item_share','mh_crn_getHotelShare','mh_crn_span_share','Share','0px -16px'); MH_crn_link[2] = new Array('mh_crn_popup_item_register','mh_crn_makeRegisterUser','mh_crn_span_register','Register','0px -32px'); MH_crn_link[3] = new Array('mh_crn_popup_item_info','mh_crn_moreInfo','mh_crn_span_info','More Info','0px -48px'); MH_crn_link[4] = new Array('mh_crn_popup_item_hotelprices','mh_crn_hotelPrices','mh_crn_span_hotelprices','Hotel Prices','0px -64px'); MH_crn_link[5] = new Array('mh_crn_popup_item_logout','mh_crn_logoutUser','mh_crn_span_logout','Logout','0px -80px'); MH_crn_link[6] = new Array('mh_crn_popup_item_contact','mh_crn_hotelContact','mh_crn_span_contact','Contact Hotel','0px -96px'); MH_crn_link[7] = new Array('mh_crn_popup_item_mynote','mh_crn_userNote','mh_crn_span_mynote','My Notes','0px -112px'); //---------------------------------------------------- var mh_code_hotel = 'c96a3966d65b452275a3830e495e15e1'; var mh_type = 'crn'; var menu_crn_options = "

"; menu_crn_options += "Register Guest "; menu_crn_options += "Login "; menu_crn_options += "Close "; menu_crn_options += "

"; //---------------------------------------------------- function mh_crn_getHotel() { mh_crn_removeMenu(); mh_crn_getData('mh_crn_showAdded','add'); } //---------------------------------------------------- function mh_crn_getHotelShare() { mh_crn_removeMenu(); var contact = "
Insert email addresses separated by a comma
"; contact += "
"; contact += ""; contact += "
"; var close_div = "
Close
"; mh_crn_divElem.innerHTML = contact+close_div; } //---------------------------------------------------- function mh_crn_sendShare() { shared_user=document.getElementById("mh_crn_shared_user").value; mh_crn_getData('mh_crn_showAdded','share',shared_user,'') } //---------------------------------------------------- function mh_crn_makeRegisterUser() { mh_crn_removeMenu(); var register = "

Register Guest

"; register += "Email

"; register += ""; register += "
"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = register+close_div; document.getElementById("mh_crn_email_register").focus(); } //---------------------------------------------------- function mh_crn_registerUser() { email_register=document.getElementById("mh_crn_email_register").value; var validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; var send = true; if (email_register == "" || email_register == null || !isNaN(email_register) || email_register.charAt(0) == ' '){ alert("\"Email\" is a mandatory field.\nPlease retry.") send = false; } // check valid email if (email_register.search(validRegExp) == -1) { alert('A valid email address is required.\nPlease retry'); send = false; } if (send == true) mh_crn_getData('mh_crn_showAdded','register',email_register,'') } //---------------------------------------------------- function mh_crn_makeLoginUser() { var register = "
Login
"; register += ""; register += "
Username
Password
"; register += ""; register += "
"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = register+close_div; } //---------------------------------------------------- function mh_crn_loginUser() { username=document.getElementById("mh_crn_username").value; password=document.getElementById("mh_crn_password").value; mh_crn_getData('mh_crn_restoreMenu','login',username,password) } //---------------------------------------------------- function mh_crn_logoutUser() { mh_crn_removeMenu(); mh_crn_getData('mh_crn_showAdded','logout','','') } //---------------------------------------------------- function mh_crn_moreInfo() { mh_crn_removeMenu(); var info = '
Keep useful, updated information about your favorite hotels in one easy-to-use place. Memohotel
'; var close_div = "

Close

"; mh_crn_divElem.innerHTML = info+close_div; } //---------------------------------------------------- function mh_crn_hotelPrices() { mh_crn_removeMenu(); mh_crn_getData('mh_crn_showPrice','prices'); } //---------------------------------------------------- function mh_crn_hotelContact() { mh_crn_removeMenu(); var contact = "
Type a message to hotel
"; contact += "
"; contact += ""; contact += "
"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = contact+close_div; } //---------------------------------------------------- function mh_crn_sendContact() { contact_hotel=document.getElementById("mh_crn_contact_hotel").value; mh_crn_getData('mh_crn_showAdded','contact','','','',contact_hotel) } //---------------------------------------------------- function mh_crn_userNote() {mh_crn_getData('mh_crn_showNote','note');} //---------------------------------------------------- function mh_crn_getData(callback,action,username,password,note_user_match_trip,message_to_hotel) { var dt = new Date(); var request = 'http://www.memohotel.com/GiveHotel.php?mh_code_hotel=' + mh_code_hotel + '&action=' + action + '&callback=' + callback + "&username=" + username + "&password=" + password + "¬e_user_match_trip=" + note_user_match_trip + "&message_to_hotel=" + message_to_hotel + '&random=' + dt.getTime(); var oScript = document.getElementById("dynamic_script_injection_node"); var head = document.getElementsByTagName("head").item(0); if (oScript) { head.removeChild(oScript); } //---------------------------------------------------- script = document.createElement("script"); script.setAttribute("id", "dynamic_script_injection_node"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", request); head.appendChild(script); } //---------------------------------------------------------------- function mh_crn_restoreMenu() { mh_crn_divElem.innerHTML = ''; mh_crn_menuDiv(); } //---------------------------------------------------------------- function mh_crn_showAdded(Hotel) { if(Hotel.status != "error"){ var message = "

"+Hotel.message+"


"; var name_hotel = "

"+Hotel.name_hotel+"

"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = message+name_hotel+close_div; }else{ var message = "

"+Hotel.message+"


"; var close_div = "

Close

"; if (Hotel.name_hotel != 'disable') mh_crn_divElem.innerHTML = message+menu_crn_options; else mh_crn_divElem.innerHTML = message+close_div; } } //---------------------------------------------------------------- function mh_crn_updateNote() { document.getElementById("mh_crn_send_update").disabled = true; mh_crn_getData('mh_crn_updatedNote','update_note','','',encodeURIComponent(document.getElementById("note_user_match_trip").value)); } function mh_crn_updatedNote() { alert('Note Saved Saccesfully!'); document.getElementById("mh_crn_send_update").disabled = false; } //---------------------------------------------------------------- function mh_crn_removeMenu() { if (!document.getElementById("mh_crn_innerpopup_head")) return; for (i=7; i>=0; i--){ var oHead = document.getElementById(MH_crn_link[i][0]); var oScript = document.getElementById(MH_crn_link[i][2]); oHead.removeChild(oScript); } for (i=7; i>=0; i--){ if (i < 4) oHead = document.getElementById("mh_crn_popup_leftcol"); else oHead = document.getElementById("mh_crn_popup_rightcol"); oScript = document.getElementById(MH_crn_link[i][0]); oHead.removeChild(oScript); } oHead = document.getElementById("mh_crn_innerpopup_body"); oHead.removeChild(document.getElementById("mh_crn_popup_rightcol")); oHead.removeChild(document.getElementById("mh_crn_popup_leftcol")); oHead.removeChild(document.getElementById("mh_crn_div_clear")); oHead = document.getElementById("mh_crn_mainmenu"); oHead.removeChild(document.getElementById("mh_crn_div_footer")); oHead.removeChild(document.getElementById("mh_crn_innerpopup_body")); oHead.removeChild(document.getElementById("mh_crn_innerpopup_head")); } //---------------------------------------------------------------- function mh_crn_showNote(Note) { mh_crn_removeMenu(); if(Note.status != "error"){ var note_user_match_trip = "
" note_user_match_trip += "
"; note_user_match_trip += ""; note_user_match_trip += "
"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = note_user_match_trip+close_div; }else{ var message = "

"+Note.message+"


"; var close_div = "

Close

"; if (Note.name_hotel != 'disable') mh_crn_divElem.innerHTML = message+menu_crn_options; else mh_crn_divElem.innerHTML = message+close_div; } } //---------------------------------------------------------------- function mh_crn_showPrice(Price) { if(Price.status != "error"){ var price_single = "

Single "+Price.price_single_hotel+" " + Price.symbol_currency + " Your price: "+Price.price_single_match_trip+" " + Price.symbol_currency + "

"; var price_double = "

Double "+Price.price_double_hotel+" " + Price.symbol_currency + " Your price: "+Price.price_double_match_trip+" " + Price.symbol_currency + "

"; var price_suite = "

Suite "+Price.price_suite_hotel+" " + Price.symbol_currency + " Your price: "+Price.price_suite_match_trip+" " + Price.symbol_currency + "

"; var close_div = "

Close

"; mh_crn_divElem.innerHTML = price_single+price_double+price_suite+close_div; }else{ var message = "

"+Price.message+"


"; mh_crn_divElem.innerHTML = message+menu_crn_options; } } //--------------------------------------------------------------- function mh_crn_showPopup(){ document.getElementById("mh_crn_innerpopup").style.display='block'; document.getElementById("mh_crn_innerpopup").style.top = '-110px'; document.getElementById("mh_crn_innerpopup").style.right = '60px'; } //--------------------------------------------------------------- function mh_crn_hidePopup(){ document.getElementById("mh_crn_innerpopup").style.display='none'; } //------------------------------------------------------------- function mh_crn_mainDiv(){ var divPopup_container = document.getElementById("mh_crn_divPopup_container"); divPopup_container.style.width = "85px"; divPopup_container.style.height = "85px"; divPopup_container.style.cursor = "pointer"; divPopup_container.style.zIndex = '9999999'; divPopup_container.style.position = 'fixed'; divPopup_container.style.bottom = "0px"; divPopup_container.style.right = "0px"; divPopup_container.innerHTML = "memohotel"; divPopup_container.onmouseover = mh_crn_showPopup; divPopup_container.onmouseout = mh_crn_hidePopup; //---------------------------------------------------- var innerpopup = document.createElement("div"); innerpopup.id = "mh_crn_innerpopup"; innerpopup.style.font = "10pt tahoma"; innerpopup.style.lineHeight = "1em"; innerpopup.style.outlineStyle = "none"; innerpopup.style.border = "1px solid rgb(204, 204, 204)"; innerpopup.style.margin = "0px"; innerpopup.style.padding = "1px"; innerpopup.style.background = "rgb(255, 255, 255) none repeat scroll 0% 0%"; innerpopup.style.overflow = "visible"; innerpopup.style.color = "rgb(76, 76, 76)"; innerpopup.style.cssFloat = "none"; innerpopup.style.styleFloat = "none"; innerpopup.style.lineHeight = "1em"; innerpopup.style.textAlign = "left"; innerpopup.style.width = "270px"; innerpopup.style.height = "140px"; innerpopup.style.position = "absolute"; innerpopup.style.display = "none"; document.getElementById("mh_crn_divPopup_container").appendChild(innerpopup); mh_crn_divElem = document.getElementById ("mh_crn_innerpopup"); } //---------------------------------------------------- var mh_crn_mainmenu = document.createElement("div"); function mh_crn_menuDiv(){ mh_crn_mainmenu.id = "mh_crn_mainmenu"; mh_crn_mainmenu.style.width = "270px"; mh_crn_mainmenu.style.height = "140px"; document.getElementById("mh_crn_innerpopup").appendChild(mh_crn_mainmenu); var innerpopup_head = document.createElement("div"); innerpopup_head.id = "mh_crn_innerpopup_head"; innerpopup_head.style.borderBottom = "1px solid rgb(229, 229, 229)"; innerpopup_head.style.padding = "4px"; innerpopup_head.style.background = "rgb(242, 242, 242) none repeat scroll 0% 0%"; innerpopup_head.style.position = "relative"; innerpopup_head.innerHTML = "Add to your Memohotel"; document.getElementById("mh_crn_mainmenu").appendChild(innerpopup_head); //---------------------------------------------------- var innerpopup_body = document.createElement("div"); innerpopup_body.id = "mh_crn_innerpopup_body"; innerpopup_body.style.padding = "4px"; document.getElementById("mh_crn_mainmenu").appendChild(innerpopup_body); //---------------------------------------------------- var popup_leftcol = document.createElement("div"); popup_leftcol.id = "mh_crn_popup_leftcol"; popup_leftcol.style.width = "130px"; popup_leftcol.style.cssFloat = "left"; popup_leftcol.style.styleFloat = "left"; document.getElementById("mh_crn_innerpopup_body").appendChild(popup_leftcol); //---------------------------------------------------- var popup_rightcol = document.createElement("div"); popup_rightcol.id = "mh_crn_popup_rightcol"; popup_rightcol.style.width = "130px"; popup_rightcol.style.cssFloat = "right"; popup_rightcol.style.styleFloat = "right"; document.getElementById("mh_crn_innerpopup_body").appendChild(popup_rightcol); //---------------------------------------------------- for (i=0; i<8; i++){ //---------------------------------------------------- var popup_item_add = document.createElement("div"); popup_item_add.id = MH_crn_link[i][0]; popup_item_add.style.margin = "1px"; popup_item_add.style.padding = "2px 3px"; popup_item_add.style.width = "115px"; popup_item_add.style.border = "1px solid rgb(255, 255, 255)"; popup_item_add.style.backgroundColor = "rgb(255, 255, 255)"; popup_item_add.style.color = "rgb(76, 76, 76)"; if (i < 4) document.getElementById("mh_crn_popup_leftcol").appendChild(popup_item_add); else document.getElementById("mh_crn_popup_rightcol").appendChild(popup_item_add); document.getElementById(MH_crn_link[i][0]).onmouseover = function(){ this.style.border = "1px solid rgb(229, 229, 229)"; this.style.backgroundColor = "rgb(242, 242, 242)"; this.style.color = "rgb(0, 0, 0)"; } document.getElementById(MH_crn_link[i][0]).onmouseout = function(){ this.style.border = "1px solid rgb(255, 255, 255)"; this.style.backgroundColor = "rgb(255, 255, 255)"; this.style.color = "rgb(76, 76, 76)"; } popup_item_add.onclick = eval(MH_crn_link[i][1]); //---------------------------------------------------- var span_add = document.createElement("span"); span_add.id = MH_crn_link[i][2]; span_add.innerHTML = MH_crn_link[i][3]; span_add.style.background = "transparent url(http://s4.memohotel.com/widget/images/widget_mh.png) no-repeat scroll left center"; span_add.style.display = "block"; span_add.style.height = "16px"; span_add.style.lineHeight = "16px"; span_add.style.paddingLeft = "20px"; span_add.style.backgroundPosition = MH_crn_link[i][4]; span_add.style.cursor = "pointer"; document.getElementById(MH_crn_link[i][0]).appendChild(span_add); } //---------------------------------------------------- var div_clear = document.createElement("div"); div_clear.id = "mh_crn_div_clear"; div_clear.style.clear = "both"; document.getElementById("mh_crn_innerpopup_body").appendChild(div_clear); //---------------------------------------------------- var div_footer = document.createElement("div"); div_footer.id = "mh_crn_div_footer"; div_footer.innerHTML = "Memohotel"; div_footer.style.overflow = "hidden"; div_footer.style.display = "block"; div_footer.style.outlineStyle = "none"; div_footer.style.cssFloat = "right"; div_footer.style.styleFloat = "right"; div_footer.style.marginRight = "3px"; div_footer.style.outlineWidth = "medium"; div_footer.style.outlineColor = "rgb(76, 76, 76)"; document.getElementById("mh_crn_mainmenu").appendChild(div_footer); } document.write('
'); mh_crn_mainDiv();mh_crn_menuDiv();