
function language_changed()
{var lng_code=$j("#language_select").val();document.location=site_root+'help/language/'+lng_code;}
function init_help()
{show_help(help_items);}
function show_help(items)
{var str='';var help_content=$j('#help_content');for(var i in items)
{var t=items[i].help_item_title;str+='<div><b>'+$j.text(t)+'</b>';var topics=items[i].topics;str+='<ul>';for(var j in topics)
{str+="<li><a href='"+script_url+"help/"+topics[j].topic_id+"'>"+$j.text(topics[j].title)+'</a></li>';}
str+='</ul></div>';}
help_content.html(str);}
var help_sub_section_hide=['sub_sections1','sub_sections2','sub_sections3','sub_sections4','sub_section_buttons'];var form_processor={'forms':{'base_sales_form_4_3':{show:['sub_section4_3_tips','sub_section4_3_tip1','submit_button','sales_v4_form'],form_type:{id:'sales_v4_form_style',value:'base_sales_form_4_3'},form_name_text:'sub_section4_3_tips',form_name:'sales_v4_form'},'base_sales_form_4_2':{show:['sub_section4_2_tips','sub_section4_2_tip1','submit_button','sales_form'],form_type:{id:'sales_form_style',value:'base_sales_form_4_2'},form_name_text:'sub_section4_2_tips',form_name:'sales_form'},'base_sales_form_4_1':{show:['sub_section4_1_tips','sub_section4_1_tip1','submit_button','sales_form'],form_type:{id:'sales_form_style',value:'base_sales_form_4_1'},form_name_text:'sub_section4_1_tips',form_name:'sales_form'},'base_sales_form_3_2':{show:['sub_section3_2_tips','sub_section3_2_tip1','submit_button','sales_form'],form_type:{id:'sales_form_style',value:'base_sales_form_3_2'},form_name_text:'sub_section3_2_tips',form_name:'sales_form'},'base_sales_form_3_1':{show:['sub_section3_1_tips','sub_section3_1_tip1','submit_button','sales_form'],form_type:{id:'sales_form_style',value:'base_sales_form_3_1'},form_name_text:'sub_section3_1_tips',form_name:'sales_form'},'base_down_form_2_2':{show:['sub_section2_2_tips','sub_section2_2_tip1','submit_button','downgrade_form'],form_type:{id:'down_form_style',value:'base_down_form_2_2'},form_name_text:'sub_section2_2_tips',form_name:'downgrade_form'},'base_sales_form_2_7':{show:['sub_section2_7_tips','sub_section2_7_tip1','submit_button','refund_form'],form_type:{id:'refund_form_style',value:'base_sales_form_2_7'},form_name_text:'sub_section2_7_tips',form_name:'refund_form'},'base_sales_form_2_8':{show:['sub_section2_8_tips','sub_section2_8_tip1','submit_button','sales_form'],form_type:{id:'sales_form_style',value:'base_sales_form_2_8'},form_name_text:'sub_section2_8_tips',form_name:'sales_form'},'base_tech_form_1_1':{show:['sub_section1_1_tips','submit_button','tech_form','tech_upload_method','tech_problem_type','tech_connection_type','tech_file_count','tech_file_size','tech_screen'],form_type:{id:'tech_form_style',value:'base_tech_form_1_1'},form_name_text:'sub_section1_1_tips',form_name:'tech_form',run_function:upload_method_change},'base_tech_form_1_2':{show:['sub_section1_2_tips','submit_button','tech_form','tech_screen'],form_type:{id:'tech_form_style',value:'base_tech_form_1_2'},form_name_text:'sub_section1_2_tips',form_name:'tech_form'},'base_tech_form_1_3':{show:['sub_section1_3_tips','submit_button','tech_form','tech_file_name','tech_file_location','tech_file_uploaded_time'],form_type:{id:'tech_form_style',value:'base_tech_form_1_3'},form_name_text:'sub_section1_3_tips',form_name:'tech_form'},'base_tech_form_1_4':{show:['sub_section1_4_tips','sub_section1_4_tip1','submit_button','tech_form'],form_type:{id:'tech_form_style',value:'base_tech_form_1_4'},form_name_text:'sub_section1_4_tips',form_name:'tech_form'},'base_tech_form_1_6':{show:['sub_section1_6_tips','submit_button','tech_form'],form_type:{id:'tech_form_style',value:'base_tech_form_1_6'},form_name_text:'sub_section1_6_tips',form_name:'tech_form'},'base_tech_form_1_7':{show:['sub_section1_7_tips','submit_button','tech_form','tech_screen'],form_type:{id:'tech_form_style',value:'base_tech_form_1_7'},form_name_text:'sub_section1_7_tips',form_name:'tech_form'}},'hide':['main','section_buttons'],'success':['form_success','ok_button_success']}
var help_main_contact_data={main:{show:['main','section_buttons'],hide_class:['all_for_sub_sections'],check_radio:['section1','section2','section3','section4'],form_rest:['help_contact_form'],section1:{hide:['main','section_buttons'],show:['sub_sections1','sub_section_buttons'],check_radio:['sub_section1_1','sub_section1_2','sub_section1_3','sub_section1_4','sub_section1_5','sub_section1_6','sub_section1_7'],sub_section1_1:{hide:help_sub_section_hide,show:['sub_section1_1_tips','sub_section1_1_tip1','tips_buttons'],next:{hide:['sub_section1_1_tip1'],show:['sub_section1_1_tip2'],next:{show:['sub_section1_1_tip3'],next:{show:['sub_section1_1_tip4'],next:{show:['sub_section1_1_tip5'],next:{hide:['tips_buttons'],show:['tech_form','submit_button','tech_upload_method','tech_problem_type','tech_connection_type','tech_file_count','tech_file_size','tech_screen'],form_type:form_processor.forms.base_tech_form_1_1.form_type,form_name:form_processor.forms.base_tech_form_1_1.form_name,form_name_text:form_processor.forms.base_tech_form_1_1.form_name_text,end:true}}}}}},sub_section1_2:{hide:help_sub_section_hide,show:['sub_section1_2_tips','sub_section1_2_tip1','tips_buttons'],next:{hide:['sub_section1_2_tip1'],show:['sub_section1_2_tip2'],next:{show:['sub_section1_2_tip3'],next:{show:['sub_section1_2_tip4'],next:{show:['sub_section1_2_tip5'],next:{show:['sub_section1_2_tip6'],next:{hide:['tips_buttons'],show:['tech_form','submit_button','tech_screen'],form_type:form_processor.forms.base_tech_form_1_2.form_type,form_name:form_processor.forms.base_tech_form_1_2.form_name,form_name_text:form_processor.forms.base_tech_form_1_2.form_name_text,end:true}}}}}}},sub_section1_3:{hide:help_sub_section_hide,show:['sub_section1_3_tips','tech_form','submit_button','tech_file_name','tech_file_location','tech_file_uploaded_time'],form_type:form_processor.forms.base_tech_form_1_3.form_type,form_name:form_processor.forms.base_tech_form_1_3.form_name,form_name_text:form_processor.forms.base_tech_form_1_3.form_name_text,end:true},sub_section1_4:{hide:help_sub_section_hide,show:['sub_section1_4_tips','sub_section1_4_tip1','tips_buttons'],next:{hide:['sub_section1_4_tip1','tips_buttons'],show:['sub_section1_4_tip2','submit_button','tech_form'],form_type:form_processor.forms.base_tech_form_1_4.form_type,form_name:form_processor.forms.base_tech_form_1_4.form_name,form_name_text:form_processor.forms.base_tech_form_1_4.form_name_text,end:true}},sub_section1_5:{hide:help_sub_section_hide,show:['sub_section1_5_tips','sub_section1_5_tip1','ok_button'],end:true},sub_section1_6:{hide:help_sub_section_hide,show:['sub_section1_6_tips','sub_section1_6_tip1','tips_buttons'],next:{hide:['sub_section1_6_tip1'],show:['sub_section1_6_tip2'],next:{hide:['tips_buttons'],show:['sub_section1_6_tip3','tech_form','submit_button'],form_type:form_processor.forms.base_tech_form_1_6.form_type,form_name:form_processor.forms.base_tech_form_1_6.form_name,form_name_text:form_processor.forms.base_tech_form_1_6.form_name_text,end:true}}},sub_section1_7:{hide:help_sub_section_hide,show:['sub_section1_7_tips','tech_form','submit_button','tech_screen'],form_type:form_processor.forms.base_tech_form_1_7.form_type,form_name:form_processor.forms.base_tech_form_1_7.form_name,form_name_text:form_processor.forms.base_tech_form_1_7.form_name_text,end:true}},section2:{hide:['main','section_buttons'],show:['sub_sections2','sub_section_buttons'],check_radio:['sub_section2_1','sub_section2_2','sub_section2_3','sub_section2_4','sub_section2_5','sub_section2_6','sub_section2_7','sub_section2_8'],sub_section2_1:{hide:help_sub_section_hide,show:['sub_section2_1_tips','sub_section2_1_tip1','ok_button'],end:true},sub_section2_2:{hide:help_sub_section_hide,show:['sub_section2_2_tips','sub_section2_2_tip1','submit_button','downgrade_form'],form_type:form_processor.forms.base_down_form_2_2.form_type,form_name:form_processor.forms.base_down_form_2_2.form_name,form_name_text:form_processor.forms.base_down_form_2_2.form_name_text,end:true},sub_section2_3:{hide:help_sub_section_hide,show:['sub_section2_3_tips','sub_section2_3_tip1','ok_button'],end:true},sub_section2_4:{hide:help_sub_section_hide,show:['sub_section2_4_tips','sub_section2_4_tip1','ok_button'],end:true},sub_section2_5:{hide:help_sub_section_hide,show:['sub_section2_5_tips','sub_section2_5_tip1','ok_button'],end:true},sub_section2_6:{hide:help_sub_section_hide,show:['sub_section2_6_tips','sub_section2_6_tip1','ok_button'],end:true},sub_section2_7:{hide:help_sub_section_hide,show:['sub_section2_7_tips','submit_button','refund_form'],form_type:form_processor.forms.base_sales_form_2_7.form_type,form_name:form_processor.forms.base_sales_form_2_7.form_name,form_name_text:form_processor.forms.base_sales_form_2_7.form_name_text,end:true},sub_section2_8:{hide:help_sub_section_hide,show:['sub_section2_8_tips','submit_button','sales_form'],form_type:form_processor.forms.base_sales_form_2_8.form_type,form_name:form_processor.forms.base_sales_form_2_8.form_name,form_name_text:form_processor.forms.base_sales_form_2_8.form_name_text,end:true}},section3:{hide:['main','section_buttons'],show:['sub_sections3','sub_section_buttons'],check_radio:['sub_section3_1','sub_section3_2'],sub_section3_1:{hide:help_sub_section_hide,show:['sub_section3_1_tips','sub_section3_1_tip1','submit_button','sales_form'],form_type:form_processor.forms.base_sales_form_3_1.form_type,form_name:form_processor.forms.base_sales_form_3_1.form_name,form_name_text:form_processor.forms.base_sales_form_3_1.form_name_text,end:true},sub_section3_2:{hide:help_sub_section_hide,show:['sub_section3_2_tips','sub_section3_2_tip1','submit_button','sales_form'],form_type:form_processor.forms.base_sales_form_3_2.form_type,form_name:form_processor.forms.base_sales_form_3_2.form_name,form_name_text:form_processor.forms.base_sales_form_3_2.form_name_text,end:true}},section4:{hide:['main','section_buttons'],show:['sub_sections4','sub_section_buttons'],check_radio:['sub_section4_1','sub_section4_2','sub_section4_3'],sub_section4_1:{hide:help_sub_section_hide,show:['sub_section4_1_tips','sub_section4_1_tip1','submit_button','sales_form'],form_type:form_processor.forms.base_sales_form_4_1.form_type,form_name:form_processor.forms.base_sales_form_4_1.form_name,form_name_text:form_processor.forms.base_sales_form_4_1.form_name_text,end:true},sub_section4_2:{hide:help_sub_section_hide,show:['sub_section4_2_tips','sub_section4_2_tip1','submit_button','sales_form'],form_type:form_processor.forms.base_sales_form_4_2.form_type,form_name:form_processor.forms.base_sales_form_4_2.form_name,form_name_text:form_processor.forms.base_sales_form_4_2.form_name_text,end:true},sub_section4_3:{hide:help_sub_section_hide,show:['sub_section4_3_tips','sub_section4_3_tip1','submit_button','sales_v4_form'],form_type:form_processor.forms.base_sales_form_4_3.form_type,form_name:form_processor.forms.base_sales_form_4_3.form_name,form_name_text:form_processor.forms.base_sales_form_4_3.form_name_text,end:true}}}}
var path_array=[];function construnct_path_array(section,path)
{path_array.push({'section':section,'path':path});if(section.next)
{var temp=path;construnct_path_array(section.next,path+','+path_array.length);}
else if(section.check_radio)
{for(var i=0;i<section.check_radio.length;i++)
{construnct_path_array(section[section.check_radio[i]],path+','+path_array.length);}}}
var help_contact_current_form='';var help_contact_current=help_main_contact_data.main;function process_contact_form(type,success)
{if(form_processor.forms[type])
{for(var i=0;i<form_processor.hide.length;i++)
{$j('#'+form_processor.hide[i]).hide();}
if(!success)
{for(var i=0;i<form_processor.forms[type].show.length;i++)
{$j('#'+form_processor.forms[type].show[i]).show();}}
else
{for(var i=0;i<form_processor.success.length;i++)
{$j('#'+form_processor.success[i]).show();}}
if(form_processor.forms[type].form_type)
{$j('#'+form_processor.forms[type].form_type.id).val(form_processor.forms[type].form_type.value);}
if(form_processor.forms[type].form_name)
{help_contact_current_form=form_processor.forms[type].form_name;$j('#'+form_processor.forms[type].form_name).find('img').attr('src',script_url+'index.php?rm=common_captcha');}
if(form_processor.forms[type].run_function)
{form_processor.forms[type].run_function($j('#upload_method_select').get(0));}
if(form_processor.forms[type].run_function)
{form_processor.forms[type].run_function($j('#upload_method_select').get(0));}
if(form_processor.forms[type].form_name_text)
{$j('#'+form_processor.forms[type].form_name).find('.form_title').val($j('#'+form_processor.forms[type].form_name_text).find('.page_title').text());}}}
function process_contact_help()
{if(help_contact_current.check_radio)
{for(var i=0;i<help_contact_current.check_radio.length;i++)
{if($j('#'+help_contact_current.check_radio[i]).attr('checked'))
{process_contact_help_section(help_contact_current[help_contact_current.check_radio[i]]);break;}}}
else if(help_contact_current.next)
{process_contact_help_section(help_contact_current.next,true);}
else if(help_contact_current.end)
{process_contact_help_section(help_main_contact_data.main);}}
function process_contact_help_section(section,need_mark,no_history)
{if(!section)return;$j('.active_help').hide();if(section.form_name=='sales_form')
{if(section.form_name_text=='sub_section4_1_tips'||section.form_name_text=='sub_section4_2_tips')
{$j('tr.captcha').hide();}
else
{$j('tr.captcha').show();}}
help_contact_current=section;if(!no_history)add_history(add_history);if(help_contact_current.form_rest)
{for(var i=0;i<help_contact_current.form_rest.length;i++)
{$j('#'+help_contact_current.form_rest[i]).get(0).reset();}}
if(help_contact_current.hide)
{for(var i=0;i<help_contact_current.hide.length;i++)
{$j('#'+help_contact_current.hide[i]).hide();}}
if(help_contact_current.hide_class)
{for(var i=0;i<help_contact_current.hide_class.length;i++)
{$j('.'+help_contact_current.hide_class[i]).hide();}}
if(help_contact_current.show)
{for(var i=0;i<help_contact_current.show.length;i++)
{if(need_mark)
{$j('#'+help_contact_current.show[i]).addClass('active_help');}
$j('#'+help_contact_current.show[i]).show();}}
if(help_contact_current.form_type)
{$j('#'+help_contact_current.form_type.id).val(help_contact_current.form_type.value);}
if(help_contact_current.form_name)
{help_contact_current_form=help_contact_current.form_name;$j('#'+help_contact_current.form_name).find('img').attr('src',script_url+'index.php?rm=common_captcha');}
if(help_contact_current.form_name_text)
{$j('#'+help_contact_current.form_name).find('.form_title').val($j('#'+help_contact_current.form_name_text).find('.page_title').text());}}
function contact_help_form_submit()
{if(help_contact_current_form)
{var fv=$j.box.getFlashVersion();if(fv)
{$j('#'+help_contact_current_form).find('#flash_version').val(fv);if(typeof(flash_upload_working)!='undefined')
{$j('#'+help_contact_current_form).find('#flash_upload_working').val(flash_upload_working);}}
if(typeof(Java_Version)!='undefined')
{$j('#'+help_contact_current_form).find('#java_version').val(Java_Version);}
$j('#'+help_contact_current_form).find('form').submit();}}
function upload_method_change(p)
{if(!p.value)
{$j('#tech_upload_settings').hide();}
else
{$j('#tech_upload_settings').show();if(p.value=='Add files')
{$j('#upload_settings_select1').show();$j('#upload_settings_select2').hide();}
if(p.value=='Drag and Drop')
{$j('#upload_settings_select2').show();$j('#upload_settings_select1').hide();}}}
function history_change(hash)
{if(hash.substr(0,1)=='#')hash=hash.substr(1);if(hash)
{process_contact_help_section(help_main_contact_data.main,'',true);var path=path_array[hash].path.split(',');for(var i in path)
{process_contact_help_section(path_array[path[i]].section,'',true);}}
else
{process_contact_help_section(help_main_contact_data.main,'',true);}}
function add_history()
{var hash;for(var i in path_array)
{if(path_array[i].section==help_contact_current)
{hash=i;break;}}
$j.history.add(hash,function()
{history_change(hash);});};$j(function()
{var path='0';construnct_path_array(help_main_contact_data.main,path);var hash=window.location.hash;hash=hash.substr(1);$j.history.initialize(function()
{history_change(hash);});if(hash)
{history_change(hash);}})