/* PetNet javascript functions Copyright: DMR Limited kxb vers 1 hf 12/12/2005 vers 2 hf 09/01/2006 vers 3 keep all this separate from the local2.js version 3.3 */ var colourSize=new String; var noBoxes = 0; function changeBreed(field,host,action,access) { if (js_debug) jsLog.Info('breed selected: ' + field.value); clearField(document.advertstep1.v_fs_breed_other,'text') animal_type = document.advertstep1.v_fs_animal_type; for (i=0;i= 0 ; --i) document.advertstep1.elements[target].options[i]=null; } function email_alerts(evt) { if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=email_alert_page'; } else { getText('popup_txt','/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=email_alert&target=popup_txt'); } } function cookie_desc(evt) { if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=cookies_page'; } else { getText('popup_txt','/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=cookies&target=popup_txt'); } } function advert_text(access) { if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&access=' + access + '&mode=advert_text_page'; } else { getText('popup_static','/cgi-bin/dmr5?runprog=petnet/petnet_pages&access=' + access + '&mode=advert_text&target=static_txt'); document.location.href='#page_top'; } } function postcode_notes(evt) { if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_rescue&mode=geo_postcode_page'; } else { getText('popup_txt','/cgi-bin/dmr5?runprog=petnet/petnet_rescue&mode=geo_postcode&target=popup_txt'); } } function clearField(field,type) { switch(type) { case 'text': field.value= '' break case 'dropdown': field.selectedIndex = 0 if (field.length) for (i = field.length - 1 ; i >= 0 ; --i) field.options[i]=null break case 'textarea': field.value = '' break // untested below! case 'radio': field.defaultChecked break } } function privacy_policy() { // start by building basic privacy policy box with an iframe inside to allow scrolling // there are no select boxes on the registration page so we don't need iframes to hide the selection boxes if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=popup_blocked&action=privacy_page'; } else { getText('popup_static','/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=privacy&target=static_txt'); document.location.href='#page_top'; } } function terms_conditions() { // start by building basic ts and cs policy box with an iframe inside to allow scrolling // there are no select boxes on the registration page so we don't need iframes to hide the selection boxes if (IsPopupBlocker()) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=popup_blocked&action=tsandcs_page'; } else { getText('popup_static','/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=tsandcs&target=static_txt'); document.location.href='#page_top'; } } function do_picture(access,action) { var adno = document.advertstep1.v_ad_rec_no.value var next_action = document.advertstep1.action.value var pic2view = adno + '_' + document.advertstep1.v_docfilename.value; if (IsPopupBlocker()) { if (action == 'pic_view' ) { document.location.href='/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=popup_blocked&action=pic_view_page&access=' + access + "&v_ad_rec_no=" + adno + '&v_pic2view='+ pic2view; } else { document.advertstep1.mode.value = 'popup_blocked'; document.advertstep1.action.value = action + "_page"; document.advertstep1.submit() } } else { picwin = window.open('/cgi-bin/dmr5?runprog=petnet/petnet_pages&mode=adverts&action='+ action + '&access=' + access + "&v_ad_rec_no=" + adno + '&v_pic2view='+ pic2view,'picwin','height=350,width=600,resizeable,scrollbars,status'); } } function btnnew() { var div_obj1=(js_ns4)?document.layers['pic_none']:(js_ie4)?document.all['pic_none']:(js_w3c)?document.getElementById('pic_none'):null; var div_obj2=(js_ns4)?document.layers['pic_present']:(js_ie4)?document.all['pic_present']:(js_w3c)?document.getElementById('pic_present'):null; if(js_ns4) { div_obj1.visibility="show"; div_obj2.visibility="hide"; } else{ div_obj1.style.visibility="visible"; div_obj1.style.display="block"; div_obj2.style.visibility="hidden"; div_obj2.style.display="none"; } } function btnedit() { var div_obj1=(js_ns4)?document.layers['pic_none']:(js_ie4)?document.all['pic_none']:(js_w3c)?document.getElementById('pic_none'):null; var div_obj2=(js_ns4)?document.layers['pic_present']:(js_ie4)?document.all['pic_present']:(js_w3c)?document.getElementById('pic_present'):null; if(js_ns4) { div_obj1.visibility="hide"; div_obj2.visibility="show"; } else{ div_obj1.style.visibility="hidden"; div_obj1.style.display="none"; div_obj2.style.visibility="visible"; div_obj2.style.display="block"; } } function advert_onLoad(pic_present) { if (pic_present == 'N') { btnnew(); } else { btnedit(); } }