
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - wbol.js - */
// http://www.worldbizonline.com/portal_javascripts/wbol.js?original=1
function check_mail(){var recipients_to=document.getElementsByName('recipients.value:records')[0];document.getElementById('get-quote-button1').disabled='disabled';document.getElementById('get-quote-button2').disabled='disabled';document.getElementById('warn-only-wbomail').style.display='';var set_disabled=0;var mystr=recipients_to.value;if(mystr!=''){var recpts=mystr.split(',');if(recpts.length==1){recpts=recpts[0].split(';')}
for(i=0;i<recpts.length;i++){if(recpts[i].indexOf('worldbizonline.com')==-1){set_disabled=1}}}else{set_disabled=1}
var recipients_cc=document.getElementsByName('recipients.value:records')[1];if(recipients_cc.style.display==''&&recipients_cc.value!=''){var recpts=recipients_cc.value.split(',');if(recpts.length==1){recpts=recpts[0].split(';')}
for(i=0;i<recpts.length;i++){if(recpts[i].indexOf('worldbizonline.com')==-1){set_disabled=1}}}
var recipients_bcc=document.getElementsByName('recipients.value:records')[2];if(recipients_bcc.style.display==''&&recipients_bcc.value!=''){var recpts=recipients_bcc.value.split(',');if(recpts.length==1){recpts=recpts[0].split(';')}
for(i=0;i<recpts.length;i++){if(recpts[i].indexOf('worldbizonline.com')==-1){set_disabled=1}}}
if(set_disabled==0){document.getElementById('get-quote-button1').disabled='';document.getElementById('get-quote-button2').disabled='';document.getElementById('warn-only-wbomail').style.display='none'}}
function getCookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''))}
return cookie_value;break}
a_temp_cookie=null;cookie_name=''}
if(!b_cookie_found){return null}}
function setCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires * 1000 * 60 * 60 * 24}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"")}
function checkEnter(e){var characterCode
if(e&&e.which){e=e
characterCode=e.which}
else{e=event
characterCode=e.keyCode}
if(characterCode==13||characterCode==10){return false}
else{return true}}
function catSearchFocus(e){var characterCode
if(e&&e.which){e=e
characterCode=e.which}
else{e=event
characterCode=e.keyCode}
if(characterCode==13||characterCode==10){document.getElementById('adv_quick_find_button').focus();return false}
else{return true}}
function messenger_popup(url){if(navigator.appName=="Microsoft Internet Explorer"){return centerPopUp(url,'popup',560,435,0)}
else{return centerPopUp(url,'popup',560,435)}}
function popitup(url,height,width){var newwindow=window.open(url,'name','height='+height+' , width='+width);if(window.focus){newwindow.focus()}
return false}
function centerPopUp(url,name,width,height,scrollbars){if(scrollbars==null) scrollbars="0";str="";str+="resizable=0,";str+="menubar=0,";str+="addressbar=0,";str+="titlebar=0,";str+="status=0,";str+="location=0,";str+="toolbar=0,";str+="scrollbars="+scrollbars+",";str+="width="+width+",";str+="height="+height+",";if(window.screen){var ah=screen.availHeight-0;var aw=screen.availWidth-10;var xc=(aw-width)/2;var yc=(ah-height)/2;str+=",left="+xc+",screenX="+xc;str+=",top="+yc+",screenY="+yc}
var w=window.open(url,name,str);w.focus()}
function unblockDiv(site_name,member,last_step){if(last_step==5)
last_step++;for(var i=1;i<=last_step+1;i++){var div=jQuery('div.blockMe'+i);if(typeof(div)!='undefined')
div.unblock()}
for(var i=(last_step+2);i<8;i++){var div=jQuery('div.blockMe'+i);if(typeof(div)!='undefined')
div.block()}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func}
else{window.onload=function(){if(oldonload){oldonload()}
func()}}}
function displaySiteName(name,address){var name_header=document.getElementById('site-name-header');if(!name){name_header.style.display='none';return}
name_header.style.display='block';var name_node=document.getElementById('site-name');var txt_node=document.createTextNode(address);name_node.replaceChild(txt_node,name_node.firstChild)}
function submitform(formname){document[formname].submit()}
function setCategoryAndValidateTZ(id){setSelectedCategory(id);return validateTZSearch()}
function setCategoryAndValidateMap(id){setSelectedCategory(id);return validateMapSearch()}
function setSelectedCategory(id){var cat=document.getElementById('category');cat.value=id}
function validateTZSearch(){var tzNode=document.getElementById('tradeZoneKey');if(tzNode){var tz=tzNode.value;if(tz.length==0){alert('Please select a trade zone');tzNode.focus();return false}};return true}
function validateMapSearch(){var countryNode=document.getElementById('srchCountryKey');if(countryNode){var country=countryNode.value;if(country=='0'){alert('Please select a country');countryNode.focus();return false}};var cityNode=document.getElementById('cityTxt');if(cityNode){var city=cityNode.value;if(city==''){alert('Please enter a city');cityNode.focus();return false}};return true}
function openwin(url){window.open(url)}
function handleKeyPress(event){var kc=event["keyCode"];if((kc==13)){var button=document.getElementById('send-message');button.click()}}
function interceptCarriageReturn(editorInstance){template=location.href.split('?')[0].split('/').pop()
if(template=='messenger_view'){if(document.all){editorInstance.EditorDocument.attachEvent("onkeyup",handleKeyPress) } else{editorInstance.EditorDocument.addEventListener('keyup',handleKeyPress,true) }}}
function replaceBrokenImage(id,src,css_class){var el=document.getElementById(id);var el_clone=el.cloneNode(true);el_clone.src=src;if(typeof(css_class)!='undefined'){el_clone.className=css_class}
var parent_node=el.parentNode;parent_node.replaceChild(el_clone,el)}
function removeBrokenImg(id){var el=document.getElementById(id);if(typeof(el)=='undefined'){return}
var parent_node=el.parentNode;parent_node.removeChild(el)}
function openScript(url,width,height){var l=(screen.width-width)/2;var t=(screen.height-height)/2;var Win=window.open(url,"openScript",'width='+width+',height='+height+',top='+t+',left='+l+',resizable=0,scrollbars=yes,menubar=no,addressbar=no,status=no')}
function resetSelectField(fid){var node=document.getElementById(fid);node.selectedIndex=0}
function openWindow(url,title){var newWindow=window.open(url,'_blank');if(newWindow){if(newWindow.focus){newWindow.focus()}
return false}
return true}
function edit_multiple_timeslots(days){var global_slot_el=document.getElementById('global_times');var children=global_slot_el.childNodes;if(navigator.appName=="Microsoft Internet Explorer"){var start_hour=children[0].value;var start_minute=children[2].value;var end_hour=children[4].value;var end_minute=children[6].value}
else{var start_hour=children[1].value;var start_minute=children[3].value;var end_hour=children[5].value;var end_minute=children[7].value}
var text=start_hour+':'+start_minute+' - '+end_hour+':'+end_minute+' '
var text_node=document.createTextNode(text);for(var i=0;i<days.length;i++){var cb=document.getElementById(days[i].toString()+'_checkbox');if(cb.checked){var text_node=document.createTextNode(text);var id=days[i]+'_timeslot';var timeslot_span=document.getElementById(id);timeslot_span.replaceChild(text_node,timeslot_span.firstChild);var hidden_input=document.getElementById(days[i]+'_hidden');hidden_input.value=text
var id='edit_'+days[i]+'_timeslot';var edit_link=document.getElementById(id);if(edit_link.firstChild.nodeValue=='save'){edit_link.firstChild.nodeValue='edit';if(days[i]=='Mon'){edit_link.onclick=save_mon;continue}
if(days[i]=='Tue'){edit_link.onclick=save_tue;continue}
if(days[i]=='Wed'){edit_link.onclick=save_wed;continue}
if(days[i]=='Thu'){edit_link.onclick=save_thu;continue}
if(days[i]=='Fri'){edit_link.onclick=save_fri;continue}
if(days[i]=='Sat'){edit_link.onclick=save_sat;continue}
if(days[i]=='Sun'){edit_link.onclick=save_sun;continue}}}}}
function save_mon(){edit_timeslot('Mon');return true}
function save_tue(){edit_timeslot('Tue');return true}
function save_wed(){edit_timeslot('Wed');return true}
function save_thu(){edit_timeslot('Thu');return true}
function save_fri(){edit_timeslot('Fri');return true}
function save_sat(){edit_timeslot('Sat');return true}
function save_sun(){edit_timeslot('Sun');return true}
function edit_timeslot(day){var id=day+'_timeslot';var timeslot=document.getElementById(id);var text_node=timeslot.firstChild;var times=text_node.nodeValue.toString().split(' - ');var start_time=times[0].split(':');var start_hour=start_time[0];var start_minute=start_time[1];var end_time=times[1].split(':');var end_hour=end_time[0]
var end_minute=end_time[1]
var global_slot_el=document.getElementById('global_times');var daily_slot_el=global_slot_el.cloneNode(true);daily_slot_el.id=day+'_timeslot_widget';children=daily_slot_el.childNodes;if(navigator.appName=="Microsoft Internet Explorer"){children[0].value=start_hour;children[2].value=start_minute;children[4].value=end_hour;children[6].value=end_minute}
else{children[1].value=start_hour;children[3].value=start_minute;children[5].value=end_hour;children[7].value=end_minute}
timeslot.replaceChild(daily_slot_el,text_node);var id='edit_'+day+'_timeslot';edit_link=document.getElementById(id);edit_link.firstChild.nodeValue='save';
function ie_save(){save_timeslot(day);return true}
edit_link.onclick=ie_save}
function save_timeslot(day){var el=document.getElementById(day+'_timeslot_widget');var children=el.childNodes;if(navigator.appName=="Microsoft Internet Explorer"){var start_hour=children[0].value;var start_minute=children[2].value;var end_hour=children[4].value;var end_minute=children[6].value}
else{var start_hour=children[1].value;var start_minute=children[3].value;var end_hour=children[5].value;var end_minute=children[7].value}
var text=start_hour+':'+start_minute+' - '+end_hour+':'+end_minute+' '
var text_node=document.createTextNode(text);var id=day+'_timeslot';var span=document.getElementById(id);span.replaceChild(text_node,span.firstChild);var id='edit_'+day+'_timeslot';edit_link=document.getElementById(id);edit_link.firstChild.nodeValue='edit';
function ie_edit(){edit_timeslot(day);return true}
edit_link.onclick=ie_edit;var hidden_input=document.getElementById(day+'_hidden');hidden_input.value=text}


/* - maporama.js - */
// http://www.worldbizonline.com/portal_javascripts/maporama.js?original=1
function NwOver(){document.getElementById('Nw1').src="/services/worldmap/coin_HG_on2.gif";document.getElementById('Nw2').src="/services/worldmap/coin_HG_on1.gif";document.getElementById('Nw3').src="/services/worldmap/coin_HG_on3.gif"}
function NwOut(){document.getElementById('Nw1').src="/services/worldmap/coin_HG_out2.gif";document.getElementById('Nw2').src="/services/worldmap/coin_HG_out1.gif";document.getElementById('Nw3').src="/services/worldmap/coin_HG_out3.gif"}
function NeOver(){document.getElementById('Ne1').src="/services/worldmap/coin_HD_on1.gif";document.getElementById('Ne2').src="/services/worldmap/coin_HD_on2.gif";document.getElementById('Ne3').src="/services/worldmap/coin_HD_on3.gif"}
function NeOut(){document.getElementById('Ne1').src="/services/worldmap/coin_HD_out1.gif";document.getElementById('Ne2').src="/services/worldmap/coin_HD_out2.gif";document.getElementById('Ne3').src="/services/worldmap/coin_HD_out3.gif"}
function SeOver(){document.getElementById('Se1').src="/services/worldmap/coin_BD_on1.gif";document.getElementById('Se2').src="/services/worldmap/coin_BD_on2.gif";document.getElementById('Se3').src="/services/worldmap/coin_BD_on3.gif"}
function SeOut(){document.getElementById('Se1').src="/services/worldmap/coin_BD_out1.gif";document.getElementById('Se2').src="/services/worldmap/coin_BD_out2.gif";document.getElementById('Se3').src="/services/worldmap/coin_BD_out3.gif"}
function SwOver(){document.getElementById('Sw1').src="/services/worldmap/coin_BG_on1.gif";document.getElementById('Sw2').src="/services/worldmap/coin_BG_on2.gif";document.getElementById('Sw3').src="/services/worldmap/coin_BG_on3.gif"}
function SwOut(){document.getElementById('Sw1').src="/services/worldmap/coin_BG_out1.gif";document.getElementById('Sw2').src="/services/worldmap/coin_BG_out2.gif";document.getElementById('Sw3').src="/services/worldmap/coin_BG_out3.gif"}
function validateMapInput(){document.getElementById('kss_route_map_div').innerHTML='Retrieving directions...';return true}


/* - banner.js - */
// http://www.worldbizonline.com/portal_javascripts/banner.js?original=1
function showHideAddressField(){var radio=document.getElementById('displayLocation_2');if(radio==null)
return
var address=document.getElementById('mapping-address');if(radio.checked){address.setAttribute('style','display: block');var add_link=document.getElementById('add_link');var ad_link_href=add_link.getAttribute('href');var lst=ad_link_href.split('=');lst[2]='MapBanner';add_link.setAttribute('href',lst.join('='))}
else{address.setAttribute('style','display: none');var add_link=document.getElementById('add_link');var ad_link_href=add_link.getAttribute('href');var lst=ad_link_href.split('=');lst[2]='Banner';add_link.setAttribute('href',lst.join('='))}}
function setCategorySector(){var catinput=document.getElementById('categoriesUserDisplay');catinput.setAttribute('value','');var catselect=document.getElementById('categorySector');var node=document.getElementById('a-choose-category');var onclick_attr=node.getAttribute('onclick');var attr_list=onclick_attr.split(",");var gb_url=attr_list[1];var gb_url_list=gb_url.split('=');for(i=0;i<catselect.length;i++){if(catselect.options[i].selected){var adtype=catselect.options.item(i).getAttribute('value');gb_url_list[2]=adtype+"'";break}};gb_url=gb_url_list.join('=');attr_list[1]=gb_url;onclick_attr=attr_list.join(",");node.setAttribute('onclick',onclick_attr)}
if(window.addEventListener) window.addEventListener("load",showHideAddressField,true);
