[Movecommons-commits] r581 - trunk/src
Mario Gallegos
mgallegos at ourproject.org
Mon Nov 5 21:01:00 CET 2012
Author: mgallegos
Date: 2012-11-05 21:00:59 +0100 (Mon, 05 Nov 2012)
New Revision: 581
Modified:
trunk/src/mc-dia-form2.js
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-05 17:16:59 UTC (rev 580)
+++ trunk/src/mc-dia-form2.js 2012-11-05 20:00:59 UTC (rev 581)
@@ -1,938 +1,937 @@
var $j = jQuery.noConflict();
-var current_step='#first_step';
+$j(function(){
-var step_two_reached=step_three_reached=step_four_reached=step_five_reached=step_six_reached=false;
-
-var field_values = {'ininame' : 'Name of your initiative','url' : 'Web address','languages' : 'Language(s)','keywords' : 'Keywords','location' : 'Location','email' : 'email address' };
-
-var mc_np = "0",mc_rp = "0",mc_rc = "0",mc_gr = "0",mc_category = "",nameIni = "", urlIni = "",keywordsIni = "";
-
-function clickCheckBox(id,answer){
- if(answer=='yes'){
- if ($j("#mc-form-" + id).is('.mc-form-descbox-selected')) return;
- $j('#'+id+'-checkbox').val('S');
- $j("#mc-form-" + id).addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ id).slideDown();
- if(id=='np'){
- $("#registered-non-profit").removeAttr("disabled");
- $("#open-accounting").removeAttr("disabled");
- $("#accept-donations").removeAttr("disabled");
- $j("#mc-form-optional-non-profit").effect("shake", { times:1 }, 200);
+ var current_step='#first_step';
+
+ var step_two_reached=step_three_reached=step_four_reached=step_five_reached=step_six_reached=false;
+
+ var field_values = {'ininame' : 'Name of your initiative','url' : 'Web address','languages' : 'Language(s)','keywords' : 'Keywords','location' : 'Location','email' : 'email address' };
+
+ var mc_np = "0",mc_rp = "0",mc_rc = "0",mc_gr = "0",mc_category = "",nameIni = "", urlIni = "",keywordsIni = "";
+
+ function clickCheckBox(id,answer){
+ if(answer=='yes'){
+ if ($j("#mc-form-" + id).is('.mc-form-descbox-selected')) return;
+ $j('#'+id+'-checkbox').val('S');
+ $j("#mc-form-" + id).addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ id).slideDown();
+ if(id=='np'){
+ $("#registered-non-profit").removeAttr("disabled");
+ $("#open-accounting").removeAttr("disabled");
+ $("#accept-donations").removeAttr("disabled");
+ $j("#mc-form-optional-non-profit").effect("shake", { times:1 }, 200);
+ }
+ if(id=='rp'){
+ $("#terms-of-use").removeAttr("disabled");
+ $("#creative-commons").removeAttr("disabled");
+ $("#other-license").removeAttr("disabled");
+ $("#organization-structure").removeAttr("disabled");
+ $("#projects-and-results").removeAttr("disabled");
+ $("#methods-procedures").removeAttr("disabled");
+ $("#documentation").removeAttr("disabled");
+ $j("#mc-form-optional-reproducible").effect("shake", { times:1 }, 200);
+ }
+ if(id=='gr'){
+ $("#decisions-general-assemblies").removeAttr("disabled");
+ $("#decisions-consensus").removeAttr("disabled");
+ $("#representatives-democratically").removeAttr("disabled");
+ $("#meetings-transparent").removeAttr("disabled");
+ $("#decisions-voting").removeAttr("disabled");
+ $j("#mc-form-optional-grassroots").effect("shake", { times:1 }, 200);
+ }
+ if(id=='rc')
+ $j("#mc-form-optional-reinforcing").effect("shake", { times:1 }, 200);
+ }
+ else{
+ $j('#'+id+'-checkbox').val('N');
+ $j("#mc-form-" + id).removeClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ id).slideUp();
+ if(id=='np'){
+ $("#registered-non-profit").attr("disabled", "disabled");
+ $('#registered-non-profit').attr('checked', false);
+ $("#open-accounting").attr("disabled", "disabled");
+ $('#open-accounting').attr('checked', false);
+ $("#accept-donations").attr("disabled", "disabled");
+ $('#accept-donations').attr('checked', false);
+ $j('#non-profit-website').hide();
+ $j('#infield-non-profit-website').hide();
+ $j('#open-accounting-website').hide();
+ $j('#infield-open-accounting-website').hide();
+ $j('#donation-website').hide();
+ $j('#infield-donation-website').hide();
+ $j('#submit_second').click();
+ }
+ if(id=='rp'){
+ $("#terms-of-use").attr("disabled", "disabled");
+ $('#terms-of-use').attr('checked', false);
+ $("#creative-commons").attr("disabled", "disabled");
+ $('#creative-commons').attr('checked', false);
+ $("#other-license").attr("disabled", "disabled");
+ $('#other-license').attr('checked', false);
+ $("#organization-structure").attr("disabled", "disabled");
+ $('#organization-structure').attr('checked', false);
+ $("#projects-and-results").attr("disabled", "disabled");
+ $('#projects-and-results').attr('checked', false);
+ $("#methods-procedures").attr("disabled", "disabled");
+ $('#methods-procedures').attr('checked', false);
+ $("#documentation").attr("disabled", "disabled");
+ $('#documentation').attr('checked', false);
+ $j('#terms-of-use-website').hide();
+ $j('#infield-terms-of-use-website').hide();
+ $j('#creative-commons-website').hide();
+ $j('#infield-creative-commons-website').hide();
+ $j('#other-license-website').hide();
+ $j('#infield-other-license-website').hide();
+ $j('#submit_third').click();
+ }
+ if(id=='rc'){
+ reset_areas();
+ $j('#submit_fourth').click();
+ }
+ if(id=='gr'){
+ $("#decisions-general-assemblies").attr("disabled", "disabled");
+ $('#decisions-general-assemblies').attr('checked', false);
+ $("#decisions-consensus").attr("disabled", "disabled");
+ $('#decisions-consensus').attr('checked', false);
+ $("#representatives-democratically").attr("disabled", "disabled");
+ $('#representatives-democratically').attr('checked', false);
+ $("#meetings-transparent").attr("disabled", "disabled");
+ $('#meetings-transparent').attr('checked', false);
+ $("#decisions-voting").attr("disabled", "disabled");
+ $('#decisions-voting').attr('checked', false);
+ $j('#submit_fifth').click();
+ }
+
}
- if(id=='rp'){
- $("#terms-of-use").removeAttr("disabled");
- $("#creative-commons").removeAttr("disabled");
- $("#other-license").removeAttr("disabled");
- $("#organization-structure").removeAttr("disabled");
- $("#projects-and-results").removeAttr("disabled");
- $("#methods-procedures").removeAttr("disabled");
- $("#documentation").removeAttr("disabled");
- $j("#mc-form-optional-reproducible").effect("shake", { times:1 }, 200);
+ }
+
+ function imageMapInit(){
+ $j('.map').mapster({
+ fillColor: 'EA8F5F',
+ fillOpacity: 0.8,
+ isSelectable: false,
+ mapKey: 'step',
+ onClick: function (e) {
+ onClickImageMap(e);
+ }
+ });
+ }
+
+ function imageMapUnBind(){
+ $j('.map').mapster('unbind');
+ $j('#firstStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 19px;margin-top: 0"><div class="marker"></div>');
+ $j('#secondStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 111px;margin-top: 0"><div class="marker"></div>');
+ $j('#thirdStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 203px;margin-top: 0"><div class="marker"></div>');
+ $j('#fourthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 295px;margin-top: 0"><div class="marker"></div>');
+ $j('#fifthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 386px;margin-top: 0"><div class="marker"></div>');
+ $j('#sixthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 478px;margin-top: 0"><div class="marker"></div>');
+ }
+
+ function onClickImageMap(e){
+ if (e.key=='#first_step'){
+ $j('#progress_text').html('0% Complete');
+ $j('#progress').css('width','0');
+ }
+ else if (e.key=='#second_step'){
+ $j('#progress_text').html('20% Complete');
+ $j('#progress').css('width','68px');
+ if($j('#np-checkbox').val()=='S')
+ $j('label[for*="step2-yes"]').addClass('ui-state-active');
+ else if ($j('#np-checkbox').val()=='N')
+ $j('label[for*="step2-no"]').addClass('ui-state-active');
}
- if(id=='gr'){
- $("#decisions-general-assemblies").removeAttr("disabled");
- $("#decisions-consensus").removeAttr("disabled");
- $("#representatives-democratically").removeAttr("disabled");
- $("#meetings-transparent").removeAttr("disabled");
- $("#decisions-voting").removeAttr("disabled");
- $j("#mc-form-optional-grassroots").effect("shake", { times:1 }, 200);
+ else if (e.key=='#third_step'){
+ $j('#progress_text').html('40% Complete');
+ $j('#progress').css('width','136px');
+ if($j('#rp-checkbox').val()=='S')
+ $j('label[for*="step3-yes"]').addClass('ui-state-active');
+ else if ($j('#rp-checkbox').val()=='N')
+ $j('label[for*="step3-no"]').addClass('ui-state-active');
+ }
+ else if (e.key=='#fourth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ if($j('#rc-checkbox').val()=='S')
+ $j('label[for*="step4-yes"]').addClass('ui-state-active');
+ else if ($j('#rc-checkbox').val()=='N')
+ $j('label[for*="step4-no"]').addClass('ui-state-active');
}
- if(id=='rc')
- $j("#mc-form-optional-reinforcing").effect("shake", { times:1 }, 200);
- }
- else{
- $j('#'+id+'-checkbox').val('N');
- $j("#mc-form-" + id).removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ id).slideUp();
- if(id=='np'){
- $("#registered-non-profit").attr("disabled", "disabled");
- $('#registered-non-profit').attr('checked', false);
- $("#open-accounting").attr("disabled", "disabled");
- $('#open-accounting').attr('checked', false);
- $("#accept-donations").attr("disabled", "disabled");
- $('#accept-donations').attr('checked', false);
- $j('#non-profit-website').hide();
- $j('#infield-non-profit-website').hide();
- $j('#open-accounting-website').hide();
- $j('#infield-open-accounting-website').hide();
- $j('#donation-website').hide();
- $j('#infield-donation-website').hide();
- $j('#submit_second').click();
+ else if (e.key=='#fifth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ if($j('#gr-checkbox').val()=='S')
+ $j('label[for*="step5-yes"]').addClass('ui-state-active');
+ else if ($j('#gr-checkbox').val()=='N')
+ $j('label[for*="step5-no"]').addClass('ui-state-active');
}
- if(id=='rp'){
- $("#terms-of-use").attr("disabled", "disabled");
- $('#terms-of-use').attr('checked', false);
- $("#creative-commons").attr("disabled", "disabled");
- $('#creative-commons').attr('checked', false);
- $("#other-license").attr("disabled", "disabled");
- $('#other-license').attr('checked', false);
- $("#organization-structure").attr("disabled", "disabled");
- $('#organization-structure').attr('checked', false);
- $("#projects-and-results").attr("disabled", "disabled");
- $('#projects-and-results').attr('checked', false);
- $("#methods-procedures").attr("disabled", "disabled");
- $('#methods-procedures').attr('checked', false);
- $("#documentation").attr("disabled", "disabled");
- $('#documentation').attr('checked', false);
- $j('#terms-of-use-website').hide();
- $j('#infield-terms-of-use-website').hide();
- $j('#creative-commons-website').hide();
- $j('#infield-creative-commons-website').hide();
- $j('#other-license-website').hide();
- $j('#infield-other-license-website').hide();
- $j('#submit_third').click();
- }
- if(id=='rc'){
- reset_areas();
- $j('#submit_fourth').click();
- }
- if(id=='gr'){
- $("#decisions-general-assemblies").attr("disabled", "disabled");
- $('#decisions-general-assemblies').attr('checked', false);
- $("#decisions-consensus").attr("disabled", "disabled");
- $('#decisions-consensus').attr('checked', false);
- $("#representatives-democratically").attr("disabled", "disabled");
- $('#representatives-democratically').attr('checked', false);
- $("#meetings-transparent").attr("disabled", "disabled");
- $('#meetings-transparent').attr('checked', false);
- $("#decisions-voting").attr("disabled", "disabled");
- $('#decisions-voting').attr('checked', false);
- $j('#submit_fifth').click();
- }
-
+ else if (e.key=='#sixth_step'){
+ $j('#progress_text').html('100% Complete');
+ $j('#progress').css('width','339px');
+ }
+ $j(current_step).slideUp();
+ $j(e.key).slideDown();
}
-}
-
-function imageMapInit(){
- $j('.map').mapster({
- fillColor: 'EA8F5F',
- fillOpacity: 0.8,
- isSelectable: false,
- mapKey: 'step',
- onClick: function (e) {
- onClickImageMap(e);
- }
- });
-}
-
-function imageMapUnBind(){
- $j('.map').mapster('unbind');
- $j('#firstStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 19px;margin-top: 0"><div class="marker"></div>');
- $j('#secondStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 111px;margin-top: 0"><div class="marker"></div>');
- $j('#thirdStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 203px;margin-top: 0"><div class="marker"></div>');
- $j('#fourthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 295px;margin-top: 0"><div class="marker"></div>');
- $j('#fifthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 386px;margin-top: 0"><div class="marker"></div>');
- $j('#sixthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 478px;margin-top: 0"><div class="marker"></div>');
-}
-
-function onClickImageMap(e){
- if (e.key=='#first_step'){
- $j('#progress_text').html('0% Complete');
- $j('#progress').css('width','0');
- }
- else if (e.key=='#second_step'){
- $j('#progress_text').html('20% Complete');
- $j('#progress').css('width','68px');
- if($j('#np-checkbox').val()=='S')
- $j('label[for*="step2-yes"]').addClass('ui-state-active');
- else if ($j('#np-checkbox').val()=='N')
- $j('label[for*="step2-no"]').addClass('ui-state-active');
- }
- else if (e.key=='#third_step'){
- $j('#progress_text').html('40% Complete');
- $j('#progress').css('width','136px');
- if($j('#rp-checkbox').val()=='S')
- $j('label[for*="step3-yes"]').addClass('ui-state-active');
- else if ($j('#rp-checkbox').val()=='N')
- $j('label[for*="step3-no"]').addClass('ui-state-active');
- }
- else if (e.key=='#fourth_step'){
- $j('#progress_text').html('60% Complete');
- $j('#progress').css('width','204px');
- if($j('#rc-checkbox').val()=='S')
- $j('label[for*="step4-yes"]').addClass('ui-state-active');
- else if ($j('#rc-checkbox').val()=='N')
- $j('label[for*="step4-no"]').addClass('ui-state-active');
- }
- else if (e.key=='#fifth_step'){
- $j('#progress_text').html('60% Complete');
- $j('#progress').css('width','204px');
- if($j('#gr-checkbox').val()=='S')
- $j('label[for*="step5-yes"]').addClass('ui-state-active');
- else if ($j('#gr-checkbox').val()=='N')
- $j('label[for*="step5-no"]').addClass('ui-state-active');
- }
- else if (e.key=='#sixth_step'){
- $j('#progress_text').html('100% Complete');
- $j('#progress').css('width','339px');
- }
- $j(current_step).slideUp();
- $j(e.key).slideDown();
-}
-
-function select_cat($id, $id2) {
- var cat_id = "#mc-form-" + $id;
- $j(cat_id + ",#mc-form-icon-" + $id).click(
- function ()
- {/*
- // if ($id != "rc") {
- $j(cat_id).addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ $id).slideDown();
- //}
- $j("#mc-form-" + $id2).removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ $id2).slideUp();
- // $j("#mc-form-more-link-" + $id2).show('slow');
- $j("#mc-form-less-link-" + $id2).hide();
- // $j("#mc-form-" + $id).removeAttr("title");
- // $j("#mc-form-" + $id2).attr("title", click_to_select);
- $j("#mc-form-more-text-" + $id2).slideUp(function() {adjustHeights();});*/
- if (cat_id == "#mc-form-rc") {
- //$j("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
- mc_rc="0";
- update_logo($id);
- //$j('div.blockMe3').unblock();
- //$('#mc-form-optional-reinforcing').show();
- } else if (cat_id == "#mc-form-nrc") {
- //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
- reset_areas();
- update_logo($id);
- } else if (cat_id == "#mc-form-np") {
- //$j('div.blockMe1').unblock();
- //$('#mc-form-optional-non-profit').show();
- } else if (cat_id == "#mc-form-rp") {
- //$j('div.blockMe2').unblock();
- //$('#mc-form-optional-reproducible').show();
- } else if (cat_id == "#mc-form-gr") {
- //$j('div.blockMe4').unblock();
- //$('#mc-form-optional-grassroots').show();
- } else {
- update_logo($id);
- //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
- }
- });
-};
-
-function hover_cat($id) {
- var cat_id = "#mc-form-" + $id;
- $j(cat_id + ",#mc-form-icon-" + $id).hover(
- function ()
- {
- $j(cat_id).addClass("mc-form-descbox-high");
- //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
- // $j("#mc-form-more-link-"+$id).show();
- }, function () {
- $j(cat_id).removeClass("mc-form-descbox-high");
- //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
- // $j("#mc-form-more-link-"+$id).hide();
- });
-};
-
-// More links
-
-function click_more_link($id) {
- $j("#mc-form-more-link-" + $id).click(
- function (event) {
- event.stopPropagation();
- $j(this).hide();
- /*if ($id == "rc") {
- $j("#mc-cat-rc-options").slideDown();
- }*/
- $j("#mc-form-less-link-" + $id).show('slow');
- $j("#mc-form-more-text-" + $id).show('slow',function() {adjustHeights();});
-
- });
-};
-
-function click_less_link($id) {
- $j("#mc-form-less-link-" + $id).click(
- function (event) {
- event.stopPropagation();
- $j(this).hide();
- /*if ($id == "rc") {
- $j("#mc-cat-rc-options").slideUp();
- }*/
- $j("#mc-form-more-link-" + $id).show('slow');
- $j("#mc-form-more-text-" + $id).slideUp(function() {adjustHeights();});
- //if ($id == "rc") { $j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});}
- });
-};
-
-function hover_more_link($id) {
- $j("#mc-form-more-link-" + $id).hover(
- function () {
- $j(this).addClass("mc-form-link-high");
- }, function () {
- $j(this).removeClass("mc-form-link-high");
- });
-};
-
-function hover_less_link($id) {
- $j("#mc-form-less-link-" + $id).hover(
- function () {
- $j(this).addClass("mc-form-link-high");
- }, function () {
- $j(this).removeClass("mc-form-link-high");
- });
-};
-
-function hide_initial($id) {
- $j("#mc-form-more-link-" + $id).hide();
- //$j("#mc-form-more-text-" + $id).hide();
- $j("#mc-form-less-link-" + $id).hide();
-};
-
-function dclick_toggle($id) {
- $j("#mc-form-" + $id).dblclick(
- function () {
- var id_text = "#mc-form-more-text-" + $id;
- var id_link = "#mc-form-more-link-" + $id;
- if ($j(id_text).is(':visible')) { $j(id_text).slideUp(); $j(id_link).slideDown(); }
- else { $j(id_text).slideDown(); $j(id_link).slideUp(); };
- });};
-
-function reset_areas() {
- mc_rc="0";
- $j("#mc-cat-rc-option-box-ec").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-bo").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-to").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-di").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc60.png"});
- $j("#mc-cat-selected-rc").slideUp();
-}
-
-function select_area($id) {
- var cat_id = "#mc-cat-rc-option-box-" + $id;
- $j(cat_id + ",#mc-cat-rc-option-icon-" + $id).click(
- function (event) {
- if($j('#rc-checkbox').val()=='N')
- return;
- event.stopPropagation();
- reset_areas();
- $j("#mc-form-rc").addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-rc").slideDown();
- $j(cat_id).addClass("mc-cat-rc-option-box-selected");
- $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc" + $id + "60.png"});
- update_logo($id);
- });
-};
-
-// Inspired in:
-// http://stackoverflow.com/questions/803688/how-do-i-keep-multiple-divs-the-same-height-using-jquery
-
-function adjustPairHeights($id1, $id2) {
- var maxHeight = 0;
- var idcat1 = "#mc-form-category-group-" + $id1;
- var idcat2 = "#mc-form-category-group-" + $id2;
- var ids = idcat1 + "," + idcat2;
- $j(ids).each(function(){
- $j(this).height('auto');
- if (maxHeight < $j(this).height()) {maxHeight = $j(this).height();}
- });
- if($j(idcat1).height() < maxHeight) { $j(idcat1).height(maxHeight); };
- if($j(idcat2).height() < maxHeight) { $j(idcat2).height(maxHeight); };
-}
-
-function adjustHeights() {
- adjustPairHeights("aa", "ab");
- adjustPairHeights("bb", "ba");
-}
-
-function update_logo($cat) {
- if ($cat == "np" ) mc_np="np-";
- if ($cat == "nnp") mc_np="fp-";
- if ($cat == "rp" ) mc_rp="rp-";
- if ($cat == "nrp") mc_rp="ex-";
- if ($cat == "gr" ) mc_gr="gr-";
- if ($cat == "ngr") mc_gr="rs-";
- if ($cat == "ec" || $cat == "bo" ||
- $cat == "to" || $cat == "di") mc_rc="rc." + $cat + "-";
- if ($cat == "nrc") mc_rc="ro-";
-
- mc_category = "";
- var icon_url = "";
-
- if (mc_np != "0" && mc_rp != "0" && mc_rc != "0" && mc_gr != "0") {
- if (mc_np!="") { mc_category += mc_np; }
- if (mc_rp!="") { mc_category += mc_rp; }
- if (mc_rc!="") { mc_category += mc_rc; }
- if (mc_gr!="") { mc_category += mc_gr; }
- // /lang/mc-0-1-np-rp-sc-dc/
- mc_category = mc_category.replace(/-$/, "");
- icon_url = "/mc/0.1/images/" + mc_category + "-120x90-0.1.png";
- }
- if (icon_url != "") {
- $j("#mc-form-icon-result").attr({src : icon_url});
- $j("#mc-form-icon-result").show('fast');
- } else {
- $j("#mc-form-icon-result").hide();
- }
- checkIfFormReady();
-}
-
-function checkIfFormReady() {
- urlIni = $j('#url').val();
- nameIni = $j('#ininame').val();
- keywordsIni = $j('#keywords').val();
- if (mc_category != "" && nameIni.length > 0 && urlIni.length > 0) {
- $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-enabled");
- $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-disabled");
- $j("#mc-dia-continue-btn").effect("highlight", {}, 2000);
- } else {
- $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
- $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-enabled");
- }
-}
-
-function confInputValidation($id) {
- $j($id).bind("change keyup", function(event) {
- checkIfFormReady();
- });
-}
-
-// adapted from:
-// http://stackoverflow.com/questions/1277070/is-there-an-equivalent-javascript-or-jquery-sleep-function
-function doadjustwithsleep( part ) {
- if( part == 0 ) {
- setTimeout( function() { doadjustwithsleep( 1 ); }, 1000 );
- } else if( part == 1 ) {
- adjustHeights();
- }
-}
-
-function conf_link($id) {
- var nid = "n" + $id;
- select_cat($id, nid);
- select_cat(nid, $id);
-};
-
-function conf_click_continue() {
- $j("#mc-dia-continue-btn").click(
- function (event) {
- event.stopPropagation();
- if (mc_category != "" && urlIni.length > 0 && nameIni.length > 0) {
- var currentUrl = window.location.pathname.split('/');
- var langCode = "";
- if (currentUrl[1] == 'preview') { langCode = 'en'; }
- else { langCode = currentUrl[1]; };
- window.location.href="/" + langCode + "/" + mc_category + "-html/0.1/?ini_name=" + nameIni +
- "&ini_url=" + urlIni + "&ini_keywords=" + keywordsIni;
- }
- });
-};
-
-
-// http://www.richreuter.com/2008/08/01/UsingJQueryToResizeTextBoxesToMaxLength.aspx
-function max_textsize() {
- $j('input[type=text]').each(function() {
- var max_length = $j(this).attr('maxlength');
- var multiplier = (max_length > 10) ? 7.3 : 8;
- var w = (max_length * multiplier) + "px";
- $j(this).width(w);
-});
-
-}
-
-// http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-and-pluck/#labelOver
-$.fn.labelOver = function(overClass) {
- return this.each(function()
- {
- var label = $j(this);
- var f = label.attr('for');
- if (f) {
- var input = $j('#' + f);
-
- this.hide = function() {
- label.css({ textIndent: -10000 });
+
+ function select_cat($id, $id2) {
+ var cat_id = "#mc-form-" + $id;
+ $j(cat_id + ",#mc-form-icon-" + $id).click(
+ function ()
+ {/*
+ // if ($id != "rc") {
+ $j(cat_id).addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ $id).slideDown();
+ //}
+ $j("#mc-form-" + $id2).removeClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ $id2).slideUp();
+ // $j("#mc-form-more-link-" + $id2).show('slow');
+ $j("#mc-form-less-link-" + $id2).hide();
+ // $j("#mc-form-" + $id).removeAttr("title");
+ // $j("#mc-form-" + $id2).attr("title", click_to_select);
+ $j("#mc-form-more-text-" + $id2).slideUp(function() {adjustHeights();});*/
+ if (cat_id == "#mc-form-rc") {
+ //$j("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
+ mc_rc="0";
+ update_logo($id);
+ //$j('div.blockMe3').unblock();
+ //$('#mc-form-optional-reinforcing').show();
+ } else if (cat_id == "#mc-form-nrc") {
+ //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+ reset_areas();
+ update_logo($id);
+ } else if (cat_id == "#mc-form-np") {
+ //$j('div.blockMe1').unblock();
+ //$('#mc-form-optional-non-profit').show();
+ } else if (cat_id == "#mc-form-rp") {
+ //$j('div.blockMe2').unblock();
+ //$('#mc-form-optional-reproducible').show();
+ } else if (cat_id == "#mc-form-gr") {
+ //$j('div.blockMe4').unblock();
+ //$('#mc-form-optional-grassroots').show();
+ } else {
+ update_logo($id);
+ //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+ }
+ });
};
-
- this.show = function() {
- if (input.val() == '') label.css({ textIndent: 0 });
+
+ function hover_cat($id) {
+ var cat_id = "#mc-form-" + $id;
+ $j(cat_id + ",#mc-form-icon-" + $id).hover(
+ function ()
+ {
+ $j(cat_id).addClass("mc-form-descbox-high");
+ //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
+ // $j("#mc-form-more-link-"+$id).show();
+ }, function () {
+ $j(cat_id).removeClass("mc-form-descbox-high");
+ //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
+ // $j("#mc-form-more-link-"+$id).hide();
+ });
};
-
- // handlers
- input.focus(this.hide);
- input.blur(this.show);
- label.addClass(overClass).click(function(){ input.focus(); });
-
- if (input.val() != '') this.hide();
- }
- });
- };
-
-
- $j('#submit_first').click(function(){
- //remove classes
- $j('#first_step input').removeClass('error').removeClass('valid');
-
- //ckeck if inputs aren't empty
- var fields = $j('#first_step input[type=text], #first_step input[type=password]');
- var error = 0;
- fields.each(function(){
- var value = $j.trim($j(this).val());
- if( value=="" || value==field_values[$j(this).attr('id')] ) {
- $j(this).addClass('error');
- $j(this).effect("shake", { times:3 }, 50);
- error++;
- } else {
- /*if($j(this).attr('id')=='url'){
- if(!(/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value))){
- $j(this).addClass('error');
- $j(this).effect("shake", { times:3 }, 50);
- error++;
- }
- }
- else*/
- $j(this).addClass('valid');
- }
- });
-
- if(!error) {
-
- current_step='#second_step';
-
- if(!step_two_reached){
- $j('#step1_image_map').append('<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->');
- imageMapUnBind();
- imageMapInit();
- step_two_reached=true;
- }
-
- //update progress bar
- $j('#progress_text').html('20% Complete');
- $j('#progress').css('width','68px');
-
- //slide steps
- $j('#first_step').slideUp();
- $j('#second_step').slideDown();
-
- if($j('#np-checkbox').val()=='S')
- $j('label[for*="step2-yes"]').addClass('ui-state-active');
- else if ($j('#np-checkbox').val()=='N')
- $j('label[for*="step2-no"]').addClass('ui-state-active');
- } else return false;
-});
-
-$j('#p_submit_second').click(function(){
- current_step='#first_step';
-
- //update progress bar
- $j('#progress').css('width','0');
- $j('#progress_text').html('0% Complete');
-
- //slide steps
- $j('#second_step').slideUp();
- $j('#first_step').slideDown();
-});
-
-
-$j('#submit_second').click(function(){
+ // More links
- var error=false;
+ function click_more_link($id) {
+ $j("#mc-form-more-link-" + $id).click(
+ function (event) {
+ event.stopPropagation();
+ $j(this).hide();
+ /*if ($id == "rc") {
+ $j("#mc-cat-rc-options").slideDown();
+ }*/
+ $j("#mc-form-less-link-" + $id).show('slow');
+ $j("#mc-form-more-text-" + $id).show('slow',function() {adjustHeights();});
- if($j('#np-checkbox').val()=='A'){
- $j('#step2question').effect("shake", { times:3 }, 50);
- return;
- }
+ });
+ };
- if($j("#registered-non-profit").attr("checked"))
- if($j.trim($j('#non-profit-website').val())==""){
- $j('#non-profit-website').addClass('error');
- $j('#non-profit-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#non-profit-website').addClass('valid');
+ function click_less_link($id) {
+ $j("#mc-form-less-link-" + $id).click(
+ function (event) {
+ event.stopPropagation();
+ $j(this).hide();
+ /*if ($id == "rc") {
+ $j("#mc-cat-rc-options").slideUp();
+ }*/
+ $j("#mc-form-more-link-" + $id).show('slow');
+ $j("#mc-form-more-text-" + $id).slideUp(function() {adjustHeights();});
+ //if ($id == "rc") { $j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});}
+ });
+ };
- if($j("#open-accounting").attr("checked"))
- if($j.trim($j('#open-accounting-website').val())==""){
- $j('#open-accounting-website').addClass('error');
- $j('#open-accounting-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#open-accounting-website').addClass('valid');
+ function hover_more_link($id) {
+ $j("#mc-form-more-link-" + $id).hover(
+ function () {
+ $j(this).addClass("mc-form-link-high");
+ }, function () {
+ $j(this).removeClass("mc-form-link-high");
+ });
+ };
- if($j("#accept-donations").attr("checked"))
- if($j.trim($j('#donation-website').val())==""){
- $j('#donation-website').addClass('error');
- $j('#donation-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#accept-donations').addClass('valid');
+ function hover_less_link($id) {
+ $j("#mc-form-less-link-" + $id).hover(
+ function () {
+ $j(this).addClass("mc-form-link-high");
+ }, function () {
+ $j(this).removeClass("mc-form-link-high");
+ });
+ };
- if(error)
- return;
+ function hide_initial($id) {
+ $j("#mc-form-more-link-" + $id).hide();
+ //$j("#mc-form-more-text-" + $id).hide();
+ $j("#mc-form-less-link-" + $id).hide();
+ };
- current_step='#third_step';
-
- if(!step_three_reached){
- $j('#step1_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
- $j('#step2_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
- imageMapUnBind();
- imageMapInit();
- step_three_reached=true;
+ function dclick_toggle($id) {
+ $j("#mc-form-" + $id).dblclick(
+ function () {
+ var id_text = "#mc-form-more-text-" + $id;
+ var id_link = "#mc-form-more-link-" + $id;
+ if ($j(id_text).is(':visible')) { $j(id_text).slideUp(); $j(id_link).slideDown(); }
+ else { $j(id_text).slideDown(); $j(id_link).slideUp(); };
+ });};
+
+ function reset_areas() {
+ mc_rc="0";
+ $j("#mc-cat-rc-option-box-ec").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-bo").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-to").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-di").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc60.png"});
+ $j("#mc-cat-selected-rc").slideUp();
}
-
- //update progress bar
- $j('#progress_text').html('40% Complete');
- $j('#progress').css('width','136px');
-
- if($j('#rp-checkbox').val()=='S')
- $j('label[for*="step3-yes"]').addClass('ui-state-active');
- else if ($j('#rp-checkbox').val()=='N')
- $j('label[for*="step3-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#second_step').slideUp();
- $j('#third_step').slideDown();
-
-});
-
-$j('#p_submit_third').click(function(){
- current_step='#second_step';
+ function select_area($id) {
+ var cat_id = "#mc-cat-rc-option-box-" + $id;
+ $j(cat_id + ",#mc-cat-rc-option-icon-" + $id).click(
+ function (event) {
+ if($j('#rc-checkbox').val()=='N')
+ return;
+ event.stopPropagation();
+ reset_areas();
+ $j("#mc-form-rc").addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-rc").slideDown();
+ $j(cat_id).addClass("mc-cat-rc-option-box-selected");
+ $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc" + $id + "60.png"});
+ update_logo($id);
+ });
+ };
- //update progress bar
- $j('#progress_text').html('20% Complete');
- $j('#progress').css('width','68px');
-
- if($j('#np-checkbox').val()=='S')
- $j('label[for*="step2-yes"]').addClass('ui-state-active');
- else if ($j('#np-checkbox').val()=='N')
- $j('label[for*="step2-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#third_step').slideUp();
- $j('#second_step').slideDown();
-});
-
-
-$j('#submit_third').click(function(){
+ // Inspired in:
+ // http://stackoverflow.com/questions/803688/how-do-i-keep-multiple-divs-the-same-height-using-jquery
- var error=false;
+ function adjustPairHeights($id1, $id2) {
+ var maxHeight = 0;
+ var idcat1 = "#mc-form-category-group-" + $id1;
+ var idcat2 = "#mc-form-category-group-" + $id2;
+ var ids = idcat1 + "," + idcat2;
+ $j(ids).each(function(){
+ $j(this).height('auto');
+ if (maxHeight < $j(this).height()) {maxHeight = $j(this).height();}
+ });
+ if($j(idcat1).height() < maxHeight) { $j(idcat1).height(maxHeight); };
+ if($j(idcat2).height() < maxHeight) { $j(idcat2).height(maxHeight); };
+ }
- if($j('#rp-checkbox').val()=='A'){
- $j('#step3question').effect("shake", { times:3 }, 50);
- return;
+ function adjustHeights() {
+ adjustPairHeights("aa", "ab");
+ adjustPairHeights("bb", "ba");
}
- if($j("#terms-of-use").attr("checked"))
- if($j.trim($j('#terms-of-use-website').val())==""){
- $j('#terms-of-use-website').addClass('error');
- $j('#terms-of-use-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#terms-of-use-website').addClass('valid');
+ function update_logo($cat) {
+ if ($cat == "np" ) mc_np="np-";
+ if ($cat == "nnp") mc_np="fp-";
+ if ($cat == "rp" ) mc_rp="rp-";
+ if ($cat == "nrp") mc_rp="ex-";
+ if ($cat == "gr" ) mc_gr="gr-";
+ if ($cat == "ngr") mc_gr="rs-";
+ if ($cat == "ec" || $cat == "bo" ||
+ $cat == "to" || $cat == "di") mc_rc="rc." + $cat + "-";
+ if ($cat == "nrc") mc_rc="ro-";
- if($j("#creative-commons").attr("checked"))
- if($j.trim($j('#creative-commons-website').val())==""){
- $j('#creative-commons-website').addClass('error');
- $j('#creative-commons-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#creative-commons-website').addClass('valid');
+ mc_category = "";
+ var icon_url = "";
- if($j("#other-license").attr("checked"))
- if($j.trim($j('#other-license-website').val())==""){
- $j('#other-license-website').addClass('error');
- $j('#other-license-website').effect("shake", { times:3 }, 50);
- error=true;
- }
- else
- $j('#other-license-website').addClass('valid');
+ if (mc_np != "0" && mc_rp != "0" && mc_rc != "0" && mc_gr != "0") {
+ if (mc_np!="") { mc_category += mc_np; }
+ if (mc_rp!="") { mc_category += mc_rp; }
+ if (mc_rc!="") { mc_category += mc_rc; }
+ if (mc_gr!="") { mc_category += mc_gr; }
+ // /lang/mc-0-1-np-rp-sc-dc/
+ mc_category = mc_category.replace(/-$/, "");
+ icon_url = "/mc/0.1/images/" + mc_category + "-120x90-0.1.png";
+ }
+ if (icon_url != "") {
+ $j("#mc-form-icon-result").attr({src : icon_url});
+ $j("#mc-form-icon-result").show('fast');
+ } else {
+ $j("#mc-form-icon-result").hide();
+ }
+ checkIfFormReady();
+ }
- if(error)
- return;
+ function checkIfFormReady() {
+ urlIni = $j('#url').val();
+ nameIni = $j('#ininame').val();
+ keywordsIni = $j('#keywords').val();
+ if (mc_category != "" && nameIni.length > 0 && urlIni.length > 0) {
+ $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-enabled");
+ $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-disabled");
+ $j("#mc-dia-continue-btn").effect("highlight", {}, 2000);
+ } else {
+ $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
+ $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-enabled");
+ }
+ }
- current_step='#fourth_step';
+ function confInputValidation($id) {
+ $j($id).bind("change keyup", function(event) {
+ checkIfFormReady();
+ });
+ }
- if(!step_four_reached){
- $j('#step1_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
- $j('#step2_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
- $j('#step3_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
- imageMapUnBind();
- imageMapInit();
- step_four_reached=true;
+ // adapted from:
+ // http://stackoverflow.com/questions/1277070/is-there-an-equivalent-javascript-or-jquery-sleep-function
+ function doadjustwithsleep( part ) {
+ if( part == 0 ) {
+ setTimeout( function() { doadjustwithsleep( 1 ); }, 1000 );
+ } else if( part == 1 ) {
+ adjustHeights();
+ }
}
- //update progress bar
- $j('#progress_text').html('60% Complete');
- $j('#progress').css('width','204px');
-
- if($j('#rc-checkbox').val()=='S')
- $j('label[for*="step4-yes"]').addClass('ui-state-active');
- else if ($j('#rc-checkbox').val()=='N')
- $j('label[for*="step4-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#third_step').slideUp();
- $j('#fourth_step').slideDown();
-});
-
-$j('#p_submit_fourth').click(function(){
+ function conf_link($id) {
+ var nid = "n" + $id;
+ select_cat($id, nid);
+ select_cat(nid, $id);
+ };
- current_step='#third_step';
+ function conf_click_continue() {
+ $j("#mc-dia-continue-btn").click(
+ function (event) {
+ event.stopPropagation();
+ if (mc_category != "" && urlIni.length > 0 && nameIni.length > 0) {
+ var currentUrl = window.location.pathname.split('/');
+ var langCode = "";
+ if (currentUrl[1] == 'preview') { langCode = 'en'; }
+ else { langCode = currentUrl[1]; };
+ window.location.href="/" + langCode + "/" + mc_category + "-html/0.1/?ini_name=" + nameIni +
+ "&ini_url=" + urlIni + "&ini_keywords=" + keywordsIni;
+ }
+ });
+ };
- //update progress bar
- $j('#progress_text').html('40% Complete');
- $j('#progress').css('width','136px');
-
- if($j('#rp-checkbox').val()=='S')
- $j('label[for*="step3-yes"]').addClass('ui-state-active');
- else if ($j('#rp-checkbox').val()=='N')
- $j('label[for*="step3-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#fourth_step').slideUp();
- $j('#third_step').slideDown();
-});
-
-$j('#submit_fourth').click(function(){
-
- if($j('#rc-checkbox').val()=='A'){
- $j('#step4question').effect("shake", { times:3 }, 50);
- return;
- }
-
- if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rc60.png' && $j('#rc-checkbox').val()=='S'){
- $j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50);
- return;
- }
+ // http://www.richreuter.com/2008/08/01/UsingJQueryToResizeTextBoxesToMaxLength.aspx
+ function max_textsize() {
+ $j('input[type=text]').each(function() {
+ var max_length = $j(this).attr('maxlength');
+ var multiplier = (max_length > 10) ? 7.3 : 8;
+ var w = (max_length * multiplier) + "px";
+ $j(this).width(w);
+ });
- current_step='#fifth_step';
-
- if(!step_five_reached){
- $j('#step1_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
- $j('#step2_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
- $j('#step3_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
- $j('#step4_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
- imageMapUnBind();
- imageMapInit();
- step_five_reached=true;
}
-
- //update progress bar
- $j('#progress_text').html('80% Complete');
- $j('#progress').css('width','272px');
-
- if($j('#gr-checkbox').val()=='S')
- $j('label[for*="step5-yes"]').addClass('ui-state-active');
- else if ($j('#gr-checkbox').val()=='N')
- $j('label[for*="step5-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#fourth_step').slideUp();
- $j('#fifth_step').slideDown();
-
-});
-
-$j('#p_submit_fifth').click(function(){
- current_step='#fourth_step';
+ // http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-and-pluck/#labelOver
+ $.fn.labelOver = function(overClass) {
+ return this.each(function()
+ {
+ var label = $j(this);
+ var f = label.attr('for');
+ if (f) {
+ var input = $j('#' + f);
- //update progress bar
- $j('#progress_text').html('60% Complete');
- $j('#progress').css('width','204px');
-
- if($j('#rc-checkbox').val()=='S')
- $j('label[for*="step4-yes"]').addClass('ui-state-active');
- else if ($j('#rc-checkbox').val()=='N')
- $j('label[for*="step4-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#fifth_step').slideUp();
- $j('#fourth_step').slideDown();
-});
-
-$j('#submit_fifth').click(function(){
-
- if($j('#gr-checkbox').val()=='A'){
- $j('#step5question').effect("shake", { times:3 }, 50);
- return;
- }
+ this.hide = function() {
+ label.css({ textIndent: -10000 });
+ };
- current_step='#sixth_step';
+ this.show = function() {
+ if (input.val() == '') label.css({ textIndent: 0 });
+ };
+
+ // handlers
+ input.focus(this.hide);
+ input.blur(this.show);
+ label.addClass(overClass).click(function(){ input.focus(); });
+
+ if (input.val() != '') this.hide();
+ }
+ });
+ };
+
+
+ $j('#submit_first').click(function(){
+ //remove classes
+ $j('#first_step input').removeClass('error').removeClass('valid');
+
+ //ckeck if inputs aren't empty
+ var fields = $j('#first_step input[type=text], #first_step input[type=password]');
+ var error = 0;
+ fields.each(function(){
+ var value = $j.trim($j(this).val());
+ if( value=="" || value==field_values[$j(this).attr('id')] ) {
+ $j(this).addClass('error');
+ $j(this).effect("shake", { times:3 }, 50);
+ error++;
+ } else {
+ /*if($j(this).attr('id')=='url'){
+ if(!(/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value))){
+ $j(this).addClass('error');
+ $j(this).effect("shake", { times:3 }, 50);
+ error++;
+ }
+ }
+ else*/
+ $j(this).addClass('valid');
+ }
+ });
+
+ if(!error) {
- if(!step_six_reached){
- $j('#step1_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
- $j('#step2_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
- $j('#step3_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
- $j('#step4_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
- $j('#step5_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
- imageMapUnBind();
- imageMapInit();
- step_six_reached=true;
- }
+ current_step='#second_step';
+
+ if(!step_two_reached){
+ $j('#step1_image_map').append('<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->');
+ imageMapUnBind();
+ imageMapInit();
+ step_two_reached=true;
+ }
+
+ //update progress bar
+ $j('#progress_text').html('20% Complete');
+ $j('#progress').css('width','68px');
+
+ //slide steps
+ $j('#first_step').slideUp();
+ $j('#second_step').slideDown();
+
+ if($j('#np-checkbox').val()=='S')
+ $j('label[for*="step2-yes"]').addClass('ui-state-active');
+ else if ($j('#np-checkbox').val()=='N')
+ $j('label[for*="step2-no"]').addClass('ui-state-active');
+ } else return false;
+ });
- $j('#progress_text').html('100% Complete');
- $j('#progress').css('width','339px');
+ $j('#p_submit_second').click(function(){
+
+ current_step='#first_step';
+
+ //update progress bar
+ $j('#progress').css('width','0');
+ $j('#progress_text').html('0% Complete');
+
+ //slide steps
+ $j('#second_step').slideUp();
+ $j('#first_step').slideDown();
+ });
- $j('#fifth_step').slideUp();
- $j('#sixth_step').slideDown();
-
-});
-
-$j('#p_submit_sixth').click(function(){
- current_step='#fifth_step';
+ $j('#submit_second').click(function(){
+
+ var error=false;
+
+ if($j('#np-checkbox').val()=='A'){
+ $j('#step2question').effect("shake", { times:3 }, 50);
+ return;
+ }
+
+ if($j("#registered-non-profit").attr("checked"))
+ if($j.trim($j('#non-profit-website').val())==""){
+ $j('#non-profit-website').addClass('error');
+ $j('#non-profit-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#non-profit-website').addClass('valid');
+
+ if($j("#open-accounting").attr("checked"))
+ if($j.trim($j('#open-accounting-website').val())==""){
+ $j('#open-accounting-website').addClass('error');
+ $j('#open-accounting-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#open-accounting-website').addClass('valid');
+
+ if($j("#accept-donations").attr("checked"))
+ if($j.trim($j('#donation-website').val())==""){
+ $j('#donation-website').addClass('error');
+ $j('#donation-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#accept-donations').addClass('valid');
+
+ if(error)
+ return;
+
+ current_step='#third_step';
+
+ if(!step_three_reached){
+ $j('#step1_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
+ $j('#step2_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
+ imageMapUnBind();
+ imageMapInit();
+ step_three_reached=true;
+ }
+
+ //update progress bar
+ $j('#progress_text').html('40% Complete');
+ $j('#progress').css('width','136px');
+
+ if($j('#rp-checkbox').val()=='S')
+ $j('label[for*="step3-yes"]').addClass('ui-state-active');
+ else if ($j('#rp-checkbox').val()=='N')
+ $j('label[for*="step3-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#second_step').slideUp();
+ $j('#third_step').slideDown();
- //update progress bar
- $j('#progress_text').html('80% Complete');
- $j('#progress').css('width','272px');
-
- if($j('#gr-checkbox').val()=='S')
- $j('label[for*="step5-yes"]').addClass('ui-state-active');
- else if ($j('#gr-checkbox').val()=='N')
- $j('label[for*="step5-no"]').addClass('ui-state-active');
-
- //slide steps
- $j('#sixth_step').slideUp();
- $j('#fifth_step').slideDown();
-});
+ });
+
+ $j('#p_submit_third').click(function(){
+
+ current_step='#second_step';
+
+ //update progress bar
+ $j('#progress_text').html('20% Complete');
+ $j('#progress').css('width','68px');
+
+ if($j('#np-checkbox').val()=='S')
+ $j('label[for*="step2-yes"]').addClass('ui-state-active');
+ else if ($j('#np-checkbox').val()=='N')
+ $j('label[for*="step2-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#third_step').slideUp();
+ $j('#second_step').slideDown();
+ });
+
+
+ $j('#submit_third').click(function(){
+
+ var error=false;
+
+ if($j('#rp-checkbox').val()=='A'){
+ $j('#step3question').effect("shake", { times:3 }, 50);
+ return;
+ }
+
+ if($j("#terms-of-use").attr("checked"))
+ if($j.trim($j('#terms-of-use-website').val())==""){
+ $j('#terms-of-use-website').addClass('error');
+ $j('#terms-of-use-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#terms-of-use-website').addClass('valid');
+
+ if($j("#creative-commons").attr("checked"))
+ if($j.trim($j('#creative-commons-website').val())==""){
+ $j('#creative-commons-website').addClass('error');
+ $j('#creative-commons-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#creative-commons-website').addClass('valid');
+
+ if($j("#other-license").attr("checked"))
+ if($j.trim($j('#other-license-website').val())==""){
+ $j('#other-license-website').addClass('error');
+ $j('#other-license-website').effect("shake", { times:3 }, 50);
+ error=true;
+ }
+ else
+ $j('#other-license-website').addClass('valid');
+
+ if(error)
+ return;
+
+ current_step='#fourth_step';
+
+ if(!step_four_reached){
+ $j('#step1_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+ $j('#step2_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+ $j('#step3_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+ imageMapUnBind();
+ imageMapInit();
+ step_four_reached=true;
+ }
+
+ //update progress bar
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+
+ if($j('#rc-checkbox').val()=='S')
+ $j('label[for*="step4-yes"]').addClass('ui-state-active');
+ else if ($j('#rc-checkbox').val()=='N')
+ $j('label[for*="step4-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#third_step').slideUp();
+ $j('#fourth_step').slideDown();
+ });
+
+ $j('#p_submit_fourth').click(function(){
+
+ current_step='#third_step';
+
+ //update progress bar
+ $j('#progress_text').html('40% Complete');
+ $j('#progress').css('width','136px');
+
+ if($j('#rp-checkbox').val()=='S')
+ $j('label[for*="step3-yes"]').addClass('ui-state-active');
+ else if ($j('#rp-checkbox').val()=='N')
+ $j('label[for*="step3-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#fourth_step').slideUp();
+ $j('#third_step').slideDown();
+ });
+
+ $j('#submit_fourth').click(function(){
+
+ if($j('#rc-checkbox').val()=='A'){
+ $j('#step4question').effect("shake", { times:3 }, 50);
+ return;
+ }
+
+
+ if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rc60.png' && $j('#rc-checkbox').val()=='S'){
+ $j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50);
+ return;
+ }
+
+ current_step='#fifth_step';
+
+ if(!step_five_reached){
+ $j('#step1_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+ $j('#step2_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+ $j('#step3_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+ $j('#step4_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+ imageMapUnBind();
+ imageMapInit();
+ step_five_reached=true;
+ }
+
+ //update progress bar
+ $j('#progress_text').html('80% Complete');
+ $j('#progress').css('width','272px');
+
+ if($j('#gr-checkbox').val()=='S')
+ $j('label[for*="step5-yes"]').addClass('ui-state-active');
+ else if ($j('#gr-checkbox').val()=='N')
+ $j('label[for*="step5-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#fourth_step').slideUp();
+ $j('#fifth_step').slideDown();
+
+ });
+
+ $j('#p_submit_fifth').click(function(){
+
+ current_step='#fourth_step';
+
+ //update progress bar
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+
+ if($j('#rc-checkbox').val()=='S')
+ $j('label[for*="step4-yes"]').addClass('ui-state-active');
+ else if ($j('#rc-checkbox').val()=='N')
+ $j('label[for*="step4-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#fifth_step').slideUp();
+ $j('#fourth_step').slideDown();
+ });
+
+ $j('#submit_fifth').click(function(){
+
+ if($j('#gr-checkbox').val()=='A'){
+ $j('#step5question').effect("shake", { times:3 }, 50);
+ return;
+ }
+
+ current_step='#sixth_step';
+
+ if(!step_six_reached){
+ $j('#step1_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+ $j('#step2_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+ $j('#step3_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+ $j('#step4_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+ $j('#step5_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+ imageMapUnBind();
+ imageMapInit();
+ step_six_reached=true;
+ }
+
+ $j('#progress_text').html('100% Complete');
+ $j('#progress').css('width','339px');
+
+ $j('#fifth_step').slideUp();
+ $j('#sixth_step').slideDown();
+
+ });
+
+ $j('#p_submit_sixth').click(function(){
+
+ current_step='#fifth_step';
+
+ //update progress bar
+ $j('#progress_text').html('80% Complete');
+ $j('#progress').css('width','272px');
+
+ if($j('#gr-checkbox').val()=='S')
+ $j('label[for*="step5-yes"]').addClass('ui-state-active');
+ else if ($j('#gr-checkbox').val()=='N')
+ $j('label[for*="step5-no"]').addClass('ui-state-active');
+
+ //slide steps
+ $j('#sixth_step').slideUp();
+ $j('#fifth_step').slideDown();
+ });
+
+ $j('#non-profit-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+ $j('#open-accounting-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+ $j('#donation-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+ $j('#terms-of-use-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+ $j('#creative-commons-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+ $j('#other-license-website').click(function(){
+ if($j(this).val()==''){
+ $j(this).val($j('#url').val());
+ $j(this).trigger('keydown');
+ }
+ });
+
+
+ $j("#registered-non-profit").click(function(){
+ if($j("#registered-non-profit").attr("checked")){
+ $j('#non-profit-website').show();
+ $j('#infield-non-profit-website').show();
+ }
+ else{
+ $j('#non-profit-website').hide();
+ $j('#infield-non-profit-website').hide();
+ }
+ });
+
+
+ $j("#open-accounting").click(function(){
+ if($j("#open-accounting").attr("checked")){
+ $j('#open-accounting-website').show();
+ $j('#infield-open-accounting-website').show();
+ }
+ else{
+ $j('#open-accounting-website').hide();
+ $j('#infield-open-accounting-website').hide();
+ }
+ });
+
+ $j("#accept-donations").click(function(){
+ if($j("#accept-donations").attr("checked")){
+ $j('#donation-website').show();
+ $j('#infield-donation-website').show();
+ }
+ else{
+ $j('#donation-website').hide();
+ $j('#infield-donation-website').hide();
+ }
+ });
+
+ $j("#terms-of-use").click(function(){
+ if($j("#terms-of-use").attr("checked")){
+ $j('#terms-of-use-website').show();
+ $j('#infield-terms-of-use-website').show();
+ }
+ else{
+ $j('#terms-of-use-website').hide();
+ $j('#infield-terms-of-use-website').hide();
+ }
+ });
+
+
+ $j("#creative-commons").click(function(){
+ if($j("#creative-commons").attr("checked")){
+ $j('#creative-commons-website').show();
+ $j('#infield-creative-commons-website').show();
+ }
+ else{
+ $j('#creative-commons-website').hide();
+ $j('#infield-creative-commons-website').hide();
+ }
+ });
+
+ $j("#other-license").click(function(){
+ if($j("#other-license").attr("checked")){
+ $j('#other-license-website').show();
+ $j('#infield-other-license-website').show();
+ }
+ else{
+ $j('#other-license-website').hide();
+ $j('#infield-other-license-website').hide();
+ }
+ });
+
+ $j("#step2-yes").click(function(){clickCheckBox('np','yes');});
+ $j("#step2-no").click(function(){clickCheckBox('np','no');});
+
+ $j("#step3-yes").click(function(){clickCheckBox('rp','yes');});
+ $j("#step3-no").click(function(){clickCheckBox('rp','no');});
+
+ $j("#step4-yes").click(function(){clickCheckBox('rc','yes');});
+ $j("#step4-no").click(function(){clickCheckBox('rc','no');});
+
+ $j("#step5-yes").click(function(){clickCheckBox('gr','yes');});
+ $j("#step5-no").click(function(){clickCheckBox('gr','no');});
+
+ select_area("ec");
+ select_area("bo");
+ select_area("to");
+ select_area("di");
+ conf_click_continue();
+ $j(window).load(function () { doadjustwithsleep(0); });
+ $j('input#ininame').inputfocus({ value: field_values['ininame'] });
+ $j('input#url').inputfocus({ value: field_values['url'] });
+ $j('input#languages').inputfocus({ value: field_values['languages'] });
+ $j('input#keywords').inputfocus({ value: field_values['keywords'] });
+ $j('input#location').inputfocus({ value: field_values['location'] });
+ //$('input#email').inputfocus({ value: field_values['email'] });
+});
-$j('#non-profit-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-$j('#open-accounting-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-$j('#donation-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-$j('#terms-of-use-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-$j('#creative-commons-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-$j('#other-license-website').click(function(){
- if($j(this).val()==''){
- $j(this).val($j('#url').val());
- $j(this).trigger('keydown');
- }
-});
-
-
-$j("#registered-non-profit").click(function(){
- if($j("#registered-non-profit").attr("checked")){
- $j('#non-profit-website').show();
- $j('#infield-non-profit-website').show();
- }
- else{
- $j('#non-profit-website').hide();
- $j('#infield-non-profit-website').hide();
- }
-});
-
-
-$j("#open-accounting").click(function(){
- if($j("#open-accounting").attr("checked")){
- $j('#open-accounting-website').show();
- $j('#infield-open-accounting-website').show();
- }
- else{
- $j('#open-accounting-website').hide();
- $j('#infield-open-accounting-website').hide();
- }
-});
-
-$j("#accept-donations").click(function(){
- if($j("#accept-donations").attr("checked")){
- $j('#donation-website').show();
- $j('#infield-donation-website').show();
- }
- else{
- $j('#donation-website').hide();
- $j('#infield-donation-website').hide();
- }
-});
-
-$j("#terms-of-use").click(function(){
- if($j("#terms-of-use").attr("checked")){
- $j('#terms-of-use-website').show();
- $j('#infield-terms-of-use-website').show();
- }
- else{
- $j('#terms-of-use-website').hide();
- $j('#infield-terms-of-use-website').hide();
- }
-});
-
-
-$j("#creative-commons").click(function(){
- if($j("#creative-commons").attr("checked")){
- $j('#creative-commons-website').show();
- $j('#infield-creative-commons-website').show();
- }
- else{
- $j('#creative-commons-website').hide();
- $j('#infield-creative-commons-website').hide();
- }
-});
-
-$j("#other-license").click(function(){
- if($j("#other-license").attr("checked")){
- $j('#other-license-website').show();
- $j('#infield-other-license-website').show();
- }
- else{
- $j('#other-license-website').hide();
- $j('#infield-other-license-website').hide();
- }
-});
-
-$j("#step2-yes").click(function(){clickCheckBox('np','yes');}
-$j("#step2-no").click(function(){clickCheckBox('np','no');}
-
-$j("#step3-yes").click(function(){clickCheckBox('rp','yes');}
-$j("#step3-no").click(function(){clickCheckBox('rp','no');}
-
-$j("#step4-yes").click(function(){clickCheckBox('rc','yes');}
-$j("#step4-no").click(function(){clickCheckBox('rc','no');}
-
-$j("#step5-yes").click(function(){clickCheckBox('gr','yes');}
-$j("#step5-no").click(function(){clickCheckBox('gr','no');}
-
-select_area("ec");
-select_area("bo");
-select_area("to");
-select_area("di");
-conf_click_continue();
-$j(window).load(function () { doadjustwithsleep(0); });
-$j('input#ininame').inputfocus({ value: field_values['ininame'] });
-$j('input#url').inputfocus({ value: field_values['url'] });
-$j('input#languages').inputfocus({ value: field_values['languages'] });
-$j('input#keywords').inputfocus({ value: field_values['keywords'] });
-$j('input#location').inputfocus({ value: field_values['location'] });
-//$('input#email').inputfocus({ value: field_values['email'] });
-
-
-
-
-
More information about the Movecommons-commits
mailing list