
var is_IE=0;var is_firefox=0;var loaded=0;nav=navigator.userAgent;var global_url="http://www.boxer-design.co.uk/";var s_global_url='http://www.boxer-design.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=200;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="#2bb7a6";var flash_main_color_1="#2bb7a6";var flash_main_color_2="#2bb7a6";var flash_bg_color="#999999";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='#999999';var dropdown_menu_left_offset=1;var mem_allow_logon=1;var gallery_show_img_name=0;var gallery_img_name_color='#ff0101';var header_height=100;var header_type=1;var can_get_basket=0;var print_header="";var gallery_background_random=0;var page_back_img_below_header=2;var basket_empty_txt="Your Bag 0 Items [CAT_CURRENCY_PREFIX]0.00";var main_menu_btn_spacing=1;var dropdown_min_height=25;var form_error_color="#ff0101";var ARTICLES_TITLE="Latest News";var USE_HTACCESS_REWRITE=1;var DEFAULT_NAME="Boxer Design";var FONT_COLOR="#333333";var URL_REPLACE_SPACE="-";var URL_REPLACE_REPLACE="+-+";var BASKET_TITLE="Your Bag";var BASKET_URL="http://www.boxer-design.co.uk/your-bag";var CHECKOUT_TITLE="Checkout";var CHECKOUT_URL="http://www.boxer-design.co.uk/checkout";var currency_arr=Array();var CAT_PRICE_CURRENCY="GBP";var CAT_CURRENCY_X_OFFSET=0;var CAT_CURRENCY_Y_OFFSET=0;function resizeFNS(){resizePage();checkResizeAllDD();try{positionCurrencyOptions();}catch(resize_err){}}
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");var calendar=document.createElement("div");calendar.id="calender";calendar.innerHTML='<iframe id="calender_frame" name="calender_frame" frameborder="0" scrolling="no"  src=""></iframe>';document.body.appendChild(calendar);}
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 style=\"padding:20px;\"><div style=\"display:inline;padding:2px;background-color:#ffffff;\">loading please wait...</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=0;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="enter keyword(s) to search";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 #333";if(document.getElementById('right_content')){document.getElementById('right_content').style.top=h+"px";document.getElementById('right_content').style.borderTop="1px solid #333";}
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 #333";if(document.getElementById('right_content')){document.getElementById('right_content').style.borderTop="0px solid #333";}}
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=(site_width==0)?(w)+"px":(site_width)+"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').clientHeight):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').clientHeight):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_menu')){footer_h+=parseInt(document.getElementById('footer_menu').clientHeight)+30;}
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').offsetTop))+"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').offsetTop))+"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>0)?page_border+"px":"0px");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=CHECKOUT_URL;}
function viewBasket(){window.location.href=BASKET_URL;}
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="Your Account";var mem_not_logon_text="Create Account / Log In";var mem_logon_text_dir="Your-Account";var mem_text_case=0;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(mem_text_case==1){txt=txt.toUpperCase();}else if(mem_text_case==2){txt=txt.toLowerCase();}
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;":"";if(mem_text_case==1){txt+=(is_member==1)?mem_logon_text.toUpperCase():mem_not_logon_text.toUpperCase();}else if(mem_text_case==2){txt+=(is_member==1)?mem_logon_text.toUpperCase():mem_not_logon_text.toUpperCase();}else{txt+=(is_member==1)?mem_logon_text:mem_not_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()+"\">";if(mem_text_case==1){txt+=mem_logon_text.toUpperCase();}else if(mem_text_case==2){txt+=mem_logon_text.toLowerCase();}else{txt+=mem_logon_text;}
txt+="</a>";}
if(is_logged_in==1){txt+="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\"javascript:memberLogin(0,'',1);\">";if(mem_text_case==1){txt+="SIGN&nbsp;OUT";}else if(mem_text_case==2){txt+="sign&nbsp;out";}else{txt+="Sign&nbsp;Out";}
txt+="</a>";}else if(!div){txt+="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;";if(mem_text_case==1){txt+="YOU&nbsp;ARE&nbsp;NOT&nbsp;SIGNED&nbsp;IN.";}else if(mem_text_case==2){txt+="you&nbsp;are&nbsp;not&nbsp;signed&nbsp;in.";}else{txt+="You&nbsp;are&nbsp;not&nbsp;signed&nbsp;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('mb_'+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]){var this_l=document.getElementById('main_btn_'+m).offsetLeft;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').offsetLeft);l+=parseInt(document.getElementById('mb_'+m).offsetLeft);l+=1;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.zIndex=dd_z;document.getElementById('menu_'+m).style.display="block";dd_z++
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){var 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;window['image_changer']=setTimeout("swapImage()",image_change_delay);}}
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 resetBlendRunning(){img_blend_running=0;if(blend_img_queue_arr.length>0){blendimage(blend_img_queue_arr[0]['divid'],blend_img_queue_arr[0]['imageid'],blend_img_queue_arr[0]['imagefile'],blend_img_queue_arr[0]['millisec'],blend_img_queue_arr[0]['timer']);blend_img_queue_arr.shift();}}
var blend_img_queue_arr=Array();function addToBlendImageQueue(divid,imageid,imagefile,millisec,timer,reset_q){if(reset_q){blend_img_queue_arr=Array();}
blend_img_queue_arr.push({divid:divid,imageid:imageid,imagefile:imagefile,millisec:millisec,timer:timer});}
function clearAllBlendImages(){for(i=0;i<=100;i++){if(window['opt_'+i]){clearInterval(window['opt_'+i]);window['opt_'+i]=null;}}
if(window['opt_'+101]){clearInterval(window['opt_'+101]);window['opt_'+101]=null;}
img_blend_running=0;}
var img_blend_running=0;function blendimage(divid,imageid,imagefile,millisec,timer){if(img_blend_running==1){return false;}else if(document.getElementById(divid)){img_blend_running=1;var speed=Math.round(millisec/100);if((typeof(timer)=="undefined")||(timer===null)){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['opt_'+101]=setTimeout("resetBlendRunning()",(timer*speed));}}
function checkNumber(field,type){switch(type){case"full":thisNum=parseInt(field.value);break;case"decimal":t1=parseInt(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=parseInt(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(popup===null){popup=document.getElementById('popup');if(!lightbox){popup=document.createElement("div");popup.id="popup";document.getElementById('main_page').appendChild(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(lightbox===null){lightbox=document.getElementById('lightbox');if(!lightbox){lightbox=document.createElement("div");lightbox.id="lightbox";document.getElementById('main_page').appendChild(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)&&(document.getElementById('left_content')))?(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']);var this_speed=Math.abs(rotator_box_items[key]['speed']);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=(this_speed>0)?(this_speed*1000):300;var actual_delay=delay+millisec;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;}
var dd_z=200000;var dd_p_arr=Array();var dd_menu_firsttime=1;function showDDMenu(id,bool){var menu=document.getElementById(id);closeAllDDMenus();if(menu){if(bool){if(dd_menu_firsttime==1){dd_menu_firsttime=0;document.getElementById('main_page').onmouseover=function(){closeAllDDMenus();}}
var p_node=menu.parentNode;if(p_node.tagName!="BODY"){document.body.appendChild(menu);p_node=p_node.parentNode;dd_p_arr[id]=p_node;menu.onmouseout=function(e){checkCloseDDMenu(e,this.id);}}
menu.style.display="block";positionDDMenu(id);}}}
function closeAllDDMenus(){for(var i in dd_p_arr){var menu=document.getElementById(i);if((menu)&&(menu.style.display=="block")){menu.style.display="none";}}}
function checkResizeAllDD(){for(var i in dd_p_arr){var menu=document.getElementById(i);if((menu)&&(menu.style.display=="block")){positionDDMenu(i);}}}
function checkCloseDDMenu(e,id){if(!e)var e=window.event;var tg=(window.event)?e.srcElement:e.target;var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;var p_node=reltg;while(p_node.tagName!="BODY"){if(p_node.id==id){return false;}
p_node=p_node.parentNode;}
closeAllDDMenus();}
function positionDDMenu(id){var menu=document.getElementById(id);if((menu)&&(menu.style.display=="block")){var w=document.documentElement.clientWidth;menu.left="0px;";var menu_w=menu.clientWidth;var p_node=dd_p_arr[id];var x=0;var y=0;y+=parseInt(p_node.clientHeight);if(is_firefox!=1){y-=10;}
x-=1;for(var i=0;i<40;i++){if((p_node.id!="header")&&(p_node.id!="main_div")){x+=parseInt(p_node.offsetLeft);y+=parseInt(p_node.offsetTop);p_node=p_node.parentNode;}else{x+=Math.round((w-p_node.clientWidth)/2);break;}}
var max_w=(w-x);if(max_w<menu_w){var dif=menu_w-max_w;x-=dif;}
menu.style.zIndex=dd_z;menu.style.left=x+"px";menu.style.top=y+"px";dd_z++;try{resizePage();}catch(dd_err){}}}
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;}
function addEvent(o,type,fn){o.addEventListener(type,fn,false);}
function removeEvent(o,type,fn){o.removeEventListener(type,fn,false);}
if(!window.addEventListener){var addEvent=function(o,type,fn){if(!o._events)o._events={};var queue=o._events[type];if(!queue){o._events[type]=[fn];if(!o._events._callback)
o._events._callback=function(e){Event._callListeners(e,o)};o.attachEvent("on"+type,o._events._callback);}else if(Event._fnIndex(o,type,fn)==-1)
queue.push(fn);else return;Event._mem.push([o,type,fn]);};var removeEvent=function(o,type,fn){var i=Event._fnIndex(o,type,fn);if(i<0)return;var queue=o._events[type];if(queue.calling){delete queue[i];if(queue.removeListeners)
queue.removeListeners.push(i);else
queue.removeListeners=[i];}else
if(queue.length==1)
Event._detach(o,type);else
queue.splice(i,1);};var Event={AT_TARGET:2,BUBBLING_PHASE:3,stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},_mem:[],_callListeners:function(e,o){e.stopPropagation=this.stopPropagation;e.preventDefault=this.preventDefault;e.currentTarget=o;e.target=e.srcElement;e.eventPhase=e.currentTarget==e.target?this.AT_TARGET:this.BUBBLING_PHASE;switch(e.type){case"mouseover":e.relatedTarget=e.fromElement;break;case"mouseout":e.relatedTarget=e.toElement;}
var queue=o._events[e.type];queue.calling=true;for(var i=0,l=queue.length;i<l;i++)
if(queue[i])
if("handleEvent"in queue[i])
queue[i].handleEvent(e);else
queue[i].call(o,e);queue.calling=null;if(!queue.removeListeners)
return;if(queue.length==queue.removeListeners.length){this._detach(o,e.type);return;}
queue.removeListeners=queue.removeListeners.sort(function(a,b){return a-b});var i=queue.removeListeners.length;while(i--)
queue.splice(queue.removeListeners[i],1);if(queue.length==0)
this._detach(o,e.type);else
queue.removeListeners=null;},_detach:function(o,type){o.detachEvent("on"+type,o._events._callback);delete o._events[type];},_fnIndex:function(o,type,fn){var queue=o._events[type];if(queue)
for(var i=0,l=queue.length;i<l;i++)
if(queue[i]==fn)
return i;return-1;},_cleanup:function(){for(var m,i=0;m=Event._mem[i];i++)
if(m[1]!="unload"||m[2]==Event._cleanup)
removeEvent(m[0],m[1],m[2]);}};addEvent(window,"unload",Event._cleanup);}
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!=""){var tag=document.getElementById(id);if(!tag){tag=document.createElement("div");tag.id=id;tag.className="alpha_0";document.body.appendChild(tag);}
if(tag){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);}}
if(typeof jQuery!='undefined'){jQuery(function($){$.fn.extend({loopedSlider:function(options){var settings=$.extend({},$.fn.loopedSlider.defaults,options);return this.each(function(){if($.fn.jquery<'1.3.2'){return;}
var $t=$(this);var o=$.metadata?$.extend({},settings,$t.metadata()):settings;var distance=0;var times=1;var slides=$(o.slides,$t).children().size();var width=$(o.slides,$t).children().outerWidth();var position=0;var active=false;var number=0;var interval=0;var restart=0;var pagination=$("."+o.pagination+" li a",$t);if(o.addPagination&&!$(pagination).length){var buttons=slides;$($t).append("<ul class="+o.pagination+">");$(o.slides,$t).children().each(function(){if(number<buttons){$("."+o.pagination,$t).append("<li><a rel="+(number+1)+" href=\"#\" >&nbsp;</a></li>");number=number+1;}else{number=0;return false;}
$("."+o.pagination+" li a:eq(0)",$t).parent().addClass("active");});pagination=$("."+o.pagination+" li a",$t);}else{$(pagination,$t).each(function(){number=number+1;$(this).attr("rel",number);$(pagination.eq(0),$t).parent().addClass("active");});}
if(slides===1){$(o.slides,$t).children().css({position:"absolute",left:position,display:"block"});return;}
$(o.slides,$t).css({width:(slides*width)});$(o.slides,$t).children().each(function(){$(this).css({position:"absolute",left:position,display:"block"});position=position+width;});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});if(slides>3){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(o.autoHeight){autoHeight(times);}
$(".next",$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});$(".previous",$t).click(function(){if(active===false){animate("prev",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.containerClick){$(o.container,$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});}
$(pagination,$t).click(function(){if($(this).parent().hasClass("active")){return false;}
else{times=$(this).attr("rel");$(pagination,$t).parent().siblings().removeClass("active");$(this).parent().addClass("active");animate("fade",times);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.autoStart){sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);function autoStart(){if(o.restart){clearInterval(sliderIntervalID,interval);clearTimeout(restart);restart=setTimeout(function(){interval=setInterval(function(){animate("next",true);},o.autoStart);},o.restart);}else{sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);}};}
function current(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
$(pagination,$t).parent().siblings().removeClass("active");$(pagination+"[rel='"+(times)+"']",$t).parent().addClass("active");};function autoHeight(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
var getHeight=$(o.slides,$t).children(":eq("+(times-1)+")",$t).outerHeight();$(o.container,$t).animate({height:getHeight},o.autoHeight);};function animate(dir,clicked){active=true;switch(dir){case"next":times=times+1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===3){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:width});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===slides+1){times=1;$(o.slides,$t).css({left:0},function(){$(o.slides,$t).animate({left:distance})});$(o.slides,$t).children(":eq(0)").css({left:0});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(times===slides)$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});if(times===slides-1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:(slides*width-width)});active=false;});break;case"prev":times=times-1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===0){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(-width)});}
if(times===1){$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===0){times=slides;$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(slides*width-width)});$(o.slides,$t).css({left:-(slides*width-width)});$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2)$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});if(times===1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});active=false;});break;case"fade":times=[times]*1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
$(o.slides,$t).children().fadeOut(o.fadespeed,function(){$(o.slides,$t).css({left:distance});$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:slides*width-width});$(o.slides,$t).children(":eq(0)").css({left:0});if(times===slides){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===1){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
$(o.slides,$t).children().fadeIn(o.fadespeed);active=false;});break;default:break;}};});}});$.fn.loopedSlider.defaults={container:".slide-container",slides:".slides",pagination:"pagination",containerClick:false,autoStart:5000,restart:0,slidespeed:300,fadespeed:200,autoHeight:0,addPagination:false};});}
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b==="find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" "," ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case"only":case"first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case"last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case"nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m==="="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j={},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);if(typeof jQuery!='undefined'){jQuery(function($){$.fn.extend({loopedSlider:function(options){var settings=$.extend({},$.fn.loopedSlider.defaults,options);return this.each(function(){if($.fn.jquery<'1.3.2'){return;}
var $t=$(this);var o=$.metadata?$.extend({},settings,$t.metadata()):settings;var distance=0;var times=1;var slides=$(o.slides,$t).children().size();var width=$(o.slides,$t).children().outerWidth();var position=0;var active=false;var number=0;var interval=0;var restart=0;var pagination=$("."+o.pagination+" li a",$t);if(o.addPagination&&!$(pagination).length){var buttons=slides;$($t).append("<ul class="+o.pagination+">");$(o.slides,$t).children().each(function(){if(number<buttons){$("."+o.pagination,$t).append("<li><a rel="+(number+1)+" href=\"#\" >&nbsp;</a></li>");number=number+1;}else{number=0;return false;}
$("."+o.pagination+" li a:eq(0)",$t).parent().addClass("active");});pagination=$("."+o.pagination+" li a",$t);}else{$(pagination,$t).each(function(){number=number+1;$(this).attr("rel",number);$(pagination.eq(0),$t).parent().addClass("active");});}
if(slides===1){$(o.slides,$t).children().css({position:"absolute",left:position,display:"block"});return;}
$(o.slides,$t).css({width:(slides*width)});$(o.slides,$t).children().each(function(){$(this).css({position:"absolute",left:position,display:"block"});position=position+width;});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});if(slides>3){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(o.autoHeight){autoHeight(times);}
$(".next",$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});$(".previous",$t).click(function(){if(active===false){animate("prev",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.containerClick){$(o.container,$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});}
$(pagination,$t).click(function(){if($(this).parent().hasClass("active")){return false;}
else{times=$(this).attr("rel");$(pagination,$t).parent().siblings().removeClass("active");$(this).parent().addClass("active");animate("fade",times);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.autoStart){sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);function autoStart(){if(o.restart){clearInterval(sliderIntervalID,interval);clearTimeout(restart);restart=setTimeout(function(){interval=setInterval(function(){animate("next",true);},o.autoStart);},o.restart);}else{sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);}};}
function current(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
$(pagination,$t).parent().siblings().removeClass("active");$(pagination+"[rel='"+(times)+"']",$t).parent().addClass("active");};function autoHeight(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
var getHeight=$(o.slides,$t).children(":eq("+(times-1)+")",$t).outerHeight();$(o.container,$t).animate({height:getHeight},o.autoHeight);};function animate(dir,clicked){active=true;switch(dir){case"next":times=times+1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===3){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:width});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===slides+1){times=1;$(o.slides,$t).css({left:0},function(){$(o.slides,$t).animate({left:distance})});$(o.slides,$t).children(":eq(0)").css({left:0});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(times===slides)$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});if(times===slides-1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:(slides*width-width)});active=false;});break;case"prev":times=times-1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===0){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(-width)});}
if(times===1){$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===0){times=slides;$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(slides*width-width)});$(o.slides,$t).css({left:-(slides*width-width)});$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2)$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});if(times===1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});active=false;});break;case"fade":times=[times]*1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
$(o.slides,$t).children().fadeOut(o.fadespeed,function(){$(o.slides,$t).css({left:distance});$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:slides*width-width});$(o.slides,$t).children(":eq(0)").css({left:0});if(times===slides){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===1){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
$(o.slides,$t).children().fadeIn(o.fadespeed);active=false;});break;default:break;}};});}});$.fn.loopedSlider.defaults={container:".slide-container",slides:".slides",pagination:"pagination",containerClick:false,autoStart:5000,restart:0,slidespeed:300,fadespeed:200,autoHeight:0,addPagination:false};});}
