function openWindow(page, name, attribs) { window.open(page, name, attribs); } function getMenuFrameDocument() { return MenuFrame.document;; } function getContentFrameDocument() { return ContentFrame.document;; } function getDocForm( doc, formName ) { return doc.forms[formName] } function clearMenu() { // get document var doc = getMenuFrameDocument(); // get refercence var menu = getDocForm( doc, "searchform" ); if( !menu ) return; // clear fields if (menu.CompanyName) menu.CompanyName.value = ""; if (menu.CompanyCond) menu.CompanyCond.selectedIndex = 0; if (menu.HeaderName) menu.HeaderName.value = ""; if (menu.HeaderCond) menu.HeaderCond.selectedIndex = 0; if (menu.District) menu.District.value = ""; if (menu.StreetOrBox) menu.StreetOrBox.value = ""; if (menu.PostCode) menu.PostCode.value = ""; if (menu.CityName) menu.CityName.value = ""; if (menu.AreaCode) menu.AreaCode.value = ""; if (menu.Phone) menu.Phone.value = ""; if (menu.StreetName) menu.StreetName.value = ""; if (menu.StreetNumber) menu.StreetNumber.value = ""; } function clearPlacerMenu() { // get document var doc = getMenuFrameDocument(); // get refercence var menu = getDocForm( doc, "placerform" ); if( !menu ) return; // clear fields if (menu.CompanyName) menu.CompanyName.value = ""; if (menu.HeaderName) menu.HeaderName.value = ""; } function clearBovisionMenu1() { var doc = getContentFrameDocument() var menu1 = getDocForm( doc, "searchform1" ); if( !menu1 ) return; // clear fields if (menu1.PostCode) menu1.PostCode.value = ""; if (menu1.CityName) menu1.CityName.value = ""; if (menu1.AreaCode) menu1.AreaCode.value = ""; if (menu1.Phone) menu1.Phone.value = ""; if (menu1.StreetName) menu1.StreetName.value = ""; if (menu1.StreetNumber) menu1.StreetNumber.value = ""; } function clearBovisionMenu2() { var doc = getContentFrameDocument() var menu2 = getDocForm( doc, "searchform2" ); if( !menu2 ) return; // clear fields if (menu2.CompanyName) menu2.CompanyName.value = ""; if (menu2.HeaderName) menu2.HeaderName.value = ""; } function listHeaders() { // get document var doc = getMenuFrameDocument(); var menu = getDocForm( doc, "searchform" ); if( menu && menu.elements["HeaderName"]) { var tmp = menu.HeaderName.value; menu.HeaderName.value = "A"; menu.submit(); menu.HeaderName.value = tmp; } menu = getDocForm( doc, "placerform" ); if( menu && menu.elements["HeaderName"]) { var tmp = menu.HeaderName.value; menu.HeaderName.value = "A"; menu.submit(); menu.HeaderName.value = tmp; } } function listDistricts() { var doc = getMenuFrameDocument(); var menu = getDocForm( doc, "searchform"); if (menu && menu.elements["District"]) { menu.District.value = "A"; var tmp = menu.District.value; menu.submit(); menu.District.value = tmp; } menu = getDocForm( doc, "placerform" ); if (menu && menu.elements["District"]) { menu.District.value = "A"; var tmp = menu.District.value; menu.submit(); menu.District.value = tmp; } } function listBovisionHeaders() { // get document var doc = getContentFrameDocument(); var menu = getDocForm( doc, "searchform2" ); if( menu && menu.elements["HeaderName"]) { var headerName = menu.HeaderName.value = "A"; var streetName = menu.StreetName.value; var streetNumber = menu.StreetNumber.value; var cityName = menu.CityName.value; } bovisionWindow=window.open( "/main/frameset.asp?NewFields=&StartLocation=GeographicMenu&ShowCompanyPlacer=Yes&" + "HeaderName=" + escape(headerName) + "&StreetName=" + escape(streetName) + "&StreetNumber=" + escape(streetNumber) + "&CityName=" + escape(cityName), "bovisionWindow", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600"); self.close(); } function SubmitBovision() { var qs = ""; // get document var doc = getContentFrameDocument(); var menu = getDocForm( doc, "searchform2" ); if( !menu ) return; var companyName = menu.CompanyName.value; var headerName = menu.HeaderName.value; qs += "&StreetName=" + escape(menu.StreetName.value); qs += "&StreetNumber=" + escape(menu.StreetNumber.value); qs += "&CityName=" + escape(menu.CityName.value); qs += "&Level=" + menu.Level.value; qs += "&CompanyName=" + escape(companyName); qs += "&HeaderName=" + escape(headerName); if (companyName.length > 0 || headerName.length > 0) { bovisionWindow=window.open("/main/frameset.asp?StartLocation=PlacerMenu&SearchByMap=Yes&ExposedWord=&Header=&ShowMap=Yes" + "&ShowPrimeHit=No&ShowHits=Yes&Address=&UpdateBoundaries=Yes&Advert=" + "&HeaderGroup=&ShowCompanyPlacer=Yes&PostCode=&ClearProfile=Yes" + qs, "bovisionWindow", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600"); self.close(); } } function setHeaderNameInMenu(name) { // get document var doc = getMenuFrameDocument(); var menu = getDocForm( doc, "searchform" ); if( menu && menu.elements["HeaderName"]) { menu.HeaderName.value = name; } menu = getDocForm( doc, "placerform" ); if( menu && menu.elements["HeaderName"]) { menu.HeaderName.value = name; } } function removeCount(text) { var iEnd = text.indexOf(" ("); if (iEnd == -1) return text; return text.substring(0, iEnd); } function selectHeader(form) { var text = form.Header.options[form.Header.selectedIndex].text; text = removeCount(text); form.HeaderName.value = text; setHeaderNameInMenu(text); } function selectDistrict(form) { var text = form.DistrictSelect.options[form.DistrictSelect.selectedIndex].text; var idx = text.indexOf(","); var districtName = text.substring(0, idx); var optionVal = form.DistrictSelect.options[form.DistrictSelect.selectedIndex].value; var tmp = optionVal.split(","); var districtCode = tmp[0]; var region = tmp[1]; var municipality = tmp[2]; form.District.value = districtName; form.DistrictCode.value = districtCode; form.Region.value = region; form.Municipality.value = municipality; setDistrictNameInMenu(districtName); } function setDistrictNameInMenu(name) { var doc = getMenuFrameDocument(); var menu = getDocForm( doc, "searchform" ); if (menu && menu.elements["District"]) { menu.District.value = name; } menu = getDocForm( doc, "searchform"); if (menu && menu.elements["District"]) { menu.District.value = name; } } function SelectNearby(StartLocation) { // get document var doc = getContentFrameDocument(); var nearbyForm = getDocForm( doc, "nearbyForm" ); var nearby = nearbyForm.nearby; var index = nearby.selectedIndex; var option = nearby.options[index]; var val = option.value; var nm = option.text; //var mapEngineState = frames["SelectFrame"].document.forms[0].MapEngineState.value; if( val == "" ) return; var loc = "/main/search/hits.asp?NewFields=&StartLocation=PrimeHit&ShowMap=Yes&" + "ShowPrimeHit=Yes&ShowHits=Yes&SearchByMap=Yes&UpdateBoundaries=Yes&"; var menu = getDocForm( doc, "searchform2" ); if( menu && menu.elements["HeaderName"]) { var streetName = menu.StreetName.value; var streetNumber = menu.StreetNumber.value; var cityName = menu.CityName.value; loc += "StreetName=" + escape(streetName); loc += "&StreetNumber=" + escape(streetNumber); loc += "&CityName=" + escape(cityName); loc += "&Level=" + menu.Level.value; } if( val.charAt(0) == 'h' ) { loc += "Header=" + val.substring( 1 ) + "&HeaderName=" + escape(nm.substring(2)); } else if( val.charAt(0) == 'g' ) { loc += "HeaderGroup=" + val.substring( 1 ) + "&HeaderGroupName=" + escape(nm.substring(2)); } else return; //loc += "&mapEngineState=" + mapEngineState; frames["ContentFrame"].location.href = loc; } function ShowHelp( resId, locale ) { helpWindow=window.open( "/liston/" + resId + "_" + locale + ".lxml", "helpWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=230,height=300"); } function menuSelectGo(allowReturn) { var selectFrame = frames["SelectFrame"]; var doc = selectFrame.document; var form = doc.forms[0]; var menuIndex = form.menu.selectedIndex; var menu = form.menu.options[menuIndex].value; if (menu == "") return; frames["MenuFrame"].location.href = menu; if (allowReturn) { frames["SelectFrame"].location.href = "select.asp?Menu=" + menu + "&locale=1"; } } function menuSelectGoToTeliaSe(allowReturn) { var selectFrame = frames["SelectFrame"]; var doc = selectFrame.document; var form = doc.forms[0]; var menuIndex = form.menu.selectedIndex; var menu = form.menu.options[menuIndex].value; if (menu == "") return; frames["MenuFrame"].location.href = menu; if (allowReturn) { frames["SelectFrame"].location.href = "select_teliaSe.asp?Menu=" + menu + "&locale=1"; } } function popContest() { window.open('http://www.e-game.nu/spel/12/sendgame/gulasidorna_sendgame.htm','newWin','toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0,width=480,height=450'); } function ShowRoutePrintFormat(page) { // forward mapengine state //+ "?mapEngineState=" + mapEngineState //var mapEngineState = frames["SelectFrame"].document.forms[0].MapEngineState.value; helpWindow=window.open( page , "helpWindow", "toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=500"); } function ShowLinkToPage( page ) { helpWindow=window.open( "/main/search/special/pages/" + page, "helpWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=342,height=212"); } function ShowLinkToHeaderContentPage( page, params ) { helpWindow=window.open( page , "HeaderContentWindow" , params ); } function ShowMovieHelpPage(page) { var str = ",left=100,screenX=100"; str += ",top=50,screenY=50"; helpWindow=window.open(page, "DownloadWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=395,height=490" + str); } function testBL(hcode) { frames["ContentFrame"].location = "http://galleria.gulasidorna.se/app/sub_category.lsp?hgc=" + hcode; frames["ContentFrame"].document.onUnload = testBL1(); } function testBL1() { frames["ContentFrame"].document.bgColor ="#CCCCCC"; } // --> ////////////////////////////////////////// // functions to control the movie player ////////////////////////////////////////// var clip_closed = false; var incV = new Image(); var decV = new Image(); var incVMax = new Image(); var decVMin = new Image(); var movieDBLink = ""; var msie_windows = 1; // true because it is only used when the computer is not a mac (i.e it is a pc) function onStop() { if(clip_closed) { parent.ContentFrame.document.images.infopagePlayButton.src="/main/search/images/sv/play.gif"; parent.ContentFrame.document.images.infopageStopButton.src="/main/search/images/sv/stop-tonad.gif"; parent.ContentFrame.document.images.infopagePauseButton.src="/main/search/images/sv/paus-tonad.gif"; } clip_closed = true; } function onAudioStop() { parent.ContentFrame.document.images.infopageAudioPlayMediaButton.src="/main/search/images/sv/spela_upp_ljud.gif"; } function initMovie() { if (navigator.userAgent.indexOf("Mac") == -1) { movieDBLink = parent.ContentFrame.document.movieform.dblink.value; clip_closed = false; } } function callAppletTag() { if(navigator.appName.indexOf("Netscape") >= 0 && parent.ContentFrame.document.vid + "" != "undefined") parent.ContentFrame.document.write("<" + "applet code='callback.class' codeBase='/main/search/include/gui/' width='0' height='0' mayscript><" + "/applet>"); else parent.ContentFrame.document.write(""); } function callAppletAudioTag() { if(navigator.appName.indexOf("Netscape") >= 0 && parent.ContentFrame.document.aud + "" != "undefined") parent.ContentFrame.document.write("<" + "APPLET code='callback_audio.class' codeBase='/main/search/include/gui/' height='0' width='0' mayscript><" + "/APPLET>"); else parent.ContentFrame.document.write(""); } function play() { if(pluginCheck()) { if(parent.ContentFrame.document.vid.CanPlay()) { parent.ContentFrame.document.images.infopagePlayButton.src="/main/search/images/sv/play-tonad.gif"; parent.ContentFrame.document.images.infopagePauseButton.src="/main/search/images/sv/paus.gif"; parent.ContentFrame.document.images.infopageStopButton.src="/main/search/images/sv/stop.gif"; parent.ContentFrame.document.vid.DoPlay(); } } else { ShowMovieHelpPage(movieDBLink); } } function stop() { if(pluginCheck()) { if(parent.ContentFrame.document.vid.CanStop()) { parent.ContentFrame.document.images.infopagePlayButton.src="/main/search/images/sv/play.gif"; parent.ContentFrame.document.images.infopagePauseButton.src="/main/search/images/sv/paus-tonad.gif"; parent.ContentFrame.document.images.infopageStopButton.src="/main/search/images/sv/stop-tonad.gif"; parent.ContentFrame.document.vid.DoStop(); clip_closed = false; } } else { ShowMovieHelpPage(movieDBLink); } } function pause() { if(pluginCheck()) { if(parent.ContentFrame.document.vid.CanPause()) { parent.ContentFrame.document.images.infopagePlayButton.src="/main/search/images/sv/play.gif"; parent.ContentFrame.document.images.infopagePauseButton.src="/main/search/images/sv/paus-tonad.gif"; parent.ContentFrame.document.vid.DoPause(); } } else { ShowMovieHelpPage(movieDBLink); } } function incVolume() { if(pluginCheck()) { var volume = parent.ContentFrame.document.vid.GetVolume(); volume -= volume % 10 if(volume == 0) { parent.ContentFrame.document.images.infopageDecVolumeButton.src="/main/search/images/sv/minus.gif"; } if(volume < 91) { parent.ContentFrame.document.vid.SetVolume(volume + 10); if(volume+10 == 100) { parent.ContentFrame.document.images.infopageIncVolumeButton.src="/main/search/images/sv/plus-tonad.gif"; } } } else { ShowMovieHelpPage(movieDBLink); } } function decVolume() { if(pluginCheck()) { var volume = parent.ContentFrame.document.vid.GetVolume(); volume -= volume % 10 if(volume == 100) { parent.ContentFrame.document.images.infopageIncVolumeButton.src="/main/search/images/sv/plus.gif"; } if(volume > 9) { parent.ContentFrame.document.vid.SetVolume(volume - 10); if(volume-10 == 0) { parent.ContentFrame.document.images.infopageDecVolumeButton.src="/main/search/images/sv/minus-tonad.gif"; } } } else { ShowMovieHelpPage(movieDBLink); } } function audioControl() { if(pluginCheck()) { if(parent.ContentFrame.document.aud.CanPlay()) { parent.ContentFrame.document.images.infopageAudioPlayMediaButton.src="/main/search/images/sv/stop-audio.gif"; parent.ContentFrame.document.aud.DoPlay(); } else if(parent.ContentFrame.document.aud.CanStop()) { parent.ContentFrame.document.images.infopageAudioPlayMediaButton.src="/main/search/images/sv/spela_upp_ljud.gif"; parent.ContentFrame.document.aud.DoStop(); } } else { ShowMovieHelpPage(parent.ContentFrame.document.audioform.dblink.value); } } function audioIncVolume() { if(pluginCheck()) { var volume = parent.ContentFrame.document.aud.GetVolume(); volume -= volume % 10 if(volume == 0) { parent.ContentFrame.document.images.infopageAudioDecVolumeButton.src=decV.src; } if(volume < 91) { parent.ContentFrame.document.aud.SetVolume(volume + 10); if(volume+10 == 100) { parent.ContentFrame.document.images.infopageAudioIncVolumeButton.src=incVMax.src; } } } else { ShowMovieHelpPage(parent.ContentFrame.document.audioform.dblink.value); } } function audioDecVolume() { if(pluginCheck()) { var volume = parent.ContentFrame.document.aud.GetVolume(); volume -= volume % 10 if(volume == 100) { parent.ContentFrame.document.images.infopageAudioIncVolumeButton.src=incV.src; } if(volume > 9) { parent.ContentFrame.document.aud.SetVolume(volume - 10); if(volume-10 == 0) { parent.ContentFrame.document.images.infopageAudioDecVolumeButton.src=decVMin.src; } } } else { ShowMovieHelpPage(parent.ContentFrame.document.audioform.dblink.value); } } function pluginCheck() { return (pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)')); } function pluginDetect(plugindescription, pluginxtension, pluginmime, activeXname){ // This script block will test all user agents that have a real plug-in array // (i.e. Netscape) and set the variables, otherwise it directs the routine // to activeXDetect to detect the activeX control. // First define some variables var i,detected=0, daPlugin=new Object(); // If it has a real plugins or mimetypes array, we look there for the plugin first if(navigator.plugins) { numPlugins = navigator.plugins.length; if (numPlugins > 1) { if (navigator.mimeTypes && navigator.mimeTypes[pluginmime] && navigator.mimeTypes[pluginmime].enabledPlugin && (navigator.mimeTypes[pluginmime].suffixes.indexOf(pluginxtension) != -1)) { // seems like we have it, let's just make sure and check the version (if specified) if ((navigator.appName == 'Netscape')/* && (navigator.appVersion.indexOf('4.0') != -1)*/) { // stupid, stupid Netscape can't handle the references to navigator.plugins by number, sooo... for(i in navigator.plugins) { if ((navigator.plugins[i].description.indexOf(plugindescription) != -1) || (i.indexOf(plugindescription) != -1)) { // some versions of quicktime have no description. feh! detected=1; break; } } } } return detected; } else if(msie_windows == 1){ return parent.ContentFrame.activeXDetect(activeXname); } else { return 0; } } else { return 0; } } // // end functions to control the movie player // //**************************************** // functions for mail validation (SendMap) //**************************************** function SubmitMailForm(formStyle, lang) { var validEmailRegExp = /^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]/; var Alert1 = ""; var Alert2 = ""; var Alert3 = ""; if(lang != 2) { Alert1 = "Du måste ange mottagarens e-post adress i formatet \"namn@domän.abc\"."; Alert2 = "Felaktig hälsning! (Min 3, Max 500 tecken)"; Alert3 = "Du måste ange din e-post adress i formatet \"namn@domän.abc\"."; } else { Alert1 = "You must supply the recipients email address in the format: name@domain.abc"; Alert2 = "Message must contain between 3 and 500 characters."; Alert3 = "Your email adress is not correct. Email address must have the format: name@domain.abc"; } if(formStyle == "submit") { var form = parent.ContentFrame.document.forms['mailForm']; var sEmail = form.sEmail.value; var rEmail = form.rEmail.value; var message = form.mess.value; if (!validEmailRegExp.test(rEmail)) { alert(Alert1); return; } if (message.length < 3 || message.length > 500) { alert(Alert2); return; } if (!validEmailRegExp.test(sEmail)) { alert(Alert3); return; } form.submit(); } else if(formStyle == "extended") { var form = parent.ContentFrame.document.forms['mailForm']; var sEmail = form.sEmail.value; if(!validEmailRegExp.test(sEmail)) { alert(Alert3); return; } form.action = "map_op.asp?Operation=SendExtMap"; form.submit(); } else if(formStyle == "sendExtended") { var form2 = parent.ContentFrame.document.forms['mailForm']; var count = getFieldsCount(form2); var mess = form2.mess.value; if(count == 0) return; if (mess.length < 3 || mess.length > 500) { alert(Alert2); return; } form2.emailCount.value = count; checkExtEmail(form2, lang); } else return; } function checkExtEmail(mailForm, lang) { var validEmailRegExp = /^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]/; var Alert1 = ""; if(lang != 2) Alert1 = "Du måste ange mottagarens e-post adress i formatet \"namn@domän.abc\"."; else Alert1 = "You must supply the recipients email address in the format: name@domain.abc"; if( mailForm.elements["rEmail"].value != "") { if(!validEmailRegExp.test(mailForm.elements["rEmail"].value)) { alert(Alert1); return; } } for (var i = 2; i <= 10; i++) { if((mailForm.elements["rEmail" + i].value != "" && mailForm.elements["rName" + i].value == "") || (mailForm.elements["rEmail" + i].value == "" && mailForm.elements["rName" + i].value != "")) { if(lang != 2) { alert("Rad: " + i + " är ifylld fel!"); return; } else { alert("Line: " + i + " is incorrect!"); return; } } } mailForm.submit(); } function getFieldsCount(mailForm) { var totalCount = 1; for (var i = 2; i <=10; i++) { if(mailForm.elements["rEmail" + i].value != "") totalCount = i; } return totalCount; } function GetLink(linkTo, evIE, evNS, obj) { var mailForm = parent.ContentFrame.document.forms['mailForm']; var actObj = eval(obj); //IE5 if(evIE+"" != "undefined") { linkTo += "?" + evIE.offsetX + "," + evIE.offsetY; } //Netscape else if(evNS+"" != "undefined") { var offsetX = evNS.layerX - actObj.x; var offsetY = evNS.layerY - actObj.y; linkTo += "?" + offsetX + "," + offsetY; } //submit if(mailForm + "" != "undefined") { if(linkTo.indexOf("map_op.asp") >= 0 || linkTo.indexOf("ChangeMap=Yes") >= 0) { mailForm.action=linkTo; mailForm.submit(); } else parent.ContentFrame.location=linkTo; } // redirect else parent.ContentFrame.location=linkTo; } //******************************************** // end functions for mail validation (SendMap) //******************************************** //******************************************** // functions for the search alternatives in // the MenuFrame. //******************************************** function selectSearch(type) { parent.MenuFrame.document.searchform.target='MenuFrame'; if(type == 'simple') { parent.MenuFrame.location.href = '/main/search/simple_menu.asp'; } else if(type == 'advanced') { parent.MenuFrame.location.href = '/main/search/advanced_menu.asp'; } else if(type == 'guided') { parent.MenuFrame.location.href = '/main/search/guided_menu.asp'; } else if(type == 'map') { parent.MenuFrame.location.href = '/main/search/geographic_menu.asp'; } } // only used if there is a 'Rubrik...' radio button in the left menu. function doListHeaders() { parent.MenuFrame.document.searchform.searchRadio[2].checked = true; listHeaders(); } //******************************************** // end functions for the search alternatives //********************************************