/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* CRDB Link Maker */ /* --------------- */ /* */ /* Description: This file will create an easy species-link to a specific species listed */ /* in the CRDB. */ /* */ /* Requirement: The internet page where the link is placed needs to have the genus and */ /* species name in the filename and has to be separated by a character. */ /* */ /* Installation: 1. Place this file crdb.js in the same directory. */ /* */ /* 2. Place the following line in the html-page before the
Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

tag: */ /* */ /* */ /* 3. Add the following code in the page where the link needs to appear: */ /* */ /* */ /* */ /* */ /* */ /* */ /* Adjust the above code as follows: */ /* if the plant is a 'Palm' and you want results in Farenheit: crdb_link('Palm','F'); */ /* if the plant is a 'Cycad' and you want results in Celsius: crdb_link('Cycad','C'); */ /* for a tropical plant use: crdb_link('Tropical','F'); */ /* */ /* 4. Download the CRDB.gif picture from http://CRDB.net */ /* and place it preferrably in the same directory. */ /* */ /* 5. Review and adjust the following info if needed: */ /* */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. a) Filename ends in */ var filn_split = '.htm'; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. b) Genus name, species and variety names are separated with */ /* the following character or string: */ var gen_spe_split = '_'; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. c) Directories are separated by the following character: */ /* use / for internet or use \\ for a single back-slash! */ var dir_split = '/'; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. d) CRDB is located at: */ var crdb_path = 'http://www.CRDB.net/cgi-bin/crdb/crdbstat.cgi'; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. e) CRDB Logo Picture: */ /* */ /* - Path and filename of picture: */ var crdb_pic_path = 'crdb.gif'; /* */ /* - Width of picture in pixels (max. 228): */ var crdb_pic_width= 228; /* */ /* - Height of picture in pixels (max: 48): */ var crdb_pic_height= 48; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. f) Text-Link message (also used for tag): */ var txt_link = 'Coldhardy Temperatures'; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. g) Type of Link: */ /* 1=picture only 2=text only */ /* 3=picture and species 4=text and species */ /* 5=picture plus text plus species 6=species only */ var link_type = 5; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. h) Insert a line-break after the logo-picture (1=Yes, 0=No) */ var pic_nl = 1; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* 5. h) Insert a line-break after the text (1=Yes, 0=No) */ var text_nl = 1; /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ dirs = window.location.pathname.split(dir_split); var file_name = dirs[dirs.length - 1]; filn = file_name.split(filn_split); var plant_name = filn[0]; gen_spe = plant_name.split(gen_spe_split); var genus = gen_spe[0]; if (!gen_spe[0]) genus=''; var species = gen_spe[1]; if (!gen_spe[1]) species=''; var variety = gen_spe[2]; if (!gen_spe[2]) variety=''; if (gen_spe[2]) species=species+' '+variety; function crdb_link(plant_type,temp_unit) { document.write(''); if (link_type==1 | link_type==3 | link_type==5) { document.write('\"',txt_link,'\"'); if (pic_nl) document.write('
'); } if (link_type==2 | link_type==4 | link_type==5) { document.write(txt_link); if (text_nl) document.write('
'); } if (link_type==3 | link_type==4 | link_type==5 | link_type==6) document.write(genus+' '+species); document.writeln('
'); }