
var is_IE=0;var is_firefox=0;var loaded=0;nav=navigator.userAgent;var global_url="http://www.vinden.co.uk/";var s_global_url='http://www.vinden.co.uk/';re=/MSIE/gi;if(nav.match(re)){is_IE=1;}else{re=/Firefox/gi;if(nav.match(re)){is_firefox=1;}}
var load_side_only=0;var logon_form=null;var page_y=100;var option_y=100;var menu_y=100;var speed=10;var inc=10;var inc_x=40;var inc_y=10;var flash_frame_h=0;var show_laymans=false;var site_fixed_height=0;var site_float=0;var site_width=1000;var flash_disabled=0;var last_menu_obj=null;var menu_in_obj=null;var menu_out_obj=null;var menus_loaded=Array();var page_type="";var page_id="";var products=Array();var qa_arr=Array();var menu_width=200;var left_menu_width=200;var right_menu_width=400;var header_img_repeat=0;var main_overflow_x=0;var main_overflow_y=1;var left_overflow_x=0;var left_overflow_y=1;var right_overflow_x=0;var right_overflow_y=1;var site_float_y=0;var flash_color_1="#ffffff";var flash_color_2="#ffffff";var flash_highlight_color="#FFC20E";var flash_main_color_1="#ffffff";var flash_main_color_2="#ffffff";var flash_bg_color="#ffffff";var flash_back_width=450;var default_postage=4.95;var non_default_postage=10.95;var default_postage_text="Postage & Insurance";var non_default_postage_text="International Postage";var top_bar_font_color='#231f20';var dropdown_menu_left_offset=0;var mem_allow_logon=1;var gallery_show_img_name=0;var gallery_img_name_color='#ff0000';var header_height=160;var header_type=1;var can_get_basket=0;var footer_bar_height=35;var print_header="";var gallery_background_random=0;var page_back_img_below_header=2;var basket_empty_txt="";var main_menu_btn_spacing=1;var dropdown_min_height=40;var form_error_color="#ff0000";var ARTICLES_TITLE="Articles";var USE_HTACCESS_REWRITE=1;var DEFAULT_NAME="The Vinden Partnership";var FONT_COLOR="#231f20";var URL_REPLACE_SPACE="";var URL_REPLACE_REPLACE="+-+";function flashAction(action){closeAllMenus();switch(action){}}
function checkEnterPressed(e){if(!e){if(window.event){e=window.event;}else{return false;}}
if(typeof(e.which)=='number'){e=e.which;if(e=='13')return true;}else if(typeof(e.keyCode)=='number'){e=e.keyCode;if(e=='13')return true;}else if(typeof(e.charCode)=='number'){e=e.charCode;if(e=='13')return true;}else{return false;;}}
function bookmark(){title=document.title;url=document.location;if(window.external){try{window.external.AddFavorite(url,title);}catch(e){}}
if(window.sidebar){try{window.sidebar.addPanel(title,url,'');}catch(e){}}}
function updateDivHTML(id,txt,is_encoded){if(document.getElementById(id)){document.getElementById(id).innerHTML=(is_encoded==1)?decode64(txt):txt;}}
function checkemail(email){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if(filter.test(email))
return true;else{return false;}}
function printPrep(html){re=/(<[^>]*)\bname[\s]*=[\s]*(['"]?)[^\2\s>]+/gi;if(html.match(re)){html=html.replace(re,"$1");}
re=/(<[^>]*)\bid[\s]*=[\s]*(['"]?)[^\2\s>]+/gi;if(html.match(re)){html=html.replace(re,"$1");}
re=/<script>.*?<\/script>/gi;if(html.match(re)){html=html.replace(re,"");}
re=/overflow: hidden;/gi;if(html.match(re)){html=html.replace(re,"");}
return html;}
function printDiv(div){if(div&&document.getElementById('print_div')){document.getElementById('print_div').innerHTML=print_header;document.getElementById('print_div').innerHTML+=printPrep(div.innerHTML);window.print();}}
function updatePrintDiv(){if((document.getElementById('main_content'))&&(document.getElementById('print_div'))){document.getElementById('print_div').innerHTML=print_header;document.getElementById('print_div').innerHTML+=printPrep(document.getElementById('main_content').innerHTML);}}
function createControls(){document.write("<iframe name=\"main_frame\" id=\"main_frame\"></iframe>\r\n");document.write("<iframe name=\"process_frame\" id=\"process_frame\"></iframe>\r\n");document.write("<iframe name=\"process_frame2\" id=\"process_frame2\"></iframe>\r\n");document.write("<iframe name=\"logon_frame\" id=\"logon_frame\"></iframe>\r\n");}
function formatQAItem(str){re=/<AND>/gi
str=str.replace(re,"&");re=/<DBLQUOTE>/gi
str=str.replace(re,'"');re=/<SGLQUOTE>/gi
str=str.replace(re,"'");return str;}
function loadQA(id){try{if(qa_arr[id]){arr=qa_arr[id];last_cat1="";last_cat2="";current_list=null;for(i=0;i<arr.length;i++){cat1=arr[i]["category1"];cat2=arr[i]["category2"];if(last_cat1!=cat1){last_cat1=cat1;last_cat2=cat2;newItem=document.createElement('option');newItem.value=cat2;newItem.text=(cat2!="")?"-- "+formatQAItem(cat2):"-- "+formatQAItem(cat1);re=/\W/gi;cat_str=cat1.replace(re,"").toLowerCase();list=document.getElementById(cat_str+"_cat2_"+id);if(list){current_list=list;try{list.add(newItem,null);}catch(ie_err){list.add(newItem);}}else{current_list=null;}}
if((last_cat2!=cat2)&&(current_list)){last_cat2=cat2;newItem=document.createElement('option');newItem.value=cat2;newItem.text="-- "+cat2;try{list.add(newItem,null);}catch(ie_err){list.add(newItem);}}}}}catch(qa_err){}}
function clearList(list){if((list)&&(list.length>0)){for(l=(list.length-1);l>=0;l--){list.remove(l);}
list.length=0;}}
function showQABlank(cat_str,cat,id){blank_div=document.getElementById(cat_str+"_blank_"+id);if((blank_div)&&(qa_arr[id])){arr=qa_arr[id];for(a=0;a<arr.length;a++){if(arr[a]["category1"]==cat){div=document.getElementById("txt_div_"+a+"_"+id);if(div){div.style.display="none";}}}
blank_div.style.display="block";}}
function loadQuestions(list,index,cat,id){if(index>-1){val=list[index].value;re=/\W/gi;cat_str=cat.replace(re,"").toLowerCase();list=document.getElementById(cat_str+"_qs_"+id);if(list){clearList(list);showQABlank(cat_str,cat,id);if(val=="resetlist"){if(document.getElementById('qs_div_'+id)){document.getElementById('qs_div_'+id).innerHTML="&nbsp;";}}else{if(document.getElementById('qs_div_'+id)){document.getElementById('qs_div_'+id).innerHTML="Now choose your question";}
newItem=document.createElement('option');newItem.value="reset";newItem.text="Select your question here";newItem.style.color="#666666";try{list.add(newItem,null);}catch(ie_err){list.add(newItem);}
arr=qa_arr[id];for(a=0;a<arr.length;a++){if((arr[a]["category1"]==cat)&&(arr[a]["category2"]==val)){newItem=document.createElement('option');newItem.value=a;newItem.text="-- "+formatQAItem(arr[a]["question"]);try{list.add(newItem,null);}catch(ie_err){list.add(newItem);}}}}}else{}}}
function loadAnswer(list,index,cat,id){if(index>-1){val=list[index].value;Math.abs(val);re=/\W/gi;cat_str=cat.replace(re,"").toLowerCase();if(qa_arr[id]){found=0;arr=qa_arr[id];for(a=0;a<arr.length;a++){if(arr[a]["category1"]==cat){div=document.getElementById("txt_div_"+a+"_"+id);if(div){div.style.display=(a==val)?"block":"none";if(a==val){found=1;}}}}
blank_div=document.getElementById(cat_str+"_blank_"+id);if(blank_div){blank_div.style.display=(found==1)?"none":"block";}}}}
function stopScrollDiv(id){if(window[id]){clearTimeout(window[id]);}}
function startScrollDiv(id){if(window[id]){clearTimeout(window[id]);}
window[id]=setInterval("scrollDiv('"+id+"')",60);}
function scrollDiv(id){if((document.getElementById("d_"+id))&&(document.getElementById("s_"+id))){try{frame_h=parseInt(parent.document.getElementById("d_"+id).style.height);div_h=document.getElementById("s_"+id).clientHeight;t=parseInt(document.getElementById("s_"+id).style.top);if(t>(0-div_h)){document.getElementById("s_"+id).style.top=(t-1)+"px";}else{document.getElementById("s_"+id).style.top=frame_h+"px";}}catch(e){}}}
function toggleShowSearch(div,search_box_tag){if(search_box_tag){search_box_tag="_"+search_box_tag;}else{search_box_tag="";}
img=div+"_img";re1=/_down/gi;re2=/_up/gi;if(document.getElementById(img)){shown=(document.getElementById(img).src.match(re1))?1:0
document.getElementById(img).src=(shown==1)?document.getElementById(img).src.replace(re1,"_up"):document.getElementById(img).src.replace(re2,"_down");if(document.getElementById(div)){document.getElementById(div).style.display=(shown==1)?"block":"none";resizePage();}
show_search_box=(shown==1)?1:0;expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+6);parent.document.cookie="show_search_box"+search_box_tag+"="+show_search_box+";expires="+expireDate.toGMTString()+";path=/";}}
function toggleMainMenu(bool){if(document.getElementById('header_menu')){document.getElementById('header_menu').style.display=(bool)?"block":"none";}}
function toggleHeader(bool){check_h=(bool)?"block":"none";if(document.getElementById('header').style.display!=check_h){document.getElementById('header').style.height=(bool)?header_height+"px":"0px";document.getElementById('header').style.display=(bool)?"block":"none";}
if((document.getElementById('custom_header'))&&(document.getElementById('custom_header').style.display!=check_h)){document.getElementById('custom_header').style.display=(bool)?"block":"none";}}
function toggleFooter(bool){check_h=(bool)?"block":"none";if((document.getElementById('footer_menu'))&&(document.getElementById('footer_menu').style.display!=check_h)){document.getElementById('footer_menu').style.display=(bool)?"block":"none";}}
function updateHeader(html){if(document.getElementById('custom_header')){if(document.getElementById('custom_header').innerHTML!=decode64(html)){document.getElementById('custom_header').innerHTML=decode64(html);}}}
function removeLastSearchOption(rewrite_flag){search_options="";theCookie=""+parent.document.cookie;cookieName="search_options"+DEFAULT_NAME.toLowerCase();ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName==""){basket="";}else{ind1=theCookie.indexOf(';',ind);if(ind1==-1){ind1=theCookie.length;}
val=unescape(theCookie.substring(ind+cookieName.length+1,ind1));search_options=val;}
if(search_options!=""){search_opt_arr=search_options.split("|");new_search_options="";for(i=0;i<search_opt_arr.length-1;i++){new_search_options+=(new_search_options!="")?"|":"";new_search_options+=search_opt_arr[i];}
expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+2);document.cookie="search_options"+DEFAULT_NAME.toLowerCase()+"="+new_search_options+";expires="+expireDate.toGMTString()+";path=/";if(rewrite_flag){var loc=window.location+"";re=/page\d+$/g
loc=loc.replace(re,"");window.location=loc;}else if(current_page!=""){p_url=global_url+current_page.substr(1);q_arr=p_url.split("?");q_arr2=q_arr[1].split("&");new_q_str="";for(i=0;i<q_arr2.length;i++){if((q_arr2[i].split("=")[0]!="rs")&&(q_arr2[i].split("=")[0]!="cp")){new_q_str+=(new_q_str=="")?q_arr2[i]:"&"+q_arr2[i];}}
p_url=q_arr[0]+"?"+new_q_str;loadPage(p_url);}}}
function getCalenderPosition(coord,myevent){w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;val=getCurrentMousePosition(coord,myevent);if(coord=="x"){w+=document.documentElement.scrollLeft;cal_center_w=Math.ceil(parseInt(document.getElementById('calender').clientWidth)/2);if((val+cal_center_w)>w){x=w-(cal_center_w*2)}else{x=val-cal_center_w}
return x;}
if(coord=="y"){h+=document.documentElement.scrollTop;cal_center_h=Math.ceil(parseInt(document.getElementById('calender').clientHeight)/2);if((val+cal_center_h)>h){y=h-(cal_center_h*2)}else{y=val-cal_center_h}
return y;}
return 0;}
function getCurrentMousePosition(coord,myevent){try{start_move=0;if(mouse_move_started==0){start_move=1;startMouseMove();}
getMouseXY(myevent);if(start_move==1){mouse_move_started=0;document.onmousemove=null;}
if(coord=="x"){return tempX;}
if(coord=="y"){return tempY;}}catch(er){}
return 0;}
function clearSearchOptions(reload_p,rewrite_flag){expireDate=new Date;expireDate.setMonth(expireDate.getMonth()-2);document.cookie="search_options"+DEFAULT_NAME.toLowerCase()+"=;expires="+expireDate.toGMTString()+";path=/";if(USE_HTACCESS_REWRITE==0){document.cookie="search_article_options=;expires="+expireDate.toGMTString()+";path=/";document.cookie="show_search_box_article=;expires="+expireDate.toGMTString()+";path=/";}
document.cookie="show_search_box=;expires="+expireDate.toGMTString()+";path=/";if(reload_p){if(rewrite_flag){var loc=window.location+"";re=/page\d+$/g
loc=loc.replace(re,"");window.location=loc;}else if(current_page!=""){p_url=global_url+current_page.substr(1)+"&clear";q_arr=p_url.split("?");q_arr2=q_arr[1].split("&");new_q_str="";for(i=0;i<q_arr2.length;i++){if((q_arr2[i].split("=")[0]!="rs")&&(q_arr2[i].split("=")[0]!="cp")&&(q_arr2[i].split("=")[0]!="show_all")){new_q_str+=(new_q_str=="")?q_arr2[i]:"&"+q_arr2[i];}}
p_url=q_arr[0]+"?"+new_q_str;loadPage(p_url);}}}
function updateSearchArticles(keyword,category,date_from,date_to){str=encode64(keyword+"")+"|"+encode64(category+"")+"|"+encode64(date_from+"")+"|"+encode64(date_to+"");expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+2);document.cookie="search_article_options="+str+";expires="+expireDate.toGMTString()+";path=/";if(current_page!=""){p_url=global_url+current_page.substr(1)+"&1";q_arr=p_url.split("?");q_arr2=q_arr[1].split("&");var load_cat_tag="";new_q_str="";for(i=0;i<q_arr2.length;i++){if(q_arr2[i].split("=")[0]=="load_article"){load_cat_tag=q_arr2[i].split("=")[1];}
if((q_arr2[i].split("=")[0]!="rs")&&(q_arr2[i].split("=")[0]!="cp")){new_q_str+=(new_q_str=="")?q_arr2[i]:"&"+q_arr2[i];}}
p_url=q_arr[0]+"?"+new_q_str;loadPage(p_url);}else if(USE_HTACCESS_REWRITE==1){var loc=window.location+"";re=/page\d+$/g
loc=loc.replace(re,"");window.location=loc;}}
function updateSearchOption(opt,type,rewrite_flag){if(opt!=""){search_options="";theCookie=""+parent.document.cookie;cookieName="search_options"+DEFAULT_NAME.toLowerCase();ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName==""){basket="";}else{ind1=theCookie.indexOf(';',ind);if(ind1==-1){ind1=theCookie.length;}
val=unescape(theCookie.substring(ind+cookieName.length+1,ind1));search_options=val;if(search_options==";"){search_options="";}}
if(search_options!=""){search_opt_arr=search_options.split("|");}else{search_opt_arr=Array();}
if(type=="add"){found=0;for(i=0;i<search_opt_arr.length;i++){if(search_opt_arr[i]==opt){found=1;break;}}
if(found==0){search_opt_arr.push(opt);}}else if(type=="remove"){found=0;for(i=0;i<search_opt_arr.length;i++){if(search_opt_arr[i]==opt){search_opt_arr.splice(i,1);break;}}}
new_search_options="";for(i=0;i<search_opt_arr.length;i++){new_search_options+=(new_search_options!="")?"|":"";new_search_options+=search_opt_arr[i];}
expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+2);document.cookie="search_options"+DEFAULT_NAME.toLowerCase()+"="+new_search_options+";expires="+expireDate.toGMTString()+";path=/";if(search_options!=new_search_options){if(rewrite_flag){var loc=window.location+"";re=/page\d+$/g
loc=loc.replace(re,"");window.location=loc;}else if(new_search_options==""){loc=window.location;window.location=loc;}else if(current_page!=""){p_url=global_url+current_page.substr(1)+"&1";q_arr=p_url.split("?");q_arr2=q_arr[1].split("&");new_q_str="";for(i=0;i<q_arr2.length;i++){if((q_arr2[i].split("=")[0]!="rs")&&(q_arr2[i].split("=")[0]!="cp")){new_q_str+=(new_q_str=="")?q_arr2[i]:"&"+q_arr2[i];}}
p_url=q_arr[0]+"?"+new_q_str;loadPage(p_url);}}}}
function showLoading(){document.getElementById('main_content').innerHTML="<div id=\"vinden_page_back\">&nbsp;</div><div id=\"vinden_page\"><div id=\"vinden_page_frame\"><div id=\"vinden_page_content\"><div><table id=\"vinden_page_table\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td id=\"vinden_page_text\" valign=\"top\"><div id=\"vinden_page_text_default\"><div id=\"vinden_loading\">loading please wait...</div></div></td></tr></tbody></table></div></div></div><div id=\"vinden_page_shadow\">&nbsp;</div></div>";}
function updateMainContent(){frame=window.frames['main_frame'];document.getElementById('main_frame').style.display="block";if(frame.document.getElementById('page_details')){document.getElementById('main_content').innerHTML=frame.document.getElementById('page_details').innerHTML;updatePrintDiv();try{if(frame.document.getElementById('left_menu_details')){if(frame.document.getElementById('left_menu_details').innerHTML!="LEAVE"){document.getElementById('left_content').innerHTML=frame.document.getElementById('left_menu_details').innerHTML;}}else{if(document.getElementById('left_content')){document.getElementById('left_content').innerHTML="";}
menu_y=100;}
if(frame.document.getElementById('right_menu_details')){document.getElementById('right_content').style.display="block";if(frame.document.getElementById('right_menu_details').innerHTML!="LEAVE"){document.getElementById('right_content').innerHTML=frame.document.getElementById('right_menu_details').innerHTML;}}else{if(document.getElementById('right_content')){document.getElementById('right_content').innerHTML="";}
option_y=100;}
try{closeAllMenus();}catch(e){}}catch(e1){}
try{frame.onPageComplete();}catch(e){}}
window.frames['main_frame'].src="";resizePage();document.getElementById('main_frame').style.display="none";}
function loadFlashPage(type,p){if(type!=""){loadPage(global_url+"scripts/pages.php?page_type="+type+"&p="+p);}else{loadPageNum(p);}}
var auto_load_cat="";function rtnHome(){var str=decode64("aHR0cDovLw==");var re=new RegExp("https://");window.location.href=global_url.replace(re,str);}
function loadMenu(type,id,page_type){frame=(type==1)?"side_menu_frame":"features_frame";str=type+"|"+id+"|"+page_type;str=encode64(str);document.getElementById(frame).src=global_url+"scripts/options.php?"+str;}
var gallery_style=0;var gallery_downloads=1;var flash_load_str="";var load_flash_on_complete=0;var side_menu_moving=0;var right_menu_moving=0;function loadFlash(str){if(!str){str="";}
if(str!=""){temp=str.split(":");flash=temp[0].toLowerCase();re1=/\s{1,}/gi;flash=flash.replace(re1,"_");size=temp[1];if(!temp[2]){xtra="";}else{xtra=temp[2];}
var w=Math.abs(temp[4]);if(side_menu_moving==0){if((flash_in==0)||(flash_frame_h!=size)){load_flash_on_complete=1;flash_load_str=str;document.getElementById('flash_frame').innerHTML="";if(flash_frame_h<size){flash_frame_h=size;flashIn();}else{flash_frame_h=size;flash_out_h=size;flashOut();}}else{load_flash_on_complete=0;flash_load_str="";re=/gallery carousel/gi;if(str.match(re)){f_file=loadSWF(flash,flash+".swf?global_url="+global_url+"&gallery="+temp[2]+"&page="+temp[3]+"&style="+gallery_style+"&downloads="+gallery_downloads+"&high_c="+flash_highlight_color+"&show_name="+gallery_show_img_name+"&name_c="+gallery_img_name_color+"&bg_color="+flash_bg_color+"&w="+w);}else{f_file=loadSWF(flash,flash+".swf?global_url="+global_url+"&c1="+flash_color_1+"&c2="+flash_color_2+"&high_c="+flash_highlight_color+"&main_c1="+flash_main_color_1+"&main_c2="+flash_main_color_2+"&bw="+flash_back_width+"&xtra="+xtra+"&w="+w);}
document.getElementById('flash_frame').innerHTML=f_file;}}else{load_flash_on_complete=1;flash_load_str=str;}}else if(flash_in==1){load_flash_on_complete=0;flash_out_h=0;flash_load_str="";document.getElementById('flash_frame').innerHTML="";flashOut();}}
function loadFlashDiv(str,divname){div=document.getElementById(divname);if(div){if(str==""){div.innerHTML="";}else{temp=str.split(":");flash=temp[0].toLowerCase();re1=/\s{1,}/gi;flash=flash.replace(re1,"_");size=temp[1];if(!temp[2]){xtra="";}else{xtra=temp[2];}
var w=Math.abs(temp[4]);re=/gallery carousel/gi;if(str.match(re)){f_file=loadSWF(flash,flash+".swf?global_url="+global_url+"&gallery="+temp[2]+"&page="+temp[3]+"&style="+gallery_style+"&downloads="+gallery_downloads+"&high_c="+flash_highlight_color+"&show_name="+gallery_show_img_name+"&name_c="+gallery_img_name_color+"&bg_color="+flash_bg_color+"&w="+w);}else{f_file=loadSWF(flash,flash+".swf?global_url="+global_url+"&c1="+flash_color_1+"&c2="+flash_color_2+"&high_c="+flash_highlight_color+"&main_c1="+flash_main_color_1+"&main_c2="+flash_main_color_2+"&bw="+flash_back_width+"&xtra="+xtra+"&w="+w);}
div.innerHTML=f_file;}}}
function loadSWF(f,fs,width,height,path,scale,salign){if((!path)||(path=="")){path=global_url+'flash/';}
if(!width){width="100%";}
if(!height){height="100%";}
if(!scale){scale="noscale";}
if(!salign){salign="";}
f_file='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="'+f+'" align="middle"><param name="salign" value="'+salign+'" /><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+path+fs+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="'+scale+'" /><param name="wmode" value="transparent" /><embed src="'+path+fs+'" loop="false" menu="false" quality="high"  scale="'+scale+'" wmode="transparent"  width="'+width+'" height="'+height+'" salign="'+salign+'" name="'+f+'"  align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';return f_file;}
function drawFlash(f,fs,w,h,path,scale){document.write(loadSWF(f,fs,w,h,path,scale));}
function loadSWFBackground(swf_back_file,swf_scale_type,swf_alignment){document.write(loadSWF("swf_back",swf_back_file,"100%","100%",global_url+"flash/",swf_scale_type,swf_alignment));}
function openWindow(id,url,w,h){resizeable="no";if(!w){w="800";resizeable="yes";}
if(!h){h="600";resizeable="yes";}
params='width='+w+', height='+h+', resizable='+resizeable+', scrollbars=no, toolbars=no, location=no, directories=no, status=no, menubar=no, copyhistory=no';var fwin=window.open(url,id,params);if(fwin&&window.focus)fwin.focus();}
var last_cat_src="";function loadCatalogue(product_id,cat1,cat2,brand,tag,auto){moveCalender(-2000,-2000);str=str1=product_id+","+cat1+","+cat2+","+brand+","+tag;str=encode64(str);showLoading();document.getElementById('main_frame').src=last_cat_src=global_url+"scripts/pages.php?load_catalogue="+str;}
function loadArticle(article_id,list_type,category,no_of_records,date_from,date_to){moveCalender(-2000,-2000);str=str1=article_id+","+list_type+","+category+","+no_of_records+","+date_from+","+date_to;str=encode64(str);showLoading();document.getElementById('main_frame').src=last_cat_src=global_url+"scripts/pages.php?load_article="+str;}
function cancelStyle(){}
function loadPageStyle(img,flag,background_image,background_repeat){re_img=/.jpg/gi;flag=Math.abs(flag);try{folder_path=(img=="header_default.jpg")?"images/":"uploads/image/";header_img=((img!="")&&(flag=='1'))?"url("+global_url+folder_path+img+")":"none";if(document.getElementById('header_img_div').style.backgroundImage!=header_img){document.getElementById('header_img_div').style.backgroundImage=header_img;document.getElementById('header_img_div').style.backgroundRepeat=(header_img_repeat==1)?"repeat-x":"no-repeat";document.getElementById('header_img_div').style.backgroundPosition="50% 0px";}}catch(e1){document.getElementById('header').style.backgroundImage="none";}
try{if((background_image)&&(background_image!="")&&(background_image.substr(0,8)!="gallery:")){if(document.getElementById('main_page_back').style.backgroundImage!="url("+global_url+"uploads/image/"+background_image+")"){document.getElementById('main_page_back').style.backgroundImage="url("+global_url+"uploads/image/"+background_image+")";}
document.getElementById('main_page_back').style.backgroundRepeat=(background_repeat!="")?background_repeat:"repeat";}else if(background_image.substr(0,8)!="gallery:"){document.getElementById('main_page_back').style.backgroundImage='none';}}catch(e1){}}
function drawFlashHeader(rtn){obj='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="100%" id="flash_header" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+global_url+'flash/flash_header.swf?global_url='+global_url+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="t" /><param name="wmode" value="transparent" /><embed src="'+global_url+'flash/flash_header.swf?global_url='+global_url+'" loop="false" menu="false" quality="high" scale="noscale" wmode="transparent" salign="t" width="100%" height="100%" name="flash_header" swLiveConnect=true align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';if((is_IE==0)&&(is_firefox==0)){ver=GetSwfVer();if(ver<"10.0.22"){obj='<div style=\"padding:50px;\" align=\"right\">Please download the latest <a href=\"http://get.adobe.com/flashplayer/\" target=\"_blank\" style=\"color:#000000;\"><u>flash player</u></a></div>';}}
if(!rtn){document.write(obj);}else{return obj;}}
function drawFlashHeaderMC(){site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+site_f_width+'" height="100%" id="flash_header_mc" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+global_url+'flash/flash_header_mc.swf?global_url='+global_url+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" /><embed src="'+global_url+'flash/flash_header_mc.swf?global_url='+global_url+'" loop="false" menu="false" quality="high" scale="noscale" wmode="transparent" width="'+site_f_width+'" height="100%" name="flash_header_mc" swLiveConnect=true align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');}
var lastbg_color="transparent";var lastf_color=top_bar_font_color;function toggleBackStyle(field,tog){try{if(tog==1){lastbg_color=(field.style.backgroundColor)?field.style.backgroundColor:lastbg_color;lastf_color=(field.style.color)?field.style.color:lastf_color;}
field.style.backgroundColor=(tog==1)?"#ffffff":lastbg_color;field.style.color=(tog==1)?"#000000":lastf_color;}catch(transErr){}}
function forgotPassword(secure_flag){var str=(secure_flag==1)?"s_forgot_password":"forgot_password";document.getElementById('main_frame').src=last_cat_src=global_url+"scripts/pages.php?"+str;}
function flashSearch(txt){var re=/[^a-zA-Z0-9\s_£&\?\.\-\:\/]/gi
txt=txt.replace(re,'');var re=/\//gi
txt=txt.replace(re,'DIRBAR');var re=/\s+/gi
txt=txt.replace(re,' ');var re=/\s/gi
test=txt.replace(re,"");if(test!=""){if(USE_HTACCESS_REWRITE==1){var dir_str="";var search_arr=txt.split(' ');for(var i=0;i<search_arr.length;i++){search_arr[i]=trim(search_arr[i]);if(search_arr[i]!=""){dir_str+=(dir_str=="")?"":"/";dir_str+=urlencode(search_arr[i]);}}
if(URL_REPLACE_SPACE!=""){var re=new RegExp(URL_REPLACE_SPACE,"gi");dir_str=dir_str.replace(re,URL_REPLACE_REPLACE);var re=/%20/gi
dir_str=dir_str.replace(re,URL_REPLACE_SPACE);var re=/%2B/gi
dir_str=dir_str.replace(re,'+');}
var re=/DIRBAR/gi
dir_str=dir_str.replace(re,'--');var str=decode64("aHR0cDovLw==");var re=new RegExp("https://");top.window.document.location=global_url.replace(re,str)+"search/"+dir_str;}else{txt=encode64(txt);loadPage(global_url+"scripts/search.php?"+txt);}}else{rtnHome();}}
var default_search_txt="";var default_search_bar_show=1;function checkSearchActive(bool){var re=/\s/gi;var check_search=document.search_form.search_txt.value.replace(re,"");if(bool){if((document.search_form.search_txt.value==default_search_txt)||(check_search=="")){document.search_form.search_txt.value='';}}else{if(((document.search_form.search_txt.value=="")||(check_search==""))&&(default_search_bar_show==1)){document.search_form.search_txt.value=default_search_txt;}}}
function checkSearch(){closeAllMenus();fm=document.search_form;if((fm.search_txt.value=="")||(fm.search_txt.value==default_search_txt)||(fm.search_txt.value=="searching...")){fm.search_txt.value=default_search_txt;}else{flashSearch(fm.search_txt.value);toggleBackStyle(fm.search_txt,0);}}
function reloadPage(){if(current_page!=""){document.getElementById('main_frame').src=global_url+current_page;}}
function openDocument(doc){window.open(global_url+"scripts/document.php?"+doc);setTimeout("reloadPage()",5000);}
function askQuestion(){document.getElementById('main_frame').src=global_url+"scripts/ask_question.php?edit=new";}
function formatPassword(field){val=field.value;re=/\W/gi
if(val.match(re)){val=val.replace(re,'');if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="Your password can only contain letters, numbers or the underscore(_)";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="block";}
resizePage();}else{alert("Your password can only contain letters, numbers or the underscore(_)")}
field.focus();field.value=val;}else{if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="&nbsp;";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="none";}
resizePage();}}}
function checkPasswordLength(field){if((field.value.length<6)&&(field.value.length>0)){if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="Your password must be at least 6 characters in length";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="block";}
resizePage();}else{alert("Your password must be at least 6 characters in length");}
field.value="";field.focus();}else{if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="&nbsp;";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="none";}
resizePage();}}}
function checkPasswordMatch(field,original,rtn){if((original)&&(field.value!="")&&(original.value!="")){if(rtn){return(original.value==field.value)?true:false;}else{if(original.value!=field.value){if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="Please re-confirm your password";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="block";}
resizePage();}else{alert("Please re-confirm your password")}
field.value="";field.focus();}else{if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="&nbsp;";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="none";}
resizePage();}}}}else{if(document.getElementById('error_txt')){document.getElementById('error_txt').innerHTML="&nbsp;";if(document.getElementById('error_box')){document.getElementById('error_box').style.display="none";}
resizePage();}}
return true;}
function closeSearch(clear){fm=document.search_form;fm.search_txt.value=(clear)?"":last_search;fm.search_txt.disabled=false;fm.search_btn.value="product code"
fm.search_btn.disabled=false;}
var last_search="";function searchProduct(keyword){last_search=keyword;fm=document.search_form;fm.search_txt.value="searching..."
fm.search_txt.disabled=true;fm.search_btn.value="..."
fm.search_btn.disabled=true;str=str1="search_products|"+keyword+"|";str=encode64(str);document.getElementById('main_frame').src=global_url+"scripts/pages.php?load_catalogue="+str;}
function showSearchResults(clear){fm=document.search_form;fm.search_txt.value=(clear)?"":last_search;fm.search_txt.disabled=false;fm.search_btn.value="product code"
fm.search_btn.disabled=false;}
var flash_in=0;function flashIn(){if(flash_disabled==0){if(document.getElementById('flash_frame')){h=flash_frame_h;document.getElementById('flash_frame').style.height=h+"px";document.getElementById('main_content').style.top=h+"px";document.getElementById('main_content').style.borderTop="1px solid #FFC20E";if(document.getElementById('right_content')){document.getElementById('right_content').style.top=h+"px";document.getElementById('right_content').style.borderTop="1px solid #FFC20E";}
resizePage();flash_in=1;loadFlash(flash_load_str);}}}
var flash_out_h=0;function flashOut(){if(document.getElementById('flash_frame')){h=flash_out_h;document.getElementById('flash_frame').style.height=h+"px";document.getElementById('main_content').style.top=h+"px";if(document.getElementById('right_content')){document.getElementById('right_content').style.top=h+"px";}
if(flash_out_h>0){flash_in=1;loadFlash(flash_load_str);}else{flash_in=0;flash_load_str="";loadFlash(flash_load_str);document.getElementById('main_content').style.borderTop="0px solid #FFC20E";if(document.getElementById('right_content')){document.getElementById('right_content').style.borderTop="0px solid #FFC20E";}}
flash_frame_h=flash_out_h;resizePage();}}
function featuresIn(){site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;w=right_menu_width;if(document.getElementById('right_content')){document.getElementById('right_content').style.width=w+"px";side_w=parseInt(document.getElementById('left_content').style.width);document.getElementById('right_content').style.left=(site_f_width+1-w)+"px";document.getElementById('main_content').style.width=(site_f_width-side_w-w)+"px";}}
function featuresOut(){site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;option_y=100;w=0;if(document.getElementById('right_content')){document.getElementById('right_content').style.width=w+"px";side_w=parseInt(document.getElementById('left_content').style.width);document.getElementById('right_content').style.left=(site_f_width+1-w)+"px";document.getElementById('main_content').style.width=(site_f_width-side_w-w)+"px";}}
function sideMenuIn(){site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;w=left_menu_width;if(document.getElementById('left_content')){document.getElementById('left_content').style.width=w+"px";document.getElementById('main_content').style.left=(w+1)+"px";document.getElementById('flash_frame').style.width=(site_f_width-left_menu_width)+"px";document.getElementById('flash_frame').style.left=left_menu_width+"px";features_w=(document.getElementById('right_content'))?parseInt(document.getElementById('right_content').style.width):0;if(right_menu_moving==1){features_w-=20;}
document.getElementById('main_content').style.width=(site_f_width-features_w-w)+"px";}}
function sideMenuOut(){site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;menu_y=100;w=0;if(document.getElementById('left_content')){document.getElementById('left_content').style.width=w+"px";document.getElementById('main_content').style.left=(w+1)+"px";document.getElementById('flash_frame').style.left="0px";document.getElementById('flash_frame').style.width=site_f_width+"px";features_w=(document.getElementById('right_content'))?parseInt(document.getElementById('right_content').style.width):0;document.getElementById('main_content').style.width=(site_f_width-features_w)+"px";}}
var resize_running=0;function resizePage(){if(resize_running==0){resize_running=1;h=parseInt(document.documentElement.clientHeight);w=parseInt(document.documentElement.clientWidth);w_start=w;if((document.getElementById('header'))&&(document.getElementById('header').innerHTML=="")){}
if((document.getElementById('background_header_div'))&&(document.getElementById('background_header_div').style.display=='none')){document.getElementById('background_header_div').style.display='block';}
if((document.getElementById('background_footer_div'))&&(document.getElementById('background_footer_div').style.display=='none')){document.getElementById('background_footer_div').style.display='block';}
if((document.getElementById('footer_menu'))&&(parseInt(document.getElementById('footer_menu').style.top=-1000))){document.getElementById('footer_menu').style.top="0px";}
if(is_IE==1){if(document.getElementById('custom_header')){document.getElementById('custom_header').style.width=(w)+"px";}
if(document.getElementById('main_div')){document.getElementById('main_div').style.width=(w)+"px";}}
try{if((site_fixed_height>0)&&(site_float_y==1)){t=(Math.floor((h-site_fixed_height)/2)>0)?Math.floor((h-site_fixed_height)/2):0;if(document.getElementById('main_div')){document.getElementById('main_div').style.top=(t)+"px";}
if(document.getElementById('background_header_div')){document.getElementById('background_header_div').style.top=(t)+"px";}}}catch(e){}
try{if(site_width==0){if(document.getElementById('main_page')){document.getElementById('main_page').style.width=(w)+"px";}
if(document.getElementById('main_page_back')){document.getElementById('main_page_back').style.width=(w)+"px";}
if(document.getElementById('background_header_div')){document.getElementById('background_header_div').style.width=(w)+"px";}
if(document.getElementById('background_footer_div')){document.getElementById('background_footer_div').style.width=(w)+"px";}
if(document.getElementById('flash_background')){document.getElementById('flash_background').style.width=(w)+"px";}
if(document.getElementById('header_img_div')){document.getElementById('header_img_div').style.width=(w)+"px";}
if(document.getElementById('header')){document.getElementById('header').style.width=(w)+"px";}
if(document.getElementById('header_menu')){document.getElementById('header_menu').style.width=(w)+"px";}
if(document.getElementById('footer_menu')){document.getElementById('footer_menu').style.width=(w)+"px";}
if(document.getElementById('main_menu')){document.getElementById('main_menu').style.width=(w)+"px";}
if(document.getElementById('dropdown_menus')){document.getElementById('dropdown_menus').style.left=0+"px";}
left_w=0;right_w=0;if(document.getElementById('left_content')){auto=0;if(document.getElementById('left_content').style.overflowY=="auto"){document.getElementById('left_content').style.overflowY="hidden";auto=1;}
left_w=parseInt(document.getElementById('left_content').clientWidth);if(auto==1){document.getElementById('left_content').style.overflowY="auto";}}
if(document.getElementById('right_content')){auto=0;if(document.getElementById('right_content').style.overflowY=="auto"){document.getElementById('right_content').style.overflowY="hidden";auto=1;}
right_w=parseInt(document.getElementById('right_content').clientWidth);if(auto==1){document.getElementById('right_content').style.overflowY="auto";}}
m_w=0;if(document.getElementById('main_content')){m_w=((w-left_w-right_w)>100)?(w-left_w-right_w):100;document.getElementById('main_content').style.width=(m_w)+"px";}
if(document.getElementById('right_content')){document.getElementById('right_content').style.left=(m_w+left_w+2)+"px";}
m_w=0;if(document.getElementById('flash_frame')){m_w=((w-left_w)>10)?(w-left_w):10;document.getElementById('flash_frame').style.width=(m_w)+"px";}}else{if(document.getElementById('dropdown_menus')){drop_left=Math.round((w-(site_width+2))/2);if(drop_left<0){drop_left=0;}
document.getElementById('dropdown_menus').style.left=drop_left+"px";}}}catch(e){}
try{header_h=((document.getElementById('header'))&&(document.getElementById('header').style.display=="block"))?parseInt(document.getElementById('header').clientHeight):0;flash_h=(document.getElementById('flash_frame'))?parseInt(document.getElementById('flash_frame').style.height):0;flash_h+=(document.getElementById('flash_frame'))?parseInt(document.getElementById('flash_frame').style.top):0;header_menu_h=((document.getElementById('header_menu'))&&(document.getElementById('header_menu').style.display=="block"))?parseInt(document.getElementById('header_menu').style.height):0;if(document.getElementById('main_content')){document.getElementById('main_content').style.display="block";page_y=parseInt(document.getElementById('main_content').clientHeight)+20;}
if((document.getElementById('main_page_back'))&&(document.getElementById('main_page_back').style.display=="none")){document.getElementById('main_page_back').style.display="block";}
if(document.getElementById('left_content')){menu_y=parseInt(document.getElementById('left_content').clientHeight)+20;}
if(document.getElementById('right_content')){option_y=parseInt(document.getElementById('right_content').clientHeight)+20;}
footer_h=0;if(document.getElementById('footer_extra_bar')){footer_h+=parseInt(document.getElementById('footer_extra_bar').clientHeight);}
if(document.getElementById('footer_txt_bar')){footer_h+=parseInt(document.getElementById('footer_txt_bar').clientHeight);}
if(document.getElementById('footer_links')){footer_h+=parseInt(document.getElementById('footer_links').clientHeight);}
if(document.getElementById('footer_txt')){footer_h+=parseInt(document.getElementById('footer_txt').clientHeight);}
if(document.getElementById('main_content')){document.getElementById('main_content').style.overflowX=(main_overflow_x==1)?"auto":"hidden";}
if(document.getElementById('right_content')){document.getElementById('right_content').style.overflowX=(right_overflow_x==1)?"auto":"hidden";}
if(document.getElementById('left_content')){document.getElementById('left_content').style.overflowX=(left_overflow_x==1)?"auto":"hidden";}
if(site_fixed_height==0){this_page_y=page_y+flash_h;this_option_y=option_y+flash_h;t_y=(menu_y>this_page_y)?menu_y:this_page_y;t_y=(this_option_y>t_y)?this_option_y:t_y;if((t_y)>(h-header_h-header_menu_h-footer_h)){h1=(t_y-flash_h-footer_h);h2=(t_y);h3=(t_y-1);if(document.getElementById('main_page')){document.getElementById('main_page').style.height=(t_y)+"px";}
if(document.getElementById('dropdown_menus')){document.getElementById('dropdown_menus').style.top=(header_h+header_menu_h)+"px";}
if(document.getElementById('main_page_back')){main_page_back_h=t_y+header_h+header_menu_h+footer_h+4;main_page_back_t=0;if(page_back_img_below_header>0){main_page_back_h-=header_h;main_page_back_t+=header_h;}
if((page_back_img_below_header==2)&&(document.getElementById('main_menu'))){main_page_back_h-=header_menu_h;main_page_back_t+=header_menu_h;}
document.getElementById('main_page_back').style.height=main_page_back_h+"px";document.getElementById('main_page_back').style.top=main_page_back_t+"px";}
if(document.getElementById('background_shadow_left')){document.getElementById('background_shadow_left').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";}
if(document.getElementById('background_shadow_right')){document.getElementById('background_shadow_right').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";document.getElementById('background_shadow_left').style.display=document.getElementById('background_shadow_right').style.display=((w>=(site_width+22))&&(site_width>0))?"block":"none";}
if(document.getElementById('flash_background')){document.getElementById('flash_background').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";}
if(document.getElementById('header_img_div')){document.getElementById('header_img_div').style.height=((t_y+header_h+header_menu_h+footer_h+4)-parseInt(document.getElementById('header_img_div').style.top))+"px";}
if(document.getElementById('background_header_div')){document.getElementById('background_header_div').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";}
if(document.getElementById('background_footer_div')){document.getElementById('background_footer_div').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";document.getElementById('background_footer_div').style.top=(0)+"px";}
if(document.getElementById('disable_page')){document.getElementById('disable_page').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";}
if(document.getElementById('lbOverlay')){document.getElementById('lbOverlay').style.top="0px";document.getElementById('lbOverlay').style.height=(t_y+header_h+header_menu_h+footer_h+4)+"px";if((is_IE==1)&&((t_y+header_h+header_menu_h+footer_h+4)>1500)){document.getElementById('lbOverlay').style.backgroundImage="url("+global_url+"images/black-trans.png)";document.getElementById('lbOverlay').style.backgroundColor="transparent";}else{document.getElementById('lbOverlay').style.backgroundImage="none";document.getElementById('lbOverlay').style.backgroundColor="#000";}}}else{h1=(h-header_h-footer_h-header_menu_h-flash_h);if(h1<10){h1=10;};h2=(h-header_h-header_menu_h-footer_h);if(h2<10){h2=10;};h3=(h-header_h-header_menu_h-101-footer_h-flash_h);if(h3<10){h3=10;};if(document.getElementById('main_page')){document.getElementById('main_page').style.height=(h2-4)+"px";}
if(document.getElementById('dropdown_menus')){document.getElementById('dropdown_menus').style.top=(header_h+header_menu_h)+"px";}
if(document.getElementById('main_page_back')){main_page_back_h=h;main_page_back_t=0;if(page_back_img_below_header>0){main_page_back_h-=header_h;main_page_back_t+=header_h;}
if((page_back_img_below_header==2)&&(document.getElementById('main_menu'))){main_page_back_h-=header_menu_h;main_page_back_t+=header_menu_h;}
document.getElementById('main_page_back').style.height=main_page_back_h+"px";document.getElementById('main_page_back').style.top=main_page_back_t+"px";}
if(document.getElementById('background_shadow_left')){document.getElementById('background_shadow_left').style.height=(h)+"px";}
if(document.getElementById('background_shadow_right')){document.getElementById('background_shadow_right').style.height=(h)+"px";document.getElementById('background_shadow_left').style.display=document.getElementById('background_shadow_right').style.display=((w>=(site_width+22))&&(site_width>0))?"block":"none";}
if(document.getElementById('header_img_div')){document.getElementById('header_img_div').style.height=((h)-parseInt(document.getElementById('header_img_div').style.top))+"px";}
if(document.getElementById('background_header_div')){document.getElementById('background_header_div').style.height="100%";}
if(document.getElementById('background_footer_div')){document.getElementById('background_footer_div').style.height="100%";}
if(document.getElementById('flash_background')){document.getElementById('flash_background').style.height="100%"}
if(document.getElementById('disable_page')){document.getElementById('disable_page').style.height=(h)+"px";}
if(document.getElementById('lbOverlay')){document.getElementById('lbOverlay').style.top="0px";document.getElementById('lbOverlay').style.height=(h)+"px";if((is_IE==1)&&(h>1500)){document.getElementById('lbOverlay').style.backgroundImage="url("+global_url+"images/black-trans.png)";document.getElementById('lbOverlay').style.backgroundColor="transparent";}else{document.getElementById('lbOverlay').style.backgroundImage="none";document.getElementById('lbOverlay').style.backgroundColor="#000";}}}}else{body_h=h;h=site_fixed_height;min_size=h-flash_h-footer_h-50;if(min_size<50){if(flash_h>0){flash_disabled=1;flash_out_h=0;if(window['flash_out']){clearTimeout(window['flash_out']);}
if(window['flash_in']){clearTimeout(window['flash_in']);}
flashOut();flash_h=0;min_size=h-header_h-flash_h-header_menu_h-footer_h-50;if(min_size<50){site_fixed_height=h+Math.abs(min_size)+50;}}}
if(site_float==1){h_top=Math.round((body_h-h)/2);if(h_top<0){h_top=0;}}else{h_top=0;}
if(site_float==2){var page_border=(document.getElementById('main_page_back'))?parseInt(document.getElementById('main_page_back').style.borderTopWidth):0;if(document.getElementById('main_content')){document.getElementById('main_content').style.top=(flash_h>0)?flash_h+"px":page_border+"px";document.getElementById('main_content').style.height=(h-header_menu_h-flash_h)+"px";}
if(document.getElementById('right_content')){document.getElementById('right_content').style.top=(flash_h>0)?flash_h+"px":page_border+"px";document.getElementById('right_content').style.height=(h-header_menu_h-flash_h)+"px";}
if(document.getElementById('left_content')){document.getElementById('left_content').style.top=page_border+"px";document.getElementById('left_content').style.height=(h-header_menu_h)+"px";}
if(document.getElementById('main_page')){document.getElementById('main_page').style.height=(h-header_menu_h-2)+"px";document.getElementById('main_page').style.top=0+"px";}
if(document.getElementById('dropdown_menus')){document.getElementById('dropdown_menus').style.top=(header_h+header_menu_h)+"px";}
if(document.getElementById('main_page_back')){document.getElementById('main_page_back').style.top=header_h+"px";document.getElementById('main_page_back').style.height=(h)+"px";}}else{if(document.getElementById('main_content')){document.getElementById('main_content').style.top=(flash_h>0)?flash_h+"px":page_border+"px";document.getElementById('main_content').style.height=(h-header_h-header_menu_h-flash_h)+"px";}
if(document.getElementById('right_content')){document.getElementById('right_content').style.top=(flash_h>0)?flash_h+"px":page_border+"px";document.getElementById('right_content').style.height=(h-header_h-header_menu_h-flash_h)+"px";}
if(document.getElementById('left_content')){document.getElementById('left_content').style.top=page_border+"px";document.getElementById('left_content').style.height=(h-header_h-header_menu_h)+"px";}
if(document.getElementById('main_page')){document.getElementById('main_page').style.height=(h-header_h-header_menu_h-2)+"px";document.getElementById('main_page').style.top=0+"px";}
if(document.getElementById('dropdown_menus')){document.getElementById('dropdown_menus').style.top=(0-(h-header_h-2))+"px";}
if(document.getElementById('main_page_back')){document.getElementById('main_page_back').style.top=h_top+"px";document.getElementById('main_page_back').style.height=(h)+"px";}}
if(document.getElementById('flash_background')){document.getElementById('flash_background').style.height=(h)+"px";}
if(document.getElementById('disable_page')){h2=(parseInt(document.documentElement.clientHeight)>h)?parseInt(document.documentElement.clientHeight):h;document.getElementById('disable_page').style.height=(h2)+"px";}
if(document.getElementById('lbOverlay')){h2=(parseInt(document.documentElement.clientHeight)>h)?parseInt(document.documentElement.clientHeight):h;document.getElementById('lbOverlay').style.top="0px";document.getElementById('lbOverlay').style.height=(h2)+"px";if((is_IE==1)&&(h2>1500)){document.getElementById('lbOverlay').style.backgroundImage="url("+global_url+"images/black-trans.png)";document.getElementById('lbOverlay').style.backgroundColor="transparent";}else{document.getElementById('lbOverlay').style.backgroundImage="none";document.getElementById('lbOverlay').style.backgroundColor="#000";}}
if(document.getElementById('header_img_div')){document.getElementById('header_img_div').style.top=h_top+"px";document.getElementById('header_img_div').style.height=(h+header_h)+"px";}
if(document.getElementById('background_shadow_left')){document.getElementById('background_shadow_left').style.top=h_top+"px";document.getElementById('background_shadow_left').style.height=(h)+"px";}
if(document.getElementById('background_shadow_right')){document.getElementById('background_shadow_right').style.top=h_top+"px";document.getElementById('background_shadow_right').style.height=(h)+"px";document.getElementById('background_shadow_left').style.display=document.getElementById('background_shadow_right').style.display=((w>=(site_width+22))&&(site_width>0))?"block":"none";}
h+=header_h+footer_h;back_h=(body_h>h)?body_h:h;if(document.getElementById('background_header_div')){document.getElementById('background_header_div').style.height=(back_h)+"px";document.getElementById('background_header_div').style.top=(0)+"px";}
if(document.getElementById('background_footer_div')){document.getElementById('background_footer_div').style.height=(back_h)+"px";document.getElementById('background_footer_div').style.top=(0)+"px";}}}catch(e){}
try{if(document.getElementById('page_logo')&&(document.getElementById('page_logo').style.display!="block")){document.getElementById('page_logo').style.display="block";}}catch(e){}
resize_running=0;w=parseInt(document.documentElement.clientWidth);if(w!=w_start){resizePage();}}}
var submenu_left=menu_width;var submenu_width=menu_width;var menu_image_height=200;var submenu_height=menu_image_height;var submenu_top=0;var item_menu_left=menu_width*2;var item_menu_width=400;var item_menu_height=menu_image_height;var disable_item_out=0;var disable_sub_out=0;var last_goto=0;function shopCheckOut(){window.location.href=s_global_url+"checkout";}
function viewBasket(){window.location.href=s_global_url+"basket";}
function getBasket(){document.getElementById('process_frame').src=global_url+"scripts/catalogue.php?getBasket";}
function memberLogin(type,details,reload_page,is_member,is_logged_in){try{closeLightBox();}catch(lb_err){}
if(mem_allow_logon==1){if(type==0){expireDate=new Date;expireDate.setMonth(expireDate.getMonth()-6);expires=expireDate.toGMTString();document.cookie="m_details=;expires="+expires+";path=/";document.cookie="is_logged_in=;expires="+expires+";path=/";document.cookie="is_member=;expires="+expires+";path=/";if(Math.abs(reload_page)==1){rtnHome();}else{memberStatus(0,0,'');}}
if(type==1){current_page="/scripts/members.php";document.getElementById('main_frame').src=global_url+"scripts/members.php?1";}
if(type==2){d=decode64(details);d_arr=d.split("|");if(d_arr.length>=5){member_name=decode64(d_arr[0]);expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+3);expires=expireDate.toGMTString();document.cookie="m_details="+details+";expires="+expires+";path=/";document.cookie="is_member=1;expires="+expires+";path=/";expireDate=new Date;expireDate.setMinutes(expireDate.getMinutes()+120);expires=expireDate.toGMTString();document.cookie="is_logged_in=1;expires="+expires+";path=/";memberStatus(1,1,member_name);if(Math.abs(reload_page)==1){if(current_page!=""){src=global_url+current_page.substr(1);top.window.location.href=src;}else{var loc=top.window.document.location+"";top.window.location.href=loc;}}}else{memberStatus(0,0,'');if(Math.abs(reload_page)==1){if(current_page!=""){src=global_url+current_page.substr(1);top.window.location.href=src;}else{var loc=top.window.document.location+"";top.window.location.href=loc;}}}}
if(type==3){d=decode64(details);d_arr=d.split("|");if(d_arr.length>=5){member_name=decode64(d_arr[0]);expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+3);expires=expireDate.toGMTString();document.cookie="m_details="+details+";expires="+expires+";path=/";document.cookie="is_member="+is_member+";expires="+expires+";path=/";expireDate=new Date;expireDate.setMinutes(expireDate.getMinutes()+120);expires=expireDate.toGMTString();document.cookie="is_logged_in="+is_logged_in+";expires="+expires+";path=/";memberStatus(is_member,is_logged_in,member_name);}else{memberStatus(0,0,'');}}
if(type==4){current_page="/scripts/members.php";document.getElementById('main_frame').src=global_url+"scripts/members.php?2";}}}
var mem_logon_text="Client Logon";var mem_logon_text_dir="Client Logon";function memberStatus(is_member,is_logged_in,member_name){if(mem_allow_logon==1){div=document.getElementById('main_frame');txt="";if(is_member==1){txt="Welcome "+member_name;}
if((is_logged_in==0)&&(div)){txt+="<a href=\""+s_global_url+mem_logon_text_dir.toLowerCase()+"\">";txt+=(is_member==1)?"&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;"+mem_logon_text:mem_logon_text;txt+="</a>";}else if(is_member==1){if(div){txt+="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\""+s_global_url+mem_logon_text_dir.toLowerCase()+"\">"+mem_logon_text+"</a>";}
if(is_logged_in==1){txt+="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\"javascript:memberLogin(0,'',1);\">Sign&nbsp;Out</a>";}else if(!div){txt+="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;You are not signed in.";}}
updateLogOnTxt(txt);}}
var log_txt="";function updateLogOnTxt(txt){if(document.getElementById('logon_status_txt')){try{document.getElementById('logon_status_txt').innerHTML=txt;}catch(e){}}}
function start(){if(is_IE==1){document.body.scroll="yes";}
updatePrintDiv();try{onPageComplete();}catch(e){}
loaded=1;resizePage();if(mem_allow_logon==1){document.getElementById('logon_frame').src=global_url+"scripts/members.php?checklogon";}
if(can_get_basket==1){document.getElementById('process_frame').src=global_url+"scripts/catalogue.php?getBasket";}
if(page_images.length>0){loadOtherImages();}}
var default_bg_top_img="";var default_bg_bottom_img="";var default_pg_border_color="";var default_menu_border_color="";var default_menu_font_color="";var current_menu_font_color="";function setThemeDefaults(){if(document.getElementById('background_header_div')){default_bg_top_img=document.getElementById('background_header_div').style.backgroundImage;}
if(document.getElementById('background_footer_div')){default_bg_bottom_img=document.getElementById('background_footer_div').style.backgroundImage;}
if(document.getElementById('main_page_back')){if(document.getElementById('main_page_back').style.borderColor){default_pg_border_color=document.getElementById('main_page_back').style.borderColor;}else if(document.getElementById('main_page_back').style.borderTopColor){default_pg_border_color=document.getElementById('main_page_back').style.borderTopColor;}else if(document.getElementById('main_page_back').style.borderBottomColor){default_pg_border_color=document.getElementById('main_page_back').style.borderBottomColor;}else if(document.getElementById('main_page_back').style.borderLeftColor){default_pg_border_color=document.getElementById('main_page_back').style.borderLeftColor;}else if(document.getElementById('main_page_back').style.borderRightColor){default_pg_border_color=document.getElementById('main_page_back').style.borderRightColor;}}
if(document.getElementById('header_menu')){if(document.getElementById('header_menu').style.borderColor){default_menu_border_color=document.getElementById('header_menu').style.borderColor;}else if(document.getElementById('header_menu').style.borderTopColor){default_menu_border_color=document.getElementById('header_menu').style.borderTopColor;}else if(document.getElementById('header_menu').style.borderBottomColor){default_menu_border_color=document.getElementById('header_menu').style.borderBottomColor;}else if(document.getElementById('header_menu').style.borderLeftColor){default_menu_border_color=document.getElementById('header_menu').style.borderLeftColor;}else if(document.getElementById('header_menu').style.borderRightColor){default_menu_border_color=document.getElementById('header_menu').style.borderRightColor;}}
if(total_btns>0){for(i=1;i<(total_btns+1);i++){if(document.getElementById('main_btn_'+i)){default_menu_font_color=current_menu_font_color=document.getElementById('main_btn_'+i).style.color;break;}}}}
function updateTheme(bg_top_img,bg_bottom_img,pg_border_color,menu_border_color,menu_font_color){current_menu_font_color=(menu_font_color!="")?menu_font_color:default_menu_font_color;if(document.getElementById('background_header_div')){if(bg_top_img=="none"){document.getElementById('background_header_div').style.backgroundImage="none";}else{document.getElementById('background_header_div').style.backgroundImage=(bg_top_img!="")?"url("+bg_top_img+")":default_bg_top_img;}}
if(document.getElementById('background_footer_div')){if(bg_bottom_img=="none"){document.getElementById('background_footer_div').style.backgroundImage="none";}else{document.getElementById('background_footer_div').style.backgroundImage=(bg_bottom_img!="")?"url("+bg_bottom_img+")":default_bg_bottom_img;}}
if(document.getElementById('main_page_back')){obj=document.getElementById('main_page_back').style;obj.borderColor=obj.borderTopColor=obj.borderBottomColor=obj.borderLeftColor=obj.borderRightColor=(pg_border_color!="")?pg_border_color:default_pg_border_color;}
if(document.getElementById('header_menu')){obj=document.getElementById('header_menu').style;obj.borderColor=obj.borderTopColor=obj.borderBottomColor=obj.borderLeftColor=obj.borderRightColor=(menu_border_color!="")?menu_border_color:default_menu_border_color;}
if(total_btns>0){for(i=1;i<(total_btns+1);i++){if(document.getElementById('main_btn_'+i)){document.getElementById('main_btn_'+i).style.color=(menu_font_color!="")?menu_font_color:default_menu_font_color;}}}}
var menu_dif=0;var menu_z=0;function loadTopPage(p){top.location.href=p;}
function loadPage(p){closeAllMenus();moveCalender(-2000,-2000);showLoading();document.getElementById('main_frame').src=p;try{document.getElementById('main_frame').focus();}catch(e){}}
function loadPageJS(p){closeAllMenus();moveCalender(-2000,-2000);showLoading();document.getElementById('main_frame').src=p;try{document.getElementById('main_frame').focus();}catch(e){}}
function loadPageNum(p){closeAllMenus();moveCalender(-2000,-2000);showLoading();document.getElementById('main_frame').src=global_url+"scripts/pages.php?p="+p;try{document.getElementById('main_frame').focus();}catch(e){}}
function loadMemberPageNum(p){closeAllMenus();moveCalender(-2000,-2000);showLoading();document.getElementById('main_frame').src=global_url+"scripts/members.php?p="+p;try{document.getElementById('main_frame').focus();}catch(e){}}
function checkMenuOut(m){if(window[m+'out']){clearTimeout(window[m+'out']);}
window[m+'out']=setTimeout("menuOut('"+m+"')",250);}
function clearMenuOut(m){if(window[m+'out']){clearTimeout(window[m+'out']);}}
function reloadMenu(mod){if(mod!=current_module){current_module=mod;menu_height_array=Array();document.getElementById('dropdown_menus').innerHTML="";document.getElementById('main_menu').innerHTML="<div style=\"font-size:5px;\">&nbsp</div><div style=\"width:100%;text-align:center;\" id=\"menu_loading_txt\">loading menu...</div>";document.getElementById('process_frame').src=global_url+"scripts/menu.php?main|"+encode64(mod)+"|"+encode64(current_menu_font_color+"");}}
function createMenu(menu_table_enc,menu_enc,main_menu_back_width,main_menu_width,main_menu_left,t_btns,btn_width){total_btns=total_menus=t_btns;menu_width=btn_width;document.getElementById('main_menu').style.left=main_menu_left+"px";document.getElementById('main_menu').innerHTML=decode64(menu_table_enc);document.getElementById('dropdown_menus').innerHTML=decode64(menu_enc);}
var menu_max_height=550;var menu_height_array=Array();var menu_width_array=Array();function menuIn(m){abort=0
if(document.getElementById('main_btn_'+m)){num=Math.abs(m);site_f_width=(site_width==0)?parseInt(document.documentElement.clientWidth):site_width;checkMainBtnOver(m);closeAllMenus(m);try{if(document.getElementById('menu_'+m)){if(!menu_height_array[num]){this_l=document.getElementById('menu_'+m).style.left;document.getElementById('menu_'+m).style.left="-2000px";document.getElementById('menu_'+m).style.top="-6000px";document.getElementById('menu_'+m).style.display="block";this_div=document.getElementById('menu_content_'+num);if(this_div){d_w=parseInt(this_div.clientWidth);d_h=parseInt(this_div.clientHeight);menu_height_array[num]=d_h;menu_width_array[num]=d_w;if(document.getElementById("menu_shadow_"+num)){document.getElementById("menu_shadow_"+num).style.width=d_w+"px";}
document.getElementById('menu_'+m).style.display="none";document.getElementById('menu_'+m).style.left=((parseInt(this_l)+d_w)<(menu_width*total_menus))?this_l:parseInt(this_l)+num+((menu_width*total_menus)-(parseInt(this_l)+d_w))+"px";document.getElementById('menu_'+m).style.top="0px";}else{abort=1;}}
if(abort==0){menu_z++;document.getElementById('menu_'+m).style.zIndex=menu_z;height=menu_height_array[num];var html="OK";try{var elements=document.getElementsByName('dd_menu_links');html=elements[(num-1)].innerHTML;}catch(html_err){}
if((height>dropdown_min_height)&&(html!="")){h=height;l=parseInt(document.getElementById('main_menu').style.left)+dropdown_menu_left_offset;if(m>1){l+=1;}
for(b=1;b<(num);b++){this_w=parseInt(document.getElementById("main_btn_"+b).clientWidth)
l+=this_w;if(b>1){l+=main_menu_btn_spacing;}}
w=menu_width_array[num];avail=site_f_width-l;if(avail<w){document.getElementById('menu_'+m).style.left=(l-(w-avail)-1)+"px";}else{document.getElementById('menu_'+m).style.left=(l)+"px";}
if(document.getElementById("menu_shadow_"+num)){document.getElementById("menu_shadow_"+num).style.height=(h+4)+"px";}
document.getElementById('menu_'+m).style.display="block";process_menu=null;process_height=0;}}else{process_menu=null;process_height=0;}}else{}}catch(err){alert(err);}}}
var closeAll=0;var current_menu=0;function closeAllMenus(menu){for(i=1;i<=total_menus;i++){this_m="menu_"+(i);if(document.getElementById(this_m)){if((menu)&&(menu==i)){}else if(current_menu==(i)){}else{menuOut(i);}}}}
function menuOut(m,debug){if(debug){}
if(window[m+'out']){clearTimeout(window[m+'out']);}
checkMainBtnOut(m);if(document.getElementById('menu_'+m)){document.getElementById('menu_'+m).style.display="none";process_menu=null;process_height=0;}}
function checkMainBtnOver(id){for(i=1;i<=total_btns;i++){if(i!=id){checkMainBtnOut(i);}}
try{if(document.getElementById('main_btn_'+id)&&(document.getElementById('main_btn_'+id).className!="main_menu_selected")){w=parseInt(document.getElementById('main_btn_'+id).clientWidth);x=0-200-Math.floor((200-w)/2);document.getElementById('main_btn_'+id).style.backgroundPosition=x+"px 0px ";}}catch(btn_e){}}
function checkMainBtnOut(id){try{if(document.getElementById('main_btn_'+id)&&(document.getElementById('main_btn_'+id).className!="main_menu_selected")){var w=parseInt(document.getElementById('main_btn_'+id).clientWidth);var x=0-Math.floor((200-w)/2);document.getElementById('main_btn_'+id).style.backgroundPosition=x+"px 0px";}}catch(btn_e){}}
var current_date_div=null;var calender_left=-2000;var calender_top=-2000;function showCalender(field,left,top,dateMin,dateMax,startdate,div){value=field.value;current_date_div=(div)?div:null;current_date_field=field;if((value=="")&&(startdate)){value=startdate;}
calender_left=left;calender_top=top;document.getElementById('calender_frame').src=global_url+"admin/calendar_popup.php?field="+field+"&value="+value+"&date_min="+dateMin+"&date_max="+dateMax;}
function moveCalender(left,top){document.getElementById('calender').style.left=left+"px";document.getElementById('calender').style.top=top+"px";}
function formatDate(div,date){if(div){date_arr=date.split("-");div.innerHTML=((date=="")||(date=="0000-00-00"))?"&nbsp":date_arr[2]+" "+date_arr[1]+" "+date_arr[0];}}
function updateDiv(date){if(current_date_div){formatDate(current_date_div,date);}}
function getCookieValue(cookieName){theCookie=""+document.cookie;ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName==""){val="";}else{ind1=theCookie.indexOf(';',ind);if(ind1==-1){ind1=theCookie.length;}
val=unescape(theCookie.substring(ind+cookieName.length+1,ind1));}
if(val==";"){val="";}
return val;}
function trim(str,chars){return ltrim(rtrim(str,chars),chars);}
function ltrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");}
function rtrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");}
function urlencode(str){var hexStr=function(dec){return'%'+dec.toString(16).toUpperCase();};var ret='',unreserved=/[\w.-]/;str=(str+'').toString();for(var i=0,dl=str.length;i<dl;i++){var ch=str.charAt(i);if(unreserved.test(ch)){ret+=ch;}
else{var code=str.charCodeAt(i);if(code===32){ret+='%20';}
else if(code<128){ret+=hexStr(code);}
else if(code>=128&&code<2048){ret+=hexStr((code>>6)|0xC0);ret+=hexStr((code&0x3F)|0x80);}
else if(code>=2048&&code<65536){ret+=hexStr((code>>12)|0xE0);ret+=hexStr(((code>>6)&0x3F)|0x80);ret+=hexStr((code&0x3F)|0x80);}
else if(code>=65536){ret+=hexStr((code>>18)|0xF0);ret+=hexStr(((code>>12)&0x3F)|0x80);ret+=hexStr(((code>>6)&0x3F)|0x80);ret+=hexStr((code&0x3F)|0x80);}}}
return ret;}
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+
keyStr.charAt(enc3)+keyStr.charAt(enc4);}while(i<input.length);return output;}
function decode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}
if(enc4!=64){output=output+String.fromCharCode(chr3);}}while(i<input.length);return output;}
var cache_page_images=new Array();var current_image=0;var current_image_url=global_url+"images/trans.gif";var image_change_delay=(is_IE)?14*1000:10*1000;var inital_image_change_delay=5*1000;var divid="main_page_back";var imageid="main_page_back_img";function loadOtherImages(){if(page_images.length>1){var d=new Date();var before;var after;var j=0;var start_swap_img=0;for(var i=0;i<page_images.length;i++)
{d=new Date();before=d.getTime();if(j==0){changeOpac(0,imageid);if(document.getElementById(imageid).src!=global_url+"images/"+page_images[i]){document.getElementById(imageid).src=current_image_url;blendimage(divid,imageid,global_url+"images/"+page_images[i],2500);}else{document.getElementById(imageid).src=global_url+"images/"+page_images[i];start_swap_img=1;current_image_url=global_url+"images/"+page_images[i];}}
cache_page_images[j]=new Image();cache_page_images[j].src=global_url+"images/"+page_images[i];d=new Date();after=d.getTime();if((after-before)>5000)break;j++;}
if(start_swap_img==1){if(window['image_changer']){clearTimeout(window['image_changer']);}
window['image_changer']=setTimeout("swapImage()",inital_image_change_delay);}}else{document.getElementById(imageid).src=global_url+"images/"+page_images[0];current_image_url=global_url+"images/"+page_images[0];}}
function clearSwapImages(){if(window['image_changer']){clearTimeout(window['image_changer']);}
for(i=0;i<=100;i++){if(window['opt_'+i]){clearTimeout(window['opt_'+i]);}}
if((imageid)&&(document.getElementById(imageid))){changeOpac(0,imageid);document.getElementById(imageid).src=current_image_url;document.getElementById(divid).style.backgroundImage="url("+document.getElementById(imageid).src+")";}
image_changer=null;page_images=new Array();cache_page_images=new Array();current_image=0;}
var next_img=0;function swapImage()
{if(window['image_changer']){clearTimeout(window['image_changer']);}
for(i=0;i<=100;i++){if(window['opt_'+i]){clearTimeout(window['opt_'+i]);}}
var n=cache_page_images.length;if(gallery_background_random==1){do
{i=Math.floor(Math.random()*n);}
while(!cache_page_images[i]||(i==current_image&&n>1));}else{i=Math.abs(next_img)+1;if(i==n){i=0;}
next_img=i;}
if(cache_page_images[i]){blendimage(divid,imageid,cache_page_images[i].src,2500)
current_image=i;}}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++)
{setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}}
function changeOpac(opacity,id){if((id)&&(document.getElementById(id))){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}}
function shiftOpacity(id,millisec){if(document.getElementById(id).style.opacity==0){opacity(id,0,100,millisec);}else{opacity(id,100,0,millisec);}}
function blendimage(divid,imageid,imagefile,millisec){if(document.getElementById(divid)){var speed=Math.round(millisec/100);var timer=100;document.getElementById(divid).style.backgroundImage="url("+document.getElementById(imageid).src+")";current_image_url=imagefile;changeOpac(0,imageid);document.getElementById(imageid).src=imagefile;document.getElementById(imageid).display="block";for(i=0;i<=100;i++){window['opt_'+i]=setTimeout("changeOpac("+i+",'"+imageid+"')",(timer*speed));timer++;}
window['image_changer']=setTimeout("swapImage()",image_change_delay);}}
function checkNumber(field,type){switch(type){case"full":thisNum=parseInt(field.value);break;case"decimal":t1=field.value;t2=round_decimals(t1,2);t3=pad_with_zeros(t2,2);thisNum=t3;break;}
thisNum1=""+thisNum;if(thisNum1.substr(0,3)=="NaN"){field.value=(type=="full")?"0":"0.00";}else{field.value=thisNum}}
function formatNumber(num,type){switch(type){case"full":thisNum=parseInt(num);break;case"decimal":t1=num
t2=round_decimals(t1,2);t3=pad_with_zeros(t2,2);thisNum=t3;break;}
thisNum1=""+thisNum;if(thisNum1.substr(0,3)=="NaN"){return(type=="full")?"0":"0.00";}else{return thisNum;}}
function round_decimals(original_number,decimals){var result1=original_number*Math.pow(10,decimals)
var result2=Math.round(result1)
var result3=result2/Math.pow(10,decimals)
return pad_with_zeros(result3,decimals)}
function pad_with_zeros(rounded_value,decimal_places){var value_string=rounded_value.toString()
var decimal_location=value_string.indexOf(".")
if(decimal_location==-1){decimal_part_length=0
value_string+=decimal_places>0?".":""}
else{decimal_part_length=value_string.length-decimal_location-1}
var pad_total=decimal_places-decimal_part_length
if(pad_total>0){for(var counter=1;counter<=pad_total;counter++)
value_string+="0"}
return value_string}
function disablePage(bool){if(document.getElementById("disable_page")){document.getElementById("disable_page").style.display=(bool)?"block":"none";}}
function toggleObj(id1,id2,id3,id4){if(document.getElementById(id1)){dis=document.getElementById(id1).style.display;document.getElementById(id1).style.display=(dis=="none")?"block":"none";if(document.getElementById(id3)){document.getElementById(id3).style.display=(dis=="none")?"block":"none";}
if(document.getElementById(id2)){document.getElementById(id2).style.display=(dis=="none")?"none":"block";}
if(document.getElementById(id4)){document.getElementById(id4).style.display=(dis=="none")?"none":"block";}}
try{resizePage();}catch(e){}}
var gallery_scroll_bar_offset_x=0;var gallery_containers=Array();var current_scroll_timer=null;var current_scroll_timer2=null;var gallery_start_l=0;var gallery_sb_start_l=0;var gallery_start_l=0;var gallery_img_inc=1;var auto_scroll_speed=10;var gallery_img_inc_speed=auto_scroll_speed;var gallery_global_inc_speed=100;var gallery_can_scroll_img=0;var gallery_scroll=0;var gallery_sb_direction="right";var auto_scroll_g_x=0;var auto_scroll_inc=1;var gallery_firstload=1;function toggleGalleryHTML(img,id){if(document.getElementById(id)){dis=document.getElementById(id).style.display;document.getElementById(id).style.display=(dis=="block")?"none":"block";img.alt=(dis=="block")?"click here to show more information":"click here to hide more information";}}
function positionScrollBar(div1,div_container1,div2,div_container2,scroll_div,id,offset,scale,total_h){if((document.getElementById(div1))&&(document.getElementById(div_container1))&&(document.getElementById(div2))&&(document.getElementById(div_container2))&&(document.getElementById(scroll_div))){if(offset){gallery_scroll_bar_offset_x=offset;}
main_w=parseInt(document.getElementById(div_container1).clientWidth);main_h=parseInt(document.getElementById(div_container1).clientHeight);main_img_w=parseInt(document.getElementById(div1).clientWidth);main_img_l=parseInt(document.getElementById(div1).style.left);scroll_bar=document.getElementById(scroll_div);var scrollbar_border=(scroll_bar.style.borderWidth)?parseInt(scroll_bar.style.borderWidth):0;scrollbar_h=parseInt(scroll_bar.style.height)-(scrollbar_border*2);ratio=main_w/main_h;scrollbar_w=Math.round((scrollbar_h)*ratio*scale);if((id)&&(!gallery_containers[id])){temp_arr=Array();temp_arr[0]=document.getElementById(div1);temp_arr[1]=document.getElementById(div_container1);temp_arr[2]=document.getElementById(div2);temp_arr[3]=document.getElementById(div_container2);temp_arr[4]=scroll_bar;temp_arr[5]=0;gallery_containers[id]=temp_arr;}
preview_w=parseInt(document.getElementById(div_container2).clientWidth);preview_h=parseInt(document.getElementById(div_container2).style.height);preview_img_w=parseInt(document.getElementById(div2).clientWidth);preview_img_l=parseInt(document.getElementById(div2).style.left);scroll_div_l=parseInt(scroll_bar.style.left);d=new Date();if(main_img_w<main_w){scroll_bar.style.display="none";document.getElementById(div1).style.left="0px";document.getElementById(div2).style.left="0px";}else{scale=main_img_w/preview_img_w;if(preview_img_l<0){if((preview_img_w-Math.abs(preview_img_l))<preview_w){new_l=preview_w-preview_img_w;document.getElementById(div2).style.left=new_l+"px";gallery_containers[id][5]=Math.round(new_l*scale);document.getElementById(div1).style.left=(0-Math.round(scroll_div_l*scale)+Math.round(new_l*scale))+"px";}}else if(preview_img_l>0){new_l=0;document.getElementById(div2).style.left=new_l+"px";gallery_containers[id][5]=Math.round(new_l*scale);document.getElementById(div1).style.left=(0-Math.round(scroll_div_l*scale)+Math.round(new_l*scale))+"px";}
if(scroll_div_l>0){max_x=(preview_img_w<preview_w)?preview_img_w:preview_w
if(is_IE==0){max_x-=2;}
scroll_w=scroll_div_l+scrollbar_w;if(scroll_w>max_x){l=max_x-scrollbar_w;scroll_bar.style.left=l;document.getElementById(div1).style.left=(0-Math.round(l*scale)+gallery_containers[id][5])+"px";}}
if(scroll_div_l<0){l=0;scroll_bar.style.left=l;document.getElementById(div1).style.left=(0-Math.round(l*scale)+gallery_containers[id][5])+"px";}
if(gallery_firstload==1){sb_top_max=(main_h+preview_h+10);var sb_h=parseInt(scroll_bar.style.height);var dif=total_h-main_h-sb_h;if(dif<0){sb_top=main_h+10;scroll_bar.style.height=(scrollbar_h+dif)+"px";}else{sb_top=main_h+dif;var border_w=(scroll_bar.style.borderWidth)?parseInt(scroll_bar.style.borderWidth):0;scroll_bar.style.height=(total_h-main_h-dif-(border_w*2))+"px";}
scroll_bar.style.top=sb_top+"px";gallery_firstload=0;}
scroll_bar.style.width=scrollbar_w+"px";scroll_bar.style.display="block";startMouseMove();}}}
function clearScrollDivBar(id,not_t1,not_t2){gallery_can_scroll_img=0;gallery_scroll=0;document.documentElement.style.cursor='default';if((current_scroll_timer)&&(!not_t1)){clearInterval(current_scroll_timer);}
if((current_scroll_timer2)&&(!not_t2)){clearInterval(current_scroll_timer2);}}
function checkGalleryScroll(id){if(gallery_scroll==1){disablePage(true);}else{disablePage(false);}}
function scrollDivImg(id,scale){this_direction=(gallery_img_inc<0)?"right":"left";if((gallery_can_scroll_img==1)&&(this_direction==gallery_sb_direction)){div1=gallery_containers[id][0];div2=gallery_containers[id][2];div_container2=gallery_containers[id][3];this_l=parseInt(div2.style.left)+gallery_img_inc;preview_w=parseInt(div_container2.clientWidth);preview_img_w=parseInt(div2.clientWidth);if(gallery_img_inc<0){if(this_l<(preview_w-preview_img_w)){this_l=(preview_w-preview_img_w);gallery_can_scroll_img=0;gallery_img_inc=0;stopGalleryAutoScroll(id)}}
if(gallery_img_inc>0){if(this_l>0){this_l=0;gallery_can_scroll_img=0;gallery_img_inc=0;stopGalleryAutoScroll(id)}}
div2.style.left=this_l+"px";gallery_containers[id][5]=parseInt(gallery_containers[id][5])+Math.round(gallery_img_inc*scale);}else{if(current_scroll_timer2){clearInterval(current_scroll_timer2);}
stopGalleryAutoScroll(id);}}
function stopGalleryAutoScroll(id){if(window["auto_scroll_g_"+id]){clearInterval(window["auto_scroll_g_"+id]);}
gallery_img_inc_speed=gallery_global_inc_speed;}
function startGalleryAutoScroll(id){if(gallery_containers[id]){auto_scroll_g_x+=auto_scroll_inc;x=auto_scroll_g_x
scrollDivBar(id,null,x);clearScrollDivBar(id);window["auto_scroll_g_"+id]=setTimeout("startGalleryAutoScroll('"+id+"')",gallery_img_inc_speed);}}
function galleryJumpTo(id){if(gallery_containers[id]){x=tempX-gallery_scroll_bar_offset_x;scrollDivBar(id);clearScrollDivBar(id);}}
function scrollDivBar(id,firstdown,x){gallery_scroll=1;document.documentElement.style.cursor='move';if(!x){x=tempX-gallery_scroll_bar_offset_x;}
if(document.getElementById('x_pos_'+id)){document.getElementById('x_pos_'+id).innerHTML=x;}
y=tempY;if(gallery_containers[id]){div1=gallery_containers[id][0];div_container1=gallery_containers[id][1];div2=gallery_containers[id][2];div_container2=gallery_containers[id][3];scroll_div=gallery_containers[id][4];l=parseInt(scroll_div.style.left);last_l=l;if(firstdown){gallery_start_l=x;gallery_sb_start_l=l;}
main_w=parseInt(div_container1.clientWidth);main_h=parseInt(div_container1.style.height);main_img_w=parseInt(div1.style.width);main_img_l=parseInt(div1.style.left);preview_w=parseInt(div_container2.clientWidth);preview_h=parseInt(div_container2.style.height);preview_img_w=parseInt(div2.style.width);preview_img_l=parseInt(div2.style.left);scroll_div_w=parseInt(scroll_div.style.width);if(scroll_div.style.border){scroll_div_w+=(is_IE==1)?parseInt(scroll_div.style.borderRightWidth)*2:parseInt(scroll_div.style.borderRightWidth);}else if(is_IE!=1){scroll_div_w-=2;}
min_x=0;max_x=(preview_img_w<preview_w)?preview_img_w:preview_w;if(is_IE==0){max_x-=2;}
l=gallery_sb_start_l+(x-gallery_start_l);scale=main_img_w/preview_img_w;gallery_sb_direction=(l<last_l)?"left":"right";if(l<min_x){l=min_x;if(preview_img_w>preview_w){gallery_can_scroll_img=1;gallery_img_inc=10;scrollDivImg(id,scale);}}
if((l+scroll_div_w)>max_x){l=max_x-scroll_div_w;if(preview_img_w>preview_w){gallery_can_scroll_img=1;gallery_img_inc=-10;scrollDivImg(id,scale);}}
scroll_div.style.left=l+"px";div1_offset=parseInt(gallery_containers[id][5]);div1_l=(0-Math.round((l+2)*scale)+div1_offset);div1_l_max=(0-main_img_w+main_w);div1.style.left=(div1_l<div1_l_max)?div1_l_max+"px":div1_l+"px";if((l==0)&&(parseInt(div2.style.left)==0)){div1.style.left="0px";}
if((div1)&&(div_container1)&&(div2)&&(div_container2)&&(scroll_div)){current_scroll_timer=setTimeout("scrollDivBar('"+id+"')",1);}}}
var thumbnail_popups=Array();var popup=null;var thumbnail_popup_on=0;function setupThumbnailGallery(html,id,popup_on,border_color){thumbnail_popup_on=popup_on;if((document.getElementById('popup'))&&(popup===null)){popup=document.getElementById('popup');if(html){popup.innerHTML=decode64(html);}}
var j=0;for(var i=0;i<thumbnail_popups[id].length;i++)
{img=document.getElementById('img_'+j+'_'+id);if(img){img.className='alpha_100';var popup_html=thumbnail_popups[id][i]['popup'];if(popup_html!=""){img.onmouseover=function(){this.style.cursor='pointer';this.className='alpha_40';};img.onmouseout=function(){this.className='alpha_100';}}}
j++;}}
function loadPopUpHtml(id,n){var div=document.getElementById('popup_html');if((popup)&&(div)){var popup_html=thumbnail_popups[id][n]['popup'];if(popup_html!=""){popup_html=decode64(popup_html);div.innerHTML=popup_html;}
var bool=(popup_html!="")?true:false;showHTMLPopUp(bool)}}
function closeHTMLPopUp(){showHTMLPopUp(false);}
function showHTMLPopUp(bool){if((popup)){popup.style.display=(bool)?"block":"none";if(bool){centerPopUp();}}}
function centerPopUp(){if(popup){var mcw=parseInt(document.getElementById('main_page').clientWidth);var mch=parseInt(document.getElementById('main_div').clientHeight);if((parseInt(document.documentElement.clientHeight)<mch)){mch=parseInt(document.documentElement.clientHeight)+document.documentElement.scrollTop;}
var lw=parseInt(popup.clientWidth);var lh=parseInt(popup.clientHeight);popup.style.left=(Math.round((mcw-lw+parseInt(document.getElementById('left_content').clientWidth))/2)+"px")
popup.style.top=Math.round((mch-lh)/2)-parseInt(document.getElementById('header').clientHeight)+"px";}}
var lightbox=null;var lightbox_image=null;var lightbox_back=null;var lightbox_zoom_back=null;var lightbox_zoom=null;var lightbox_zoom_tool=null;var lightbox_w=0;var lightbox_h=0;var lightbox_inc_x=0;var lightbox_inc_y=0;var lightbox_mtw=0;var lightbox_mth=0;var lightbox_speed=100;var lightbox_millisec=1000;var lightbox_moving=0;var lightbox_images=Array();var lightbox_img_cache=Array();var lightbox_mov_int=null;var lightbox_y_offset=0;var lightbox_x_offset=0;var lightbox_zoom_scale=1;var lightbox_type=1;var lightbox_border=0;function setupLightBox(html,id,type,border_color){lightbox_type=type;if((document.getElementById('lightbox'))&&(lightbox===null)){lightbox=document.getElementById('lightbox');if(html){lightbox.innerHTML=decode64(html);}
if(document.getElementById('lightbox_image')){lightbox_image=document.getElementById('lightbox_image');if(border_color!=""){lightbox_image.style.border="1px solid "+border_color;lightbox_border=1;}}
if(document.getElementById('lightbox_back')){lightbox_back=document.getElementById('lightbox_back');}
if((document.getElementById('lightbox_zoom_'+id))&&(document.getElementById('lightbox_zoom_tool'))){lightbox_zoom=document.getElementById('lightbox_zoom_'+id);lightbox_zoom_tool=document.getElementById('lightbox_zoom_tool');}else{lightbox_zoom=null;}
if(document.getElementById('lightbox_zoom_back_'+id)){lightbox_zoom_back=document.getElementById('lightbox_zoom_back_'+id);}else{lightbox_zoom_back=null;}
loadLightBoxImages(id);}}
function loadLightBoxImages(id){var j=0;for(var i=0;i<lightbox_images[id].length;i++)
{d=new Date();before=d.getTime();light_img=decode64(lightbox_images[id][i]['light']);if(lightbox_type<3){image_img=decode64(lightbox_images[id][i]['image']);}
w=Math.abs(lightbox_images[id][i]['w']);h=Math.abs(lightbox_images[id][i]['h']);w2=Math.abs(lightbox_images[id][i]['w2']);h2=Math.abs(lightbox_images[id][i]['h2']);n=Math.abs(lightbox_images[id][i]['n']);lightbox_img_cache[id][j]={light:null,image:null,w:w,h:h,w2:w2,h2:h2};lightbox_img_cache[id][j]['light']=new Image();lightbox_img_cache[id][j]['light'].src=light_img;lightbox_img_cache[id][j]['image']=new Image();if(lightbox_type<3){lightbox_img_cache[id][j]['image'].src=image_img;}
img=document.getElementById('img_'+j+'_'+id);if(img){img.className='alpha_100';img.onmouseover=function(){this.style.cursor='pointer';this.className='alpha_40';};img.onmouseout=function(){this.className='alpha_100';}}
j++;}}
function loadLightBoxImage(id,n){clearMoveLightBox();clearLightBoxFade();if(lightbox_img_cache[id][n]){img1=lightbox_img_cache[id][n]['light'];img2=lightbox_img_cache[id][n]['image'];w=Math.abs(lightbox_img_cache[id][n]['w']);h=Math.abs(lightbox_img_cache[id][n]['h']);w2=Math.abs(lightbox_img_cache[id][n]['w2']);h2=Math.abs(lightbox_img_cache[id][n]['h2']);lightbox_zoom_scale=w2/w;if(lightbox){if((lightbox_zoom_tool)&&(lightbox_zoom)){if(lightbox_type==2){lightbox_zoom.style.height=(h)+"px";lightbox_zoom.style.top="11px";}
lightbox_zoom_tool.style.width=Math.round(parseInt(lightbox_zoom.style.width)/lightbox_zoom_scale)+"px";lightbox_zoom_tool.style.height=Math.round(parseInt(lightbox_zoom.style.height)/lightbox_zoom_scale)+"px";}
showLightBoxImage(img1,w,h,img2,w2,h2,id,n);showLightBox(true);startMouseMove();lightbox_mov_int=setInterval("moveLightBoxZoom()",1);}}}
function closeLightBox(){stopLightBoxZoom();clearLightBoxFade();clearMoveLightBox();showLightBox(false);}
function showLightBoxImage(img,w,h,img2,w2,h2,id,n){if(lightbox_image){var plus=(lightbox_type==2)?300:0;var l_style=(lightbox_border==1)?"style='top:11px;'":"";lightbox_image.innerHTML="<img id='lightbox_current_img' src='"+img.src+"' width='"+w+"' height='"+h+"' "+l_style+" onmouseover='javascript:startLightBoxZoom();'>";if(lightbox_type==2){lightbox_image.innerHTML+="<div id=\"lightbox_txt\" style=\"top:"+(Math.round((h-60)/2))+"px;\">Move your mouse over the image to view in more detail.</div>";}
if(lightbox_type==3){var popup_html=lightbox_images[id][n]['popup'];if(popup_html!=""){lightbox_image.innerHTML+="<div id=\"lightbox_popup_txt\" style=\"height:"+(h-40)+"px;\">"+decode64(popup_html)+"</div>";plus=300;}}
changeOpac(0,'lightbox_current_img');if(lightbox_zoom){lightbox_zoom.innerHTML="<img id='lightbox_zoom_img' src='"+img2.src+"' width='"+w2+"' height='"+h2+"'>";}
lightbox_w=w+plus;lightbox_h=h;clearMoveLightBox();resizeLightBox(w+plus,h);}}
function clearMoveLightBoxZoom(){if(lightbox_mov_int){clearInterval(lightbox_mov_int);lightbox_mov_int=null;}}
function moveLightBoxZoom(){if(lightbox_type<3){lightbox_y_offset=parseInt(lightbox.style.top);x=tempX-lightbox_x_offset-Math.round((parseInt(document.documentElement.clientWidth)-parseInt(document.getElementById('main_page').clientWidth))/2);y=tempY-lightbox_y_offset-parseInt(document.getElementById('header').clientHeight);var lightbox_zoom_tool_width=(lightbox_zoom_tool)?parseInt(lightbox_zoom_tool.style.width):0;var lightbox_zoom_tool_height=(lightbox_zoom_tool)?parseInt(lightbox_zoom_tool.style.height):0;l=x-Math.round(lightbox_zoom_tool_width/2);t=y-Math.round(lightbox_zoom_tool_width/2);min_x=10;max_x=(lightbox_type==2)?parseInt(lightbox_image.style.width)-300-lightbox_zoom_tool_width+8:parseInt(lightbox_image.style.width)-lightbox_zoom_tool_width+8;if(l<min_x){l=min_x;}
if(l>max_x){l=max_x;}
min_y=10;max_y=parseInt(lightbox_image.style.height)-lightbox_zoom_tool_height+9;if(t<min_y){t=min_y;}
if(t>max_y){t=max_y;}
zoom_l=(10*lightbox_zoom_scale)-(l*lightbox_zoom_scale);zoom_t=(10*lightbox_zoom_scale)-(t*lightbox_zoom_scale);lightbox_zoom_tool.style.left=l+"px";lightbox_zoom_tool.style.top=t+"px";if(document.getElementById('lightbox_zoom_img')){document.getElementById('lightbox_zoom_img').style.left=zoom_l+"px";document.getElementById('lightbox_zoom_img').style.top=zoom_t+"px";}
var lb_max_x=(lightbox_type==2)?(parseInt(lightbox_image.style.width))+10-300:(parseInt(lightbox_image.style.width))+10
if((x<10)||(x>lb_max_x)||(y<10)||(y>(parseInt(lightbox_image.style.height))+10)){stopLightBoxZoom()}}}
function startLightBoxZoom(){if((lightbox_zoom)&&(lightbox_zoom_tool)){showLightBoxZoom(true);}}
function stopLightBoxZoom(){if((lightbox_zoom)&&(lightbox_zoom_tool)){showLightBoxZoom(false);}}
function showLightBoxZoom(bool){if(lightbox_zoom){lightbox_zoom.style.display=(bool)?"block":"none";}
if(lightbox_zoom_tool){lightbox_zoom_tool.style.display=(bool)?"block":"none";}
if(lightbox_zoom_back){lightbox_zoom_back.style.display=(bool)?"block":"none";}}
function showLightBox(bool){if(lightbox){if(bool){centerLightBox();}
lightbox.style.display=(bool)?"block":"none";}}
function moveLightBox(){w=lightbox_w;h=lightbox_h;mcw=(lightbox_type==1)?parseInt(document.getElementById('main_content').clientWidth):parseInt(document.getElementById('main_page').clientWidth);mch=(lightbox_type==1)?parseInt(document.getElementById('main_content').clientHeight):parseInt(document.getElementById('main_div').clientHeight);if((lightbox_type==2)&&(parseInt(document.documentElement.clientHeight)<mch)){mch=parseInt(document.documentElement.clientHeight)+(document.documentElement.scrollTop*2);}
if((cw==lightbox_mtw)&&(ch==lightbox_mth)){clearMoveLightBox();return false;}
if((lightbox_inc_x!=0)&&(cw!=lightbox_mtw)){w=(cw+lightbox_inc_x);if(((lightbox_inc_x>0)&&(w>lightbox_mtw))||((lightbox_inc_x<0)&&(w<lightbox_mtw))){w=Math.abs(lightbox_mtw);}
lightbox_image.style.width=w+"px";lightbox_back.style.width=(w+20)+"px";lightbox.style.left=(lightbox_type==1)?(Math.round((mcw-(w+20))/2)+parseInt(document.getElementById('left_content').clientWidth)+"px"):(Math.round((mcw-(w+20))/2)+"px");lightbox_x_offset=parseInt(lightbox.style.left);}
if((lightbox_inc_y!=0)&&(ch!=lightbox_mth)){h=(ch+lightbox_inc_y);if(((lightbox_inc_y>0)&&(h>lightbox_mth))||((lightbox_inc_y<0)&&(h<lightbox_mth))){h=Math.abs(lightbox_mth);}
lightbox_image.style.height=h+"px";lightbox_back.style.height=(h+20)+"px";lightbox.style.top=Math.round((mch-(h+20))/2)+"px";}}
function clearLightBoxFade(){for(i=0;i<=100;i++){if(window['opt_lb_'+i]){clearTimeout(window['opt_lb_'+i]);}}}
function clearMoveLightBox(){for(i=0;i<=lightbox_speed;i++){if(window['move_lb_'+i]){clearTimeout(window['move_lb_'+i]);}}
lightbox_moving=0;}
function resizeLightBox(w,h){if((lightbox_back)&&(lightbox_image)){lightbox_mtw=w;lightbox_mth=h;var speed=Math.round(lightbox_millisec/lightbox_speed);var timer=0;cw=parseInt(lightbox_image.style.width);ch=parseInt(lightbox_image.style.height);lightbox_inc_x=((lightbox_mtw-cw));lightbox_inc_y=((lightbox_mth-ch));if(lightbox_inc_x>0){lightbox_inc_x+=1;}else if(lightbox_inc_x<0){lightbox_inc_x-=1;}
if(lightbox_inc_y>0){lightbox_inc_y+=1;}else if(lightbox_inc_y<0){lightbox_inc_y-=1;}
lightbox_inc_x=Math.round(lightbox_inc_x);lightbox_inc_y=Math.round(lightbox_inc_y);lightbox_moving=1;moveLightBox();changeOpac(100,'lightbox_current_img');}}
function centerLightBox(){if((lightbox)){mcw=parseInt(document.getElementById('main_page').clientWidth);mch=parseInt(document.getElementById('main_content').clientHeight);if((lightbox_type==2)&&(parseInt(document.documentElement.clientHeight)<mch)){mch=parseInt(document.documentElement.clientHeight)+(document.documentElement.scrollTop*2);}
var lw=lightbox_w+20;var lh=lightbox_h+20;lightbox.style.left=(Math.round((mcw-lw)/2))+"px";lightbox.style.top=Math.round((mch-lh)/2)+"px";}}
var product_bar_items=Array();function startProductBarScroll(key){if(product_bar_items[key]){var obj=document.getElementById('pb_'+key);if(obj){var delay=Math.abs(product_bar_items[key]['delay']);var inc=product_bar_items[key]['inc'];product_bar_items[key]['inc']=Math.abs(inc);window['pbw_'+key]=setInterval("productBarScroll('"+key+"')",delay);}}}
function productBarScroll(key){if(product_bar_items[key]){var obj=document.getElementById('pb_'+key);if(obj){var inc=product_bar_items[key]['inc'];var items=obj.children;var last=items.length-1;for(var i=0;i<Math.abs(inc);i++){if(inc<0){obj.insertBefore(items[last],items[0]);}else if(inc>0){obj.appendChild(items[0]);}}}}}
function clearProductBarScroll(key){if(window['pbw_'+key]){clearInterval(window['pbw_'+key]);window['pbw_'+key]=null;}
var play_btn=document.getElementById('pb_play_btn_'+key);if(play_btn){play_btn.className="pb_btn_play";}}
function productBarJump(key,inc){clearProductBarScroll(key)
if(product_bar_items[key]){product_bar_items[key]['inc']=inc;productBarScroll(key);}}
function productBarPlay(btn,key){var cls=btn.className;if(cls=="pb_btn_stop"){clearProductBarScroll(key);btn.className="pb_btn_play";}else if(cls=="pb_btn_play"){if(product_bar_items[key]){var inc=product_bar_items[key]['inc'];product_bar_items[key]['inc']=Math.abs(inc);productBarScroll(key);}
startProductBarScroll(key);btn.className="pb_btn_stop";}}
var rotator_box_items=Array();function rotateBox(key,delay){if(rotator_box_items[key]){var no_items=Math.abs(rotator_box_items[key]['no_items']);var current_item=Math.abs(rotator_box_items[key]['current_item']);z=Math.abs(rotator_box_items[key]['z']);z++;next_item=current_item+1;if(next_item>=no_items){next_item=0;}
div=document.getElementById('pr_'+key+"_"+next_item);if(div){rotator_box_items[key]['current_item']=next_item;rotator_box_items[key]['z']=z;try{for(i=0;i<=100;i++){if(window['prw_'+key+'_'+i]){clearTimeout(window['prw_'+key+'_'+i]);}}
var millisec=1500;var actual_delay=delay
if(delay>2000){actual_delay+=millisec;var speed=Math.round(millisec/100);var timer=0;var image_id='pr_'+key+"_"+next_item
changeOpac(0,image_id);for(var i=0;i<=100;i++){window['prw_'+key+'_'+i]=setTimeout("changeOpac("+i+",'"+image_id+"')",(timer*speed));timer++;}}
div.style.position="absolute";div.style.top=(0)+"px";div.style.zIndex=z;setTimeout("rotateBox('"+key+"',"+delay+")",actual_delay);}catch(e){}}}}
var tab_box_items=Array();function autoTabPage(key,delay){if(tab_box_items[key]){var no_items=Math.abs(tab_box_items[key]['no_items']);var current_item=Math.abs(tab_box_items[key]['current_item']);var auto=Math.abs(tab_box_items[key]['auto']);if(auto==0){return false;}
z=Math.abs(tab_box_items[key]['z']);z++;next_item=current_item+1;if(next_item>=no_items){next_item=0;}
div=document.getElementById('tb_'+key+"_"+next_item);if(div){loadTabPageTab(next_item,key);tab_box_items[key]['current_item']=next_item;tab_box_items[key]['z']=z;try{for(i=0;i<=100;i++){if(window['tbw_'+key+'_'+i]){clearTimeout(window['tbw_'+key+'_'+i]);}}
var millisec=1500;var actual_delay=delay
if(delay>2000){actual_delay+=millisec;var speed=Math.round(millisec/100);var timer=0;var image_id='tb_'+key+"_"+next_item
changeOpac(0,image_id);for(var i=0;i<=100;i++){window['tbw_'+key+'_'+i]=setTimeout("changeOpac("+i+",'"+image_id+"')",(timer*speed));timer++;}}
div.style.position="absolute";div.style.top=(0)+"px";div.style.zIndex=z;setTimeout("autoTabPage('"+key+"',"+delay+")",actual_delay);}catch(e){}}}}
function loadTabPage(n,key){if(tab_box_items[key]){tab_box_items[key]['auto']=0;var no_items=Math.abs(tab_box_items[key]['no_items']);var current_item=Math.abs(tab_box_items[key]['current_item']);if(current_item==n){return false;}
z=Math.abs(tab_box_items[key]['z']);z++;next_item=n+1;if(next_item>=no_items){next_item=0;}
div=document.getElementById('tb_'+key+"_"+n);if(div){loadTabPageTab(n,key);tab_box_items[key]['current_item']=n;tab_box_items[key]['z']=z;try{for(i=0;i<=100;i++){if(window['tbw_'+key+'_'+i]){clearTimeout(window['tbw_'+key+'_'+i]);}}
var millisec=1500;var speed=Math.round(millisec/100);var timer=0;var image_id='tb_'+key+"_"+n
changeOpac(0,image_id);for(var i=0;i<=100;i++){window['tbw_'+key+'_'+i]=setTimeout("changeOpac("+i+",'"+image_id+"')",(timer*speed));timer++;}
div.style.position="absolute";div.style.top=(0)+"px";div.style.zIndex=z;}catch(e){}}}}
function loadTabPageTab(n,key){if(tab_box_items[key]){var no_items=Math.abs(tab_box_items[key]['no_items']);for(var i=0;i<no_items;i++){var obj=document.getElementById('tbln_'+key+"_"+i);if(obj){obj.className=(i==n)?"selected":"unselected";}}}}
var selected_current_back_color="";var selected_current_font_color="";function changeTrans(field,bool){if(bool){selected_current_back_color=field.style.backgroundColor;selected_current_font_color=field.style.color;}
field.style.backgroundColor=(bool)?"#ffffff":selected_current_back_color;field.style.color=(bool)?"#333333":selected_current_font_color;}
function depth(obj){var level=1;while(obj.parentNode.className!=listClass){if(obj.tagName=="UL")level++;obj=obj.parentNode;};return level;};var expandTo=1;var listClass="bloglinks";function toggleList(li){var elements=li.getElementsByTagName("ul");}
function checkPageAnchor(){var loc=document.location+"";var re=/#/;if(loc.match(re)){var tmp=loc.split("#");var anch=tmp.pop();var anch_obj=document.getElementById(anch);if(anch_obj){anch_obj.className="faq_title_a_selected";}}}
function debug(str,replace_all){div=document.getElementById('debug')
if(div){div.innerHTML=(replace_all)?str:div.innerHTML+str;resizePage();}}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i=0;i<objAttrs.length;i++)
str+=i+'="'+objAttrs[i]+'" ';for(var i=0;i<params.length;i++)
str+='><param name="'+i+'" value="'+params[i]+'" /> ';str+='></object>';}else{str+='<embed ';for(var i=0;i<embedAttrs.length;i++)
str+=i+'="'+embedAttrs[i]+'" ';str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":ret.objAttrs[args[i]]=args[i+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}
var password_pass=0;var processing=0;function sendCustomerDetails(res,success){var logon_box=document.getElementById('logon_box');if(logon_box){logon_box.style.height="auto";}
fm=document.theForm;if(res){document.getElementById('status_txt').innerHTML=res;if(success==0){document.getElementById('btn_row').style.display="block";fm.customer_email.disabled=false;}}else if(processing==0){email=fm.customer_email.value;document.getElementById('email_fail_row').style.display="none";document.getElementById('process_row').style.display="none";document.getElementById('btn_row').style.display="block";if(!checkemail(email)){document.getElementById('email_fail_row').style.display="block";fm.customer_email.focus();fm.customer_email.select();return false;}
fm.customer_email.disabled=true;document.getElementById('status_txt').innerHTML="processing details please wait....";document.getElementById('process_row').style.display="block";document.getElementById('btn_row').style.display="none";email=encode64(email);document.getElementById('process_frame').src=global_url+"scripts/forgot_password.php?"+email;}
if(logon_box){logon_box.style.height=(logon_box.clientHeight-20)+"px";}
resizePage();return true;}
function updateRememberMe(box){if(box.checked==true){expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+12);}else{expireDate=new Date;expireDate.setMonth(expireDate.getMonth()-12);}
document.cookie="remember_me="+document.theForm.customer_email.value+";expires="+expireDate.toGMTString()+";path=/";}
function memberContinue(){fm=document.theForm;email=fm.customer_email.value;document.getElementById('password_fail_row').style.display="none";document.getElementById('email_fail_row').style.display="none";document.getElementById('username_fail_row').style.display="none";document.getElementById('process_row').style.display="none";document.getElementById('btn_row').style.display="block";if(parseInt(document.theForm.MEM_LOGON_TYPE.value)==0){if(!checkemail(email)){document.getElementById('email_fail_row').style.display="block";fm.customer_email.focus();fm.customer_email.select();resizePage();return false;}}else{if(email==""){document.getElementById('username_fail_row').style.display="block";fm.customer_email.focus();fm.customer_email.select();resizePage();return false;}}
if(fm.remember_me.checked==true){expireDate=new Date;expireDate.setMonth(expireDate.getMonth()+12);}else{expireDate=new Date;expireDate.setMonth(expireDate.getMonth()-12);}
document.cookie="remember_me="+email+";expires="+expireDate.toGMTString()+";path=/";password=fm.customer_password.value;customer_type=1;if(password==""){document.getElementById('password_fail_row').style.display="block";fm.customer_password.focus();return false;}else if(password_pass==0){fm.customer_email.disabled=true;fm.customer_password.disabled=true;document.getElementById('status_txt').innerHTML="checking details please wait....";document.getElementById('process_row').style.display="block";document.getElementById('btn_row').style.display="none";email=parent.encode64(email);password=parent.encode64(password);str=email+"|"+password+"|1";str=parent.encode64(str);document.getElementById('process_frame').src=global_url+"scripts/check_details.php?"+str;return false;}
memberProcess();}
function memberProcess(res){fm=document.theForm;if(res){fm.customer_email.disabled=false;fm.customer_password.disabled=false;document.getElementById('status_txt').innerHTML=res;document.getElementById('btn_row').style.display="block";resizePage();}}
function toggleForm(id,num){btn=(Math.abs(num)>0)?document.getElementById("toggle_btn"+num+"_"+id):document.getElementById("toggle_btn_"+id);div=(Math.abs(num)>0)?document.getElementById("form_row"+num+"_"+id):document.getElementById("form_row_"+id);if((btn)&&(div)){img=btn.src.split("/").pop();reg=new RegExp(img);new_img=(img=="arrow_up.png")?"arrow_down.png":"arrow_up.png";btn.src=btn.src.replace(reg,new_img);div.style.display=(new_img=="arrow_up.png")?"block":"none";resizePage();}}
function updateFlags(id){form=null;if(document.forms["form_"+id]){form=document.forms["form_"+id];}
if((form!=null)&&(form['flags'])){flags="";for(var i=0;i<form.length;i++){if((form[i].name=='flag')&&(form[i].type=="checkbox")){if(form[i].checked==true){flags+=(flags=="")?"":"^";flags+=form[i].value;}}}
form['flags'].value=flags;}}
function emailRegistered(id,email_field_name){div=document.getElementById('form_div_'+id);form=document.forms["form_"+id];if((div)&&(form)){disableBtns(form,1);div.style.display="block";if(form[email_field_name]){form[email_field_name].value="";form[email_field_name].focus();}
resizePage();}}
function showForm(id){form=document.getElementById('form_hidden_row_'+id);if(form){form.style.display="block";resizePage();}}
function resetForm(id){form=null;if(document.forms["form_"+id]){form=document.forms["form_"+id];form.reset();disableBtns(form,1);form.action="javascript:";form.todo.value="";document.getElementById('form_result_txt_'+id).innerHTML="";document.getElementById('form_result_div_'+id).style.display="none";document.getElementById('form_div_'+id).style.display="block";resizePage();}}
function replaceForm(id,str){try{document.getElementById('form_div_'+id).innerHTML=decode64(str);document.getElementById('form_result_txt_'+id).innerHTML="";document.getElementById('form_result_div_'+id).style.display="none";document.getElementById('form_div_'+id).style.display="block";}catch(form_err){}}
function updateEncodedResultTxt(id,str){res=document.getElementById('form_result_txt_'+id);if(res){res.innerHTML=decode64(str);}}
function updateHiddenFormValue(field,type,hidden_field_name,separator,form_id){form=null;if(document.forms["form_"+form_id]){form=document.forms["form_"+form_id];}
if((form!=null)&&(form[field.name])&&(form[hidden_field_name])){rtn_value="";if(type=="select"){for(f=0;f<field.length;f++){if(field[f].selected==true){rtn_value+=(rtn_value=="")?"":separator;rtn_value+=field[f].value;}}}
form[hidden_field_name].value=rtn_value;}}
function formCheckEmail(field,ignore_blank){email=field.value;var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if(filter.test(email)){return true;}else if((email=="")&&(ignore_blank==1)){return true;}else{field.value="";alert("Please enter a valid email address");try{field.focus();}catch(e){}
return false;}}
function checkUploadFile(file){allowed_arr=Array("doc","rtf","txt","htm","docx");file_arr=file.split(".");last=file_arr.length-1;ext=file_arr[last].toLowerCase();file_ok=false;for(a=0;a<allowed_arr.length;a++){if(ext==allowed_arr[a]){file_ok=true;break;}}
return file_ok;}
function disableBtns(form,enable){for(b=0;b<form.length;b++){if(form[b].type=="button"){form[b].disabled=(!enable)?true:false;}}}
function removeLastKeyword(id){fm=document.forms['form_'+id];if((fm)&&(fm.keyword)&&(fm.keyword.value!="")){key_arr=fm.keyword.value.split("|");new_key="";for(i=0;i<(key_arr.length-1);i++){new_key+=(new_key=="")?key_arr[i]:"|"+key_arr[i];}
fm.keyword.value=new_key;fm.keyword_search.value="";checkNewsSearchForm(id);}}
function clearAllKeywords(id){fm=document.forms['form_'+id];if((fm)&&(fm.keyword)&&(fm.keyword.value!="")){fm.keyword.value="";fm.keyword_search.value="";checkNewsSearchForm(id)}}
function removeSearchKeyword(id,val){fm=document.forms['form_'+id];if((fm)&&(fm.keyword)&&(fm.keyword.value!="")){key_arr=fm.keyword.value.split("|");new_key="";for(i=0;i<key_arr.length;i++){if(key_arr[i]!=val){new_key+=(new_key=="")?key_arr[i]:"|"+key_arr[i];}}
fm.keyword.value=new_key;fm.keyword_search.value="";checkNewsSearchForm(id);}}
function addToSearchKeyword(id,val){fm=document.forms['form_'+id];if((fm)&&(fm.keyword)&&(val!="")){fm.keyword.value+=(fm.keyword.value=="")?encode64(val):"|"+encode64(val);}}
function checkNewsSearchForm(id){fm=document.forms['form_'+id];if(fm){keyword="";category="";date_from="";date_to="";for(i=0;i<fm.length;i++){if(fm[i].type!="button"){if(fm[i].name=="date_from"){date_from=fm[i].value;}
if(fm[i].name=="date_to"){date_to=fm[i].value;}
if(fm[i].name=="keyword_search"){addToSearchKeyword(id,fm[i].value);}
if(fm[i].name=="keyword"){keyword=fm[i].value;}
if((fm[i].name.substr(0,4)=="cat_")&&(fm[i].checked==true)){category+=(category=="")?fm[i].value:"|"+fm[i].value;}}}
if((date_from>date_to)&&(date_from!="")&&(date_to!="")){fm.date_from.value=date_to
formatDate(document.getElementById('date_from_div_'+id),date_to);fm.date_to.value=date_from
formatDate(document.getElementById('date_to_div_'+id),date_from);date_to=fm.date_to.value;date_from=fm.date_from.value}
updateSearchArticles(keyword,category,date_from,date_to)}}
function clearNewsSearchForm(id){clearSearchOptions(1);}
function checkForm(type,action,id){form=null;for(i=0;i<document.forms.length;i++){if(document.forms[i].name=="form_"+id){form=document.forms[i];break;}}
if(form!=null){faillist="";invalidlist="";to_focus=null;check_arr=Array();todo=type;if((type=="enquiry")||(type=="member")){check_arr.push({field:"firstname",txt:"first name",type:"text"});check_arr.push({field:"surname",txt:"last name",type:"text"});check_arr.push({field:"email",txt:"email address",type:"valid_text"});check_arr.push({field:"telephone1",txt:"a primary contact number",type:"text"});check_arr.push({field:"postcode",txt:"your postcode",type:"valid_text"});check_arr.push({field:"enquiry",txt:"enquiry details",type:"text"});}
if(type=="faq ask"){check_arr.push({field:"your_name",txt:"your name",type:"text"});check_arr.push({field:"your_email",txt:"your email address",type:"valid_text"});check_arr.push({field:"your_question",txt:"your question",type:"text"});}
if(type=="logon"){check_arr.push({field:"customer_uname",txt:"your username",type:"text"});check_arr.push({field:"customer_pword",txt:"your password",type:"text"});}
if(type=="logon_blog"){check_arr.push({field:"customer_uname",txt:"your email address",type:"valid_text"});check_arr.push({field:"customer_pword",txt:"your password",type:"text"});todo="logon";}
if(type=="register"){check_arr.push({field:"register_firstname",txt:"your first name",type:"text"});check_arr.push({field:"register_surname",txt:"your surname",type:"text"});check_arr.push({field:"register_email",txt:"your email address",type:"valid_text"});check_arr.push({field:"register_telephone1",txt:"a primary contact number",type:"text"});check_arr.push({field:"register_postcode",txt:"your postcode",type:"valid_text"});}
if(type=="member_full_details"){check_arr.push({field:"up_title",txt:"your title",type:"text"});check_arr.push({field:"up_firstname",txt:"your first name",type:"text"});check_arr.push({field:"up_surname",txt:"your surname",type:"text"});check_arr.push({field:"up_address1",txt:"the first line of your address",type:"text"});check_arr.push({field:"up_postcode",txt:"your postcode",type:"text"});check_arr.push({field:"up_country",txt:"your country",type:"text"});check_arr.push({field:"up_email1",txt:"your email address",type:"valid_text"});check_arr.push({field:"up_telephone1",txt:"your primary contact number",type:"text"});}
if(type=="member_password"){check_arr.push({field:"current_password",txt:"your current password",type:"text"});check_arr.push({field:"new_password",txt:"your new password",type:"text"});check_arr.push({field:"confirm_password",txt:"confirm your new password",type:"text"});}
if(type=="post_comment"){var ok=confirm("Are you sure you want to post this commment?");if(ok==false){return false;}
check_arr.push({field:"blog_comment",txt:"your comment",type:"text"});}
for(i=0;i<check_arr.length;i++){txt=check_arr[i]['txt'];field=check_arr[i]['field'];type=check_arr[i]['type'];if(type.substr(0,6)=='valid_'){type=type.substr(6);if((valid_format_error[field])&&(valid_format_error[field]==1)){invalidlist+=(invalidlist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field]:to_focus;}}
if(type=="text"){if((form[field])&&(form[field].value=="")){faillist+=(faillist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field]:to_focus;}}
if(type=="text2"){field_val_ok=0;field_arr=field.split("|");for(f=0;f<field_arr.length;f++){if((form[field_arr[f]])&&(form[field_arr[f]].value!="")){field_val_ok=1;break;}}
if(field_val_ok==0){faillist+=(faillist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field_arr[0]]:to_focus;}}
if(type=="checkbox"){if((form[field])&&(form[field].checked==false)){faillist+=(faillist=="")?txt:", "+txt;}}
if(type=="radio"){if((form[field])){radio_selected=0;for(r=0;r<form[field].length;r++){if(form[field][r].checked==true){radio_selected=1;break;}}
if(radio_selected==0){faillist+=(faillist=="")?txt:", "+txt;}}}
if(type=="file"){if((form[field])&&(form[field].value=="")){faillist+=(faillist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field]:to_focus;}else if((form[field])&&(!checkUploadFile(form[field].value))){txt+=" - in a valid word document format or plain text";faillist+=(faillist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field]:to_focus;}}
if(type=="file2"){if((form[field])&&(form[field].value!="")){if(!checkUploadFile(form[field].value)){txt+="the document in a valid word document format or plain text";faillist+=(faillist=="")?txt:", "+txt;to_focus=(to_focus==null)?form[field]:to_focus;}}}}
if((invalidlist!="")||(faillist!="")){tmp="";tmp+=(invalidlist!="")?"The following details were not recognised:- \r\n"+invalidlist+"\r\n\r\n":"";tmp+=(faillist!="")?"Please complete the following:- \r\n"+faillist+"\r\n":"";alert(tmp);try{to_focus.focus();to_focus.select();}catch(e){}}else{if(todo=="member_password"){if(!checkPasswordMatch(form['confirm_password'],form['new_password'],1)){checkPasswordMatch(form['confirm_password'],form['new_password']);return false;}}
form.action=action;form.todo.value=todo;disableBtns(form);try{if(pageTracker){try{var p_url="/"+action.substr(global_url.length);pageTracker._trackPageview(p_url);}catch(track_err){}}}catch(page_tracker_err){}
form.submit();document.getElementById('form_result_txt_'+id).innerHTML="processing please wait....";document.getElementById('form_result_div_'+id).style.display="block";document.getElementById('form_div_'+id).style.display="none";resizePage();}}}
var IE=document.all?true:false;var tempX=0
var tempY=0
var max_x=null;var max_y=null;var mouse_move_started=0;function startMouseMove(){if(mouse_move_started==0){mouse_move_started=1;if(window.Event&&document.captureEvents)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=getMouseXY;}}
function getMouseXY(e){if(IE){tempX=event.clientX+document.documentElement.scrollLeft
tempY=event.clientY+document.documentElement.scrollTop}else{tempX=e.pageX
tempY=e.pageY}
if(tempX<0){tempX=0}
if(tempY<0){tempY=0}
return true}
function showTag(id,text,show){if(window['pres_alpha']){clearTimeout(window['pres_alpha']);}
if(text!=""){if(document.getElementById(id)){h=document.documentElement.clientHeight;header_h=parseInt(document.getElementById('header').style.height)
if((tempY-20+200)>h){h1=(h-200)}else{h1=(tempY-20);}
w1=tempX+10;re1=/alpha_/gi;this_class=document.getElementById(id).className;alpha=this_class.replace(re1,"");alpha=Math.abs(alpha);if(show==1){document.getElementById(id).style.left=(show==1)?(w1)+"px":"-1000px";document.getElementById(id).style.top=(show==1)?h1+"px":"-1000px";}
document.getElementById(id).style.height="180px";text=decode64(text);re=/\n/gi;text=text.replace(re,"<br>");document.getElementById(id).innerHTML=text;if(show==1){if(alpha<100){text=encode64(text);document.getElementById(id).className="alpha_"+(alpha+10);window['pres_alpha']=setTimeout("showTag('"+id+"','"+text+"',"+show+")",10);}else{document.getElementById(id).className="alpha_100";}}else{if(alpha>0){text=encode64(text);document.getElementById(id).className="alpha_"+(alpha-10);window['pres_alpha']=setTimeout("showTag('"+id+"','"+text+"',"+show+")",10);}else{document.getElementById(id).className="alpha_0";document.getElementById(id).style.left="-1000px";document.getElementById(id).style.top="-1000px";}}}}}
function fn_valid_format(str,type,result_format,args){function luhn_check(number,validators){if(!validators){validators='05';}
var number=number.replace(/\D/g,'');var number_length=number.length;var parity=number_length%2;var total=0;for(i=0;i<number_length;i++){var digit=number.charAt(i);if(i%2==parity){digit=digit*2;if(digit>9){digit=digit-9;}}
total+=parseInt(digit);}
var validator=(total%10);return((validators.indexOf(validator)!=-1)?true:false);}
function change_case(str,result_format,args){if(!result_format){result_format='';}
if((result_format.indexOf('0')==-1)&&(result_format.indexOf('1')==-1)&&(result_format.indexOf('2')==-1)){result_format+='0';}
var pat_words=/\s*[\S]*/g;var fstr=str+'';var parts=Array();var matches=Array();var temp=Array();var result='';if(fstr.match(pat_words)){matches=fstr.match(pat_words);var prev_c=' ';var prev_2c='';var prev_3c='';var c='';var prev_non_spc='.';for(j=0;j<matches.length;j++){m=matches[j];if(((result_format.indexOf('4')!=-1)||(args.indexOf('C')!=-1))){m=m.replace(/ {2,}/,' ')}
for(i=0;i<(m.length);i++){c=m.substr(i,1);fc=c;if((result_format.indexOf('0')!=-1)&&((".:").indexOf(prev_non_spc)!=-1)){fc=c.toUpperCase()}
else if((result_format.indexOf('1')!=-1)&&((".: (").indexOf(prev_c)!=-1)){fc=c.toUpperCase()}
else if((result_format.indexOf('2')!=-1)&&((".: ('-\n").indexOf(prev_c)!=-1)){fc=c.toUpperCase()}
else if(((result_format.indexOf('3')!=-1)||(args.indexOf('S')!=-1))&&(m.match(/[aeiou]/i))&&(!m.match(/[0-9]/i))){fc=c.toLowerCase()}
if((result_format.indexOf('2')!=-1)&&(prev_2c=='Mc')){fc=c.toUpperCase();}
if((result_format.indexOf('2')!=-1)&&(prev_3c=='Mac')){fc=c.toUpperCase();}
result+=fc;prev_3c=prev_2c+fc;prev_2c=prev_c+fc;prev_c=fc;tmp=" ";if(fc.match(/\S/)){prev_non_spc=fc;}}}}
return result;}
function in_array(needle,haystack,argStrict){var key='',strict=!!argStrict;if(strict){for(var key=0;key<haystack.length;key++){if(haystack[key]===needle){return true;}}}else{for(var key=0;key<haystack.length;key++){if(haystack[key]==needle){return true;}}}
return false;}
function trim(str){return str.replace(/^\s+/,'').replace(/\s+$/,'');}
if((!type)||(type=="")){type='guess';}
if((!args)||(args=="")){args="";}
var args_arr=(args)?args.split(""):Array();var title_arr=Array('mr','master','sir','mrs','ms','miss','madam','dame','dr','doctor');var qual_arr=Array('b.a','b.sc','b.eng','b.ed','m.a','m.sc','ph.d','g.p');var pat_qual='';for(var i=0;i<qual_arr.length;i++){pat_qual+=(i==0)?qual_arr[i].replace('.','(?:\\.)?'):'|'+qual_arr[i].replace('.','(?:\\.)?');}
var pat_title='';for(var i=0;i<title_arr.length;i++){pat_title+=(i==0)?title_arr[i]:'|'+title_arr[i];}
var pat_pc1=/^(([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW]))( *)([0-9][ABD-HJLNP-UW-Z]{2}))$/i;var pat_pc2=/^(([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])))$/i;var pat_pc3=/^(([A-PR-UWYZ]|[A-HK-Y][A-PR-UWYZ]))$/i;var pat_pc4=/^((\d{5}-\d{4})|(\d{5})|([ABCEGHJKLMNPRSTVXY]\d[A-Z]\s?\d[A-Z]\d))$/i;var pat_email1=/^(([0-9a-z]([\-.\w_\&\']*[0-9a-z_\-\&\'])*)@(([0-9a-z][\-\w]*[0-9a-z]\.)+([a-z]{2,9})))$/i;var pat_tel1=/^(\+\d{3}[\s-]?|\+\d{1,2}[\s-])?\s*((0|\(\d+\))?([\d\s-]+))((x|ex|ext|extn|extension)?[\s-]*(\d*))$/;var pat_name1=new RegExp('^(('+pat_title+')[\\s\\.]+)?([\\w\\s\'-\\.]+?)([\\s\\.]+(\\(.+\\)|'+pat_qual+'))?[\\s\\.]*$','i');var pat_words=/\s*[\S]*/g;var pat_cc_amex15=/^(3[47]\d{2})(?:[:\-\s])?(\d{6})(?:[:\-\s])?(\d{5})$/;var pat_cc_dine14=/^(3[68]\d{2}|30[05]\d)(?:[:\-\s])?(\d{6})(?:[:\-\s])?(\d{4})$/;var pat_cc_disc16a=/^(6011)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_disc16b=/^(622[1-9])(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_disc16c=/^(64[4-9]\d|65\d{2})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_jcb16=/^(35[2-8]\d)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_laser=/^(6304|6706|6771|6709)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4,7})$/;var pat_cc_maest=/^(5018|5020|5038|6304|6759|6761|6763)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{0,7})$/;var pat_cc_mast16=/^(5[1-5]\d{2})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_solo=/^(6334|6767)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4}|\d{6}|\d{7})$/;var pat_cc_switcha=/^(4903|4905|4911|4936|6333|6759)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4}|\d{6}|\d{7})$/;var pat_cc_switchb=/^(5641)(?:[:\-\s])?(82\d{2})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4}|\d{6}|\d{7})$/;var pat_cc_switchc=/^(6331)(?:[:\-\s])?(10\d{2})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4}|\d{6}|\d{7})$/;var pat_cc_viselec=/^(4175|4917|4913|4508|4844)(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_cc_visa=/^(4\d{3})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d|\d{4})$/;var pat_cc_unk=/^(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})(?:[:\-\s])?(\d{4})$/;var pat_date_1=/^(\d{1,2})(?:[^\d\w]+)(\d{1,2})(?:[^\d\w]+)(\d{2}|\d{4})$|^(\d{1,2})(?:\[^\d\w]+)(\d{1,2})$|^(\d{1,2})(?:[^\d\w]+)(\d{2}|\d{4})$/;var pat_date_1g=/^(\d{1,2})(?:[^\d\w]+)(\d{1,2})(?:[^\d\w]+)(\d{2}|\d{4})$/;var pat_date_2=/^(\d{1,2})(?:st|nd|rd|th)?(?:[\.:\-\s]+)(\w+)(?:[\.:\-\s]+)(\d{2}|\d{4})$/i;if((type=='')||(trim((type+'').toLowerCase())=='guess')){var matches=Array();var days_in_month=Array(0,31,29,31,30,31,30,31,31,30,31,30,31);if(trim((str+'').toUpperCase()).match(pat_pc1)){return('postcode');}
else if((in_array('F',args_arr))&&(trim((str+'').toUpperCase()).match(pat_pc4))){return('postcode US/Can');}
else if(trim((str+'').toLowerCase()).match(pat_email1)){return('email');}
else if((trim(str+'').match(pat_cc_unk))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_amex15))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_dine14))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_disc16a))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_disc16b))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_disc16c))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_jcb16))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_laser))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_maest))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_mast16))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_solo))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_switcha))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_switchb))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_switchc))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_viselec))&&(luhn_check(str))){return('card');}
else if((trim(str+'').match(pat_cc_visa))&&(luhn_check(str))){return('card');}
else if(trim(str+'').match(pat_date_1g)){matches=trim(str+'').match(pat_date_1g);if((parseInt(matches[1])>=1)&&(parseInt(matches[1])<=days_in_month[parseInt(matches[2])])&&(parseInt(matches[2])>=1)&&(parseInt(matches[2])<=12)){return('date');}}
else if(trim(str+'').match(pat_date_2)){return('date');}
else if(trim((str+'').toLowerCase()).match(pat_tel1)){return('phone');}
else{return(false);}}
var valid=false;var validate=(in_array('V',args_arr))?true:false;var return_arr=(in_array('A',args_arr))?true:false;switch(trim(type+'').toLowerCase()){case'name':case'user':case'username':type='name';if((!result_format)||(result_format=="")){result_format='1 3';}
var fstr=trim((str+''));var parts=Array();var matches=Array();var temp=Array();if(fstr.match(pat_name1)){matches=fstr.match(pat_name1);parts[0]=matches[2]+'';var temp1=matches[3+''];parts[5]=matches[5]+'';parts[7]=matches[0]+'';temp=temp1.split(/[\s\.]+/);var temp2='';parts[2]='';switch(''+temp.length){case'0':break;case'1':if((!parts[0])||(parts[0]=='')){parts[1]=temp[0]+'';}
else{parts[3]=temp[0]+'';}
break;case'2':parts[1]=temp[0]+'';parts[3]=temp[1]+'';parts[4]=(temp[0].substr(0,1))+''
break;default:parts[1]=temp[0]+'';parts[4]=(temp[0].substr(0,1))+'';for(i=1;i<(temp.length-1);i++){parts[2]+=(i==1)?temp[i]+'':' '+temp[i]+'';parts[4]+=(temp[i].substr(0,1))+'';}
parts[3]=temp[temp.length-1]+'';break;}
switch((parts[0].toLowerCase())+''){case'mr':case'master':case'sir':parts[6]='M';break;case'mrs':case'ms':case'miss':case'madam':case'dame':parts[6]='F';break;default:parts[6]='';break;}
if((('x'+result_format).indexOf('0')!=-1)&&(parts[0]=='')){return false;}
if((('x'+result_format).indexOf('1')!=-1)&&((parts[1]=='')&&(parts[3]==''))){return false;}
if((('x'+result_format).indexOf('3')!=-1)&&(parts[3]=='')){return false;}
if((('x'+result_format).indexOf('4')!=-1)&&(parts[4]=='')){return false;}
if((('x'+result_format).indexOf('3')==-1)&&(('x'+result_format).indexOf('4')!=-1)){parts[4]+=(parts[3].substr(0,1))+'';}
if(parts[0]){parts[0]=change_case(parts[0],'2');}
if(parts[1]){parts[1]=change_case(parts[1],'2');}
if(parts[2]){parts[2]=change_case(parts[2],'2');}
if(parts[3]){parts[3]=change_case(parts[3],'2');}
if(parts[4]){parts[4]=parts[4].toUpperCase();}
if(parts[7]){parts[7]=change_case(parts[7],'2');}
valid=true;}else{return false;}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=result_format.substr(i,1);switch(j){case'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7':if(parts[j]){result+=parts[j];}
break;default:result+=j+'';break;}}
result=(trim(result)).replace(/\s{2,}/,' ');return(validate)?valid:result;}
break;case'postcode':case'pcode':case'pc':type='postcode';var check_foreign=(in_array('F',args_arr))?true:false;if((!result_format)||(result_format=="")){result_format='1 2';}
var fstr=trim((str+'').toUpperCase());var parts=Array();var matches=Array();var temp=Array();if(fstr.match(pat_pc1)){matches=fstr.match(pat_pc1);parts[1]=matches[2];parts[2]=matches[7];temp=matches[2].match(/^[\D]*/);parts[0]=temp[0];valid=true;}else if(fstr.match(/^GIR *0AA$/i)){parts[1]='GIR';parts[2]='0AA';parts[0]='GIR';valid=true;}else if(fstr.match(pat_pc2)){matches=fstr.match(pat_pc2);parts[1]=matches[2];temp=matches[2].match(/^[\D]*/);parts[0]=temp[0];if(('x'+result_format).indexOf('2')!=-1){return false;}
valid=true;}else if(fstr.match(pat_pc3)){matches=fstr.match(pat_pc3);parts[0]=matches[0];if(('x'+result_format).indexOf('2')!=-1){return false;}
if(('x'+result_format).indexOf('1')!=-1){return false;}
valid=true;}else if((check_foreign)&&(fstr.match(pat_pc4))){valid=true;return(validate)?valid:result;}else{return false;}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=result_format.substr(i,1);switch(j){case'0':case'1':case'2':result+=parts[j];break;default:result+=j+'';break;}}
return(validate)?valid:result;}
break;case'tel':case'telephone':case'phone':type='tel';var is_mobile=false;var check_mobile=(in_array('M',args_arr))?true:false;var check_strict=(in_array('S',args_arr))?true:false;var use_ext=(in_array('E',args_arr))?true:false;var allow_5dig=(in_array('5',args_arr))?true:false;if((!result_format)||(result_format=="")){result_format='0 1 2 3';use_ext=true;}
var fstr=trim((str+'').toLowerCase());var parts=Array();var matches=Array();if(fstr.match(pat_tel1)){matches=fstr.match(pat_tel1);for(var i=0;i<matches.length;i++){tmp=matches[i]+'';if((tmp=='undefined')){matches[i]='';}}
parts[0]=trim(matches[1]+'');if(parts[0]=='undefined'){parts[0]='';}
var temp1=trim(matches[3]+'');if(temp1=='undefined'){temp1='';}
var temp2=trim(matches[4]+'');if(temp2=='undefined'){temp2='';}
temp2=temp2.replace(/[\s-]/g,'');exception_arr=Array('121','131','141','151','161','191');var len1=(in_array(temp2.substr(0,3),exception_arr))?3:4;if(((temp2.length==5)&&(allow_5dig))||(temp2.length==6)){if((parts[0]!='')||(temp1!='')){return false;}
if((('x'+result_format).indexOf('0')!=-1)&&(check_strict==true)){return false;}
if((('x'+result_format).indexOf('1')!=-1)&&(check_strict==true)){return false;}
parts[2]=temp2;parts[3]=trim(matches[7]+'');if(parts[3]=='undefined'){parts[3]='';}}else if((temp2.length==9)||(temp2.length==10)){if((parts[0]=='')&&(('x'+result_format).indexOf('0')!=-1)&&(check_strict==true)){return false;}
parts[1]=temp2.substr(0,len1);if(parts[1]=='undefined'){parts[1]='';}
parts[2]=temp2.substr(len1);if(parts[2]=='undefined'){parts[2]='';}
parts[3]=trim(matches[7]+'');if(parts[3]=='undefined'){parts[3]='';}
if(parts[1].substr(0,1)=='7'){is_mobile=true;}}else{return false;}
if((temp2.length==5)&&(is_mobile)){return false;}
if(('x'+result_format).indexOf('0')==-1){temp1=(temp1.replace(/[\(\)]/g,''))+'';}
if(temp1==''){temp1='0';}
if(parts[1]+''=='undefined'){parts[1]='';}
if(((('x'+result_format).indexOf('0')==-1)||(parts[0]==''))&&(parts[1]!='')){parts[1]=temp1+''+parts[1];}
if((parts[1]=='')&&(('x'+result_format).indexOf('1')!=-1)&&(check_strict==true)){return false;}
valid=true;}else{return false;}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=result_format.substr(i,1);if(parts[j]=='undefined'){parts[j]='';}
switch(j){case'0':case'1':case'2':result+=(parts[j])?parts[j]:'';break;case'3':result+=(parts[j])?((use_ext==true)?'ext'+parts[j]:parts[j]):'';break;default:result+=j+'';break;}}
result=(trim(result)).replace(/\s{2,}/,' ');if((check_mobile)&&(!is_mobile)){valid=false;result=false;}
return(validate)?valid:result;break;}
break;case'email':case'mail':type='email';if((!result_format)||(result_format=="")){result_format='0@1';}
var fstr=trim((str+'').toLowerCase());var parts=Array();var matches=Array();var temp=Array();if(fstr.match(pat_email1)){matches=fstr.match(pat_email1);parts[0]=matches[2];parts[1]=matches[4];parts[2]=matches[6];valid=true;}else{return false;}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=(result_format+'').substr(i,1);switch(j){case'0':case'1':case'2':result+=parts[j]+'';break;default:result+=j+'';break}}
return(validate)?valid:result;}
break;case'case':case'title':result=change_case(str,result_format,args);return(validate)?true:result;break;case'card':case'cc':type='card';var parts=Array();var matches=Array();var temp=Array();fstr=str.replace(/\D/g,'');if(fstr.match(pat_cc_amex15)){parts[0]='AmEx';if((!result_format)||(result_format=="")){result_format='1 2 3';}
matches=fstr.match(pat_cc_amex15);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];valid=true;}else if(fstr.match(pat_cc_dine14)){parts[0]='Diners Club';if((!result_format)||(result_format=="")){result_format='1 2 3';}
matches=fstr.match(pat_cc_dine14);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];valid=true;}else if(fstr.match(pat_cc_disc16a)){parts[0]='Discover';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_disc16a);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_disc16b)){parts[0]='Discover';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_disc16b);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_disc16c)){parts[0]='Discover';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_disc16c);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_jcb16)){parts[0]='JCB';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_jcb16);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_laser)){parts[0]='Laser';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_laser);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_maest)){parts[0]='Maestro';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_maest);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_mast16)){parts[0]='Mastercard';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_mast16);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_solo)){parts[0]='Solo';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_solo);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_switcha)){parts[0]='Switch';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_switcha);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_switchb)){parts[0]='Switch';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_switchb);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_switchc)){parts[0]='Switch';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_switchc);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_viselec)){parts[0]='Visa Electron';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_viselec);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_visa)){parts[0]='Visa';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_visa);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else if(fstr.match(pat_cc_unk)){parts[0]='UNKNOWN';if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
matches=fstr.match(pat_cc_unk);if(!luhn_check(fstr)){return false;}
parts[1]=matches[1];parts[2]=matches[2];parts[3]=matches[3];parts[4]=matches[4];valid=true;}else{return false;}
if((!result_format)||(result_format=="")){result_format='1 2 3 4';}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=result_format.substr(i,1);switch(j){case'0':case'1':case'2':case'3':case'4':result+=(parts[j])?parts[j]:'';break;default:result+=j+'';break;}}
if(!valid){result=false;}
return(validate)?valid:result;break;}
break;case'date':case'dat':type='date';if((!result_format)||(result_format=="")){result_format='4/5/3';}
var fstr=trim((str+'').toLowerCase());var parts=Array();var matches=Array();var this_year=(new Date().getFullYear())+'';var this_yy=this_year.substr(2);var this_cc=this_year.substr(0,2);var this_yy_num=Math.abs(this_yy);var years_ahead=20;var days_in_month=Array(0,31,29,31,30,31,30,31,31,30,31,30,31);var month_short=Array('','jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec');var month_long=Array('','january','february','march','april','may','june','july','august','september','october','november','december');var dflag=false;if(fstr.match(pat_date_1)){matches=fstr.match(pat_date_1);if(matches[1]){if((matches[1]<1)||(matches[1]>days_in_month[parseInt(matches[2])])){return false;}
if((matches[2]<1)||(matches[2]>12)){return false;}
var tmp_d=matches[1];parts[0]=((tmp_d=='1')||(tmp_d=='21')||(tmp_d=='31'))?'st':((tmp_d=='2')||(tmp_d=='22'))?'nd':((tmp_d=='3')||(tmp_d=='23'))?'rd':'th';parts[1]=(matches[1]<10)?matches[1].substr(matches[1].length-1):matches[1];parts[4]=(matches[1]<10)?('0'+matches[1]).substr(('0'+matches[1]).length-2):matches[1];parts[2]=(matches[2]<10)?matches[2].substr(matches[2].length-1):matches[2];parts[5]=(matches[2]<10)?('0'+matches[2]).substr(('0'+matches[2]).length-2):matches[2];parts[3]=matches[3].substr(matches[3].length-2);parts[6]=(Math.abs(matches[3])<this_yy_num+years_ahead)?(this_cc+matches[3]).substr((this_cc+matches[3]).length-4):((parseInt(this_cc)-1)+matches[3]).substr(((parseInt(this_cc)-1)+matches[3]).length-4);parts[7]=month_short[Math.abs(matches[2])].substr(0,1).toUpperCase()+month_short[Math.abs(matches[2])].substr(1);parts[8]=month_long[Math.abs(matches[2])].substr(0,1).toUpperCase()+month_long[Math.abs(matches[2])].substr(1);}else if(matches[6]){if((matches[6]<1)||(matches[6]>12)){return false;}
parts[2]=(matches[6]<10)?matches[6].substr(matches[6].length-1):matches[6];parts[5]=(matches[6]<10)?('0'+matches[6]).substr(('0'+matches[6]).length-2):matches[6];parts[3]=matches[7].substr(matches[7].length-2);parts[6]=matches[7];parts[7]=month_short[Math.abs(matches[6])].substr(0,1).toUpperCase()+month_short[Math.abs(matches[6])].substr(1);parts[8]=month_long[Math.abs(matches[6])].substr(0,1).toUpperCase()+month_long[Math.abs(matches[6])].substr(1);}else{if(matches[4]>12){dflag=true;}
else if(matches[5]>12){dflag=false;}
else{if((result_format.indexOf('1')!=-1)||(result_format.indexOf('4')!=-1)){dflag=true;}
else{dflag=false;}}
if(dflag){if((matches[4]<1)||(matches[4]>days_in_month[matches[5]+0])){return false;}
if((matches[5]<1)||(matches[5]>12)){return false;}
parts[1]=(matches[4]<10)?matches[4].substr(matches[4].length-1):matches[4];parts[4]=(matches[4]<10)?('0'+matches[4]).substr(('0'+matches[4]).length-2):matches[4];parts[2]=(matches[5]<10)?matches[5].substr(matches[5].length-1):matches[5];parts[5]=(matches[5]<10)?('0'+matches[5]).substr(('0'+matches[5]).length-2):matches[5];parts[7]=month_short[Math.abs(matches[5])].substr(0,1).toUpperCase()+month_short[Math.abs(matches[5])].substr(1);parts[8]=month_long[Math.abs(matches[5])].substr(0,1).toUpperCase()+month_long[Math.abs(matches[5])].substr(1);}else{if((matches[4]<1)||(matches[4]>12)){return false;}
parts[2]=(matches[4]<10)?matches[4].substr(matches[4].length-1):matches[4];parts[5]=(matches[4]<10)?('0'+matches[4]).substr(('0'+matches[4]).length-2):matches[4];parts[3]=matches[5].substr(matches[5].length-2);parts[6]=(Math.abs(matches[5])<this_yy_num+years_ahead)?(this_cc+matches[5]).substr((this_cc+matches[5]).length-4):((parseInt(this_cc)-1)+matches[5]).substr(((parseInt(this_cc)-1)+matches[5]).length-4);parts[7]=month_short[Math.abs(matches[4])].substr(0,1).toUpperCase()+month_short[Math.abs(matches[4])].substr(1);parts[8]=month_long[Math.abs(matches[4])].substr(0,1).toUpperCase()+month_long[Math.abs(matches[4])].substr(1);}}
valid=true;}else if(fstr.match(pat_date_2)){matches=fstr.match(pat_date_2);var tmp_mon=matches[2].toLowerCase().substr(0,3);if(!in_array(tmp_mon,month_short)){return false;}
var tmp_mon_idx=0;for(i=1;i<13;i++){if(tmp_mon==month_short[i]){tmp_mon_idx=i;}}
if((matches[1]<1)||(matches[1]>days_in_month[tmp_mon_idx])){return false;}
var tmp_d=matches[1];parts[0]=((tmp_d=='1')||(tmp_d=='21')||(tmp_d=='31'))?'st':((tmp_d=='2')||(tmp_d=='22'))?'nd':((tmp_d=='3')||(tmp_d=='23'))?'rd':'th';parts[1]=(matches[1]<10)?matches[1].substr(matches[1].length-1):matches[1];parts[4]=(matches[1]<10)?('0'+matches[1]).substr(('0'+matches[1]).length-2):matches[1];parts[2]=tmp_mon_idx+'';parts[5]=('0'+tmp_mon_idx).substr(('0'+tmp_mon_idx).length-2);parts[3]=matches[3].substr(matches[3].length-2);parts[6]=(Math.abs(matches[3])<this_yy_num+years_ahead)?(this_cc+matches[3]).substr((this_cc+matches[3]).length-4):((parseInt(this_cc)-1)+matches[3]).substr(((parseInt(this_cc)-1)+matches[3]).length-4);parts[7]=month_short[tmp_mon_idx].substr(0,1).toUpperCase()+month_short[tmp_mon_idx].substr(1);parts[8]=month_long[tmp_mon_idx].substr(0,1).toUpperCase()+month_long[tmp_mon_idx].substr(1);valid=true;}else{return false;}
if(return_arr){return(parts);}
else{result='';for(i=0;i<(result_format+'').length;i++){j=result_format.substr(i,1);switch(j){case'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':result+=(parts[j])?parts[j]:'';break;default:result+=j+'';break;}}
if(!valid){result=false;}
return(validate)?valid:result;break;}
break;case'address':case'addr':type='address';result=change_case(str,'234');var tmp_result=result;var addr_arr=result.split(/[,\n]/g);var replace_me='';var postcode='';var guess='';for(k=0;k<(addr_arr.length);k++){guess=fn_valid_format(addr_arr[k],'guess');if(fn_valid_format(addr_arr[k],'guess')=='postcode'){replace_me=addr_arr[k].replace(/^\s*/,'');postcode=fn_valid_format(addr_arr[k],'postcode','1 2');}
result=tmp_result.replace(replace_me,postcode);}
return(validate)?true:result;break;}}
var valid_format_styles=Array();var valid_format_error=Array();function valid_format(obj,str,type,result_format,args){if(!valid_format_styles[obj.name]){valid_format_styles[obj.name]=(obj.style.color)?obj.style.color:'NOCOLOR';}
var fstr=fn_valid_format(str,type,result_format,args);if(str==''){fstr='';}
if(fstr===false){obj.style.color=form_error_color;valid_format_error[obj.name]='1';obj.value=str;return(str);}else{if(valid_format_styles[obj.name]=='NOCOLOR'){if(is_IE==1){obj.style.removeAttribute('color');}else{obj.style.color=FONT_COLOR;}}
else if(valid_format_styles[obj.name]){obj.style.color=valid_format_styles[obj.name];}
valid_format_error[obj.name]='0';obj.value=fstr;return(fstr);}}
function eshotBtn(num){var btn1=document.getElementById('vinden_eshot_btn_1');var btn2=document.getElementById('vinden_eshot_btn_2');if((btn1)&&(btn2)){btn1.className=(num==1)?"vinden_eshot_btn_selected":"vinden_eshot_btn";btn2.className=(num==2)?"vinden_eshot_btn_selected":"vinden_eshot_btn";}
var txt=document.getElementById('vinden_eshot_main_txt');if(txt){if(num==1){txt.innerHTML="Inadequate sales, reduced margins, poor cash management and contractual disputes are all typical symptoms of a failing business operating in the construction sector.<br />&nbsp;<br />But do these symptoms mean that a corporate disaster is inevitable?&nbsp; And if your business is suffering from any of these complaints what, if anything, can be done about it?<br />&nbsp;<br />It is a fact that people rarely want to talk about business problems.&nbsp; It is simply not in our nature.&nbsp; However, it is the failure to recognise problems and take advice at an appropriate time that is the single biggest cause of company failure in the UK.<br />&nbsp;<br />Since its inception in 1994 The Vinden Partnership has advised clients on over 300 corporate restructures, acquisitions and recoveries.&nbsp; This advice is provided by experienced professionals who themselves have worked in surveying, legal, management and insurance professions allied to the UK construction sector.<br />&nbsp;<br />If a rescue is not possible, however, we can advise you on the appointment of an insolvency practitioner to comply with your obligations under relevant insolvency legislation. We can recover outstanding debtor and work in progress values, advise on the sale and novation of relevant contracts, arrange for the completion of contracts and assist in negotiating the sale of the business to interested parties."}
if(num==2){txt.innerHTML="Fundamental to the effective resolution of any dispute is an objective appraisal of your case. From the outset of any enquiry we will provide you with a clear and concise opinion on the strengths and weaknesses of your position.  <br><br>We will guide you through the options available to resolve the dispute and recommend the method of dispute resolution which will achieve your particular objectives as quickly and as economically as possible.<br><br>Where we can, we will attempt to achieve settlement of your case without invoking formal legal proceedings, however, if this is not possible we have expertise in adjudication, arbitration and litigation support. We will act as your case manager and advise you on the appointment of suitably experienced solicitors to deal with the proceedings."}}
txt=document.getElementById('vinden_eshot_link_bar');if(txt){if(num==1){txt.innerHTML="<a href='http://www.vinden.co.uk/services/specialist%20services/corporate%20recovery/'>Click here for full details of our corporate recovery and insolvency services</a>, or below to visit our main website.";}
if(num==2){txt.innerHTML="<a href='http://www.vinden.co.uk/services/dispute%20management/'>Click here for full details of our dispute management services</a>, or below to visit our main website.";}}}