// Webs Unlimited's JMoves Expression Web Designer JavaScript Generator version 5.0
// Copyright Webs Unlimited 1998 - 2006 All rights reserved
// This code is the property of Webs Unlimited, Inc.http://www.websunlimited.com
// It may not be used without explicit licensing
function existingHandlers(elEvent) {sTemp = "";if(elEvent != null) {sTemp = elEvent.toString();iStart = sTemp.indexOf("{") + 1;sTemp = sTemp.substr(iStart,sTemp.length-iStart-2) + ";";}return sTemp;}function MakeArray(n) {this.length = n;for (var i = 1; i <= n; i++) {this[i] = null;}return this;}function MakeHexArray() {this.length = 16;for (var i = 1; i <= 10; i++) this[i] = i-1;this[11]="A"; this[12]="B"; this[13]="C"; this[14]="D"; this[15]="E"; this[16]="F";return this}function toHex(decimalColor) {var hex = new MakeHexArray;var sixteens = decimalColor / 16;if (sixteens < 1) {sixteens = 0;}sNum = sixteens + "";sNum = sNum.substring(0,2);sixteens = parseInt(sNum,10);var leftHex = hex[sixteens+1];var ones = decimalColor - sixteens*16;if (ones < 1) ones = 0;sNum = ones + "";sNum = sNum.substring(0,2);ones = parseInt(sNum,10);var rightHex = hex[ones+1];var outputHex = leftHex + "" + rightHex;return outputHex;}function ColorFade(text,sC,eC) {steps = text.length;sR = parseInt(sC.substring(0,3),10);sG = parseInt(sC.substring(3,6),10);sB = parseInt(sC.substring(6,9),10);eR = parseInt(eC.substring(0,3),10);eG = parseInt(eC.substring(3,6),10);eB = parseInt(eC.substring(6,9),10);rInc = (eR - sR) / steps;gInc = (eG - sG) / steps;bInc = (eB - sB) / steps;for (i=0; i != steps; i++) {document.write('<FONT COLOR="' + toHex(sR + (i * rInc)) + toHex(sG + (i * gInc)) + toHex(sB + (i * bInc)) + '" >' + text.substring(i,i+1) + '</FONT>' );}}function IsIn(value,search) {if(search.indexOf(value) != -1) {return 1;} else {return 0;}}function LeadZero(value) {if ( value < 10)document.write('0');}function UntilFormat(format,twoplace,year,month,day) {var operators = 'sSmMdDwWnNY%';var value = '';var today = new Date;var when = new Date(year,month-1,day);var todayyear = today.getYear();var whenyear = when.getYear();if(todayyear > 99) { todayyear -= 1900; }if(whenyear > 99) { whenyear -= 1900; }var seconds = Math.floor((when.getTime() - today.getTime()) / 1000);if(seconds < 0) {document.write('The date must be in the future!');return;}var leaptoday = today.getYear() / 4 - Math.floor(today.getYear()/4);if(leaptoday == 0 && today.getMonth() > 1) {leaptoday = 1;} else {leaptoday = 0;}var leapwhen =  when.getYear() / 4 - Math.floor(when.getYear()/4);if(leapwhen == 0 && when.getMonth() > 1) {leapwhen = 1;} else {leapwhen = 0;}var leapyears = leaptoday + leapwhen;leapyears += Math.floor(((--whenyear - todayyear) / 4 - 1));var TestDate = new Date;TestDate.setMonth(3);TestDate.setDate(1);TestDay = TestDate.getDay();var SatFirst = 7 - TestDay;TestDate.setMonth(9);TestDate.setDate(31);var SatLast = 31 - (TestDate.getDay()+1);if((((month == 4) && (day > SatFirst)) || month > 4) && (month < 11 || ((month ==10) && day < SatLast))) {seconds += 60 *60;}var minutes = Math.floor(seconds / 60);var hours = Math.floor(minutes / 60);var days = Math.floor(hours / 24);var weeks = Math.floor(days / 7);var yearsleft = Math.floor(days / 365);if(when.getYear() == today.getYear()) {var monthsleft = when.getMonth() - (today.getMonth());if(monthsleft >= 1 && (when.getDate() < today.getDate())) --monthsleft;} else {if(yearsleft == 0) {monthsleft = when.getMonth() + (11 - today.getMonth());if(when.getDate() >= today.getDate()) ++monthsleft;} else {monthsleft = when.getMonth() + (11 - today.getMonth());if(when.getMonth() > today.getMonth()) {monthsleft = when.getMonth() - (today.getMonth());if(monthsleft >= 1 && (when.getDate() < today.getDate())) --monthsleft;} else {monthsleft = when.getMonth() + (11 - today.getMonth());if(when.getDate() > today.getDate()) ++monthsleft;}}}var months = (yearsleft * 12) + monthsleft;var hoursleft = hours - (days * 24) - 1;if(hoursleft <= 0) hoursleft = 23;var minutesleft = minutes - hours * 60;var todaymonth = today.getMonth() + 1;if( todaymonth == 02) {var daysleft = 28 + leapyears - today.getDate();}else {if(todaymonth ==  04 || todaymonth == 06 || todaymonth == 09 || todaymonth == 11) {daysleft = 30 - today.getDate();} else {daysleft = 31 - today.getDate();}}if(when.getDate() < today.getDate()) {daysleft += when.getDate()  - 1;} else {daysleft = day - today.getDate() - 1;if(daysleft < 0) {++daysleft; }}var weeksleft = Math.floor(daysleft / 7);var secondsleft = seconds - minutes * 60;var pos = 0;while (pos < format.length) {if( format.substring(pos,pos+1) != '%'){document.write(format.substring(pos,pos+1));pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), operators)){document.write(format.substring(pos,pos+1));pos++;continue;} else {if ( format.substring(pos,pos+1) == '%') {pos++;if (format.substring(pos,pos+1) == '%'){document.write('%');pos++;continue;} else {if (format.substring(pos,pos+1) == 'd'){if(twoplace) LeadZero(days);document.write(days);pos++;continue;} else {if (format.substring(pos,pos+1) == 'D'){if(twoplace) LeadZero(daysleft);document.write(daysleft);if( todaymonth == 02) {daysleft = 28 + leapyears - today.getDate();}else {if(todaymonth ==  04 || todaymonth == 06 || todaymonth == 09 || todaymonth == 11) {daysleft = 30 - today.getDate();} else {daysleft = 31 - today.getDate();}}pos++;continue;} else {if (format.substring(pos,pos+1) == 's'){if(twoplace) LeadZero(seconds);document.write(seconds);pos++;continue;} else {if (format.substring(pos,pos+1) == 'S'){if(twoplace) LeadZero(secondsleft);document.write(secondsleft);pos++;continue;} else {if (format.substring(pos,pos+1) == 'h'){if(twoplace) LeadZero(hours);document.write(hours);pos++;continue;} else {if (format.substring(pos,pos+1) == 'H'){if(twoplace) LeadZero(hoursleft);document.write(hoursleft);pos++;continue;} else {if (format.substring(pos,pos+1) == 'm'){if(twoplace) LeadZero(minutes);document.write(minutes);pos++;continue;} else {if (format.substring(pos,pos+1) == 'M'){if(twoplace) LeadZero(minutesleft);document.write(minutesleft);pos++;continue;} else {if (format.substring(pos,pos+1) == 'w'){daysleft = Math.ceil((days / 7 - Math.floor(days / 7)) * 7);if(twoplace) LeadZero(weeks);document.write(weeks );pos++;continue;} else {if (format.substring(pos,pos+1) == 'W'){daysleft = Math.ceil((daysleft - weeksleft * 7));if(twoplace) LeadZero(weeksleft);document.write(weeksleft);pos++;continue;} else {if (format.substring(pos,pos+1) == 'n'){if(twoplace) LeadZero(months);document.write(months);pos++;continue;} else {if (format.substring(pos,pos+1) == 'N'){if(twoplace) LeadZero(monthsleft);document.write(monthsleft);pos++;continue;} else {if (format.substring(pos,pos+1) == 'Y'){if(twoplace) LeadZero(yearsleft);document.write(yearsleft);pos++;continue;}pos++;}} } } } } } } } } } } } } } } }}var min1,sec1,cmin1,csec1, oObject;function Display(min,sec) {var disp = '';if(min<=9) disp='0';disp+=min+':';if(sec<=9)  disp+='0'+sec;  else disp+=sec;return(disp);}function Up(sFormat,oElement,bAction,sMsg,sUrl,sTarget) {cmin1=0; csec1=0;min1=sFormat.substring(0,sFormat.indexOf(':'));sec1=sFormat.substring(sFormat.indexOf(':')+1,sFormat.length);oObject = oElement;oElement.value=Display(cmin1,csec1);oObject = oElement;UpRepeat(oObject,bAction,sMsg,sUrl,sTarget);}function UpRepeat(oElement,bAction,sMsg,sUrl,sTarget) {if(bAction != 0) {if((cmin1==min1)&&(csec1==sec1) ){oElement.value=Display(cmin1,csec1);switch(bAction) {case 1:window.open(sUrl,sTarget);return;break;case 2:alert(sMsg);cmin1 = csec1 = 0;oElement.value=Display(cmin1,csec1);return;break;case 3:alert(sMsg);window.open(sUrl,sTarget);return;break;case 4:if(confirm(sMsg)) window.open(sUrl,sTarget);return;break;}}}oElement.value=Display(cmin1,csec1);if(++csec1 == 60) { csec1=0; cmin1++; }var myRegExp = /'/g;var sTemp = sMsg.replace(myRegExp,"\\'");sCall = 'UpRepeat(oObject' +  ',' + bAction + ",'" + sTemp + "','" + sUrl + "','" + sTarget + "')";setTimeout(sCall,1000);}function DateFormat(format,twoplace) {var operators = 'dDmMyY%';var value = '';var today = new Date;weekday = today.getDay();month = today.getMonth();year=today.getYear();if(year > 1900) year -= 1900;date = today.getDate();var days = new MakeArray(7);days[0] = 'Sunday';days[1] = 'Monday';days[2] = 'Tuesday';days[3] = 'Wednesday';days[4] = 'Thursday';days[5] = 'Friday';days[6] = 'Saturday';var months = new MakeArray(12);months[0] = 'January';months[1] = 'February';months[2] = 'March';months[3] = 'April';months[4] = 'May';months[5] = 'June';months[6] = 'July';months[7] = 'August';months[8] = 'September';months[9] = 'October';months[10] = 'November';months[11] = 'December';var pos = 0;while (pos < format.length) {if( format.substring(pos,pos+1) != '%'){document.write(format.substring(pos,pos+1));pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), operators)){document.write(format.substring(pos,pos+1));pos++;continue;} else {if ( format.substring(pos,pos+1) == '%') {pos++;if (format.substring(pos,pos+1) == '%'){document.write('%');pos++;continue;} else {if (format.substring(pos,pos+1) == 'd'){if(twoplace) LeadZero(date);document.write(date);pos++;continue;} else {if (format.substring(pos,pos+1) == 'A'){document.write(days[weekday]);pos++;continue;} else {if (format.substring(pos,pos+1) == 'a'){document.write(days[weekday].substring(0,3));pos++;continue;} else {if (format.substring(pos,pos+1) == 'm'){if(twoplace) LeadZero(month+1);document.write(month+1);pos++;continue;} else {if (format.substring(pos,pos+1) == 'B'){document.write(months[month]);pos++;continue;} else {if (format.substring(pos,pos+1) == 'b'){document.write(months[month].substring(0,3));pos++;continue;} else {if (format.substring(pos,pos+1) == 'y'){if(year < 100) {document.write(year);} else {year -= 100;LeadZero(year);document.write(year);}pos++;continue;} else {if (format.substring(pos,pos+1) == 'Y'){document.write(1900 + year);pos++;continue;}pos++;}} } } } } } } } } } }}function TimeFormat(format,twoplace) {var operators = 'HIMSp%';var value = '';var today = new Date;hours = today.getHours();minutes = today.getMinutes();seconds =today.getSeconds();var pos = 0;while (pos < format.length) {if( format.substring(pos,pos+1) != '%'){document.write(format.substring(pos,pos+1));pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), operators)){document.write(format.substring(pos,pos+1));pos++;continue;} else {if ( format.substring(pos,pos+1) == '%'){pos++;if (format.substring(pos,pos+1) == '%'){document.write('%');pos++;continue;} else {if (format.substring(pos,pos+1) == 'H'){if(twoplace) LeadZero(hours);document.write(hours);pos++;continue;} else {if (format.substring(pos,pos+1) == 'M'){if(twoplace) LeadZero(minutes);document.write(minutes);pos++;continue;} else {if (format.substring(pos,pos+1) == 'I'){var newhours = hours;if(hours > 12) newhours = hours - 12;if(hours == 0) newhours = 12;document.write(newhours);pos++;continue;} else {if (format.substring(pos,pos+1) == 'S'){if(twoplace) LeadZero(seconds);document.write(seconds);pos++;continue;} else {if (format.substring(pos,pos+1) == 'p'){if (hours < 12)document.write('am');else document.write('pm');pos++;continue;}   else {if (format.substring(pos,pos+1) == 'P'){if (hours < 12)document.write('AM');else document.write('PM');pos++;continue;}pos++;}} } } } } } } } }}function frameBust() {if(self.parent.frames.length != 0) { self.parent.location = window.location; }}function displayGlobalClock(format,GMTTime,twoplace) {var operators = 'HIMSp%';var value = '';var today = new Date;var hours = today.getHours();var minutes = today.getMinutes();var seconds =today.getSeconds();var year = today.getYear();if(year < 1900) year += 1900;var month = today.getMonth()+1;var date = today.getDate();var day = today.getDay();var TimezoneOffset = today.getTimezoneOffset();var TestDate = new Date;TestDate.setMonth(3);TestDate.setDate(1);TestDay = TestDate.getDay();var SatFirst = 7 - TestDay;TestDate.setMonth(9);TestDate.setDate(31);var SatLast = 31 - (TestDate.getDay()+1);if((((month == 4) && (date > SatFirst)) || month > 4) && (month < 11 || ((month ==10) && date < SatLast))) {TimezoneOffset+=60;}TimezoneOffset += GMTTime;var half = TimezoneOffset % 60;hours += TimezoneOffset / 60;if((half == -30) || (half == 30)) minutes += half;if(minutes > 59) minutes -= 60, hours++;if(minutes < 0) minutes += 60, hours--;if (hours > 23) hours -= 24,date += 1;var pos = 0;while (pos < format.length) {if( format.substring(pos,pos+1) != '%'){document.write(format.substring(pos,pos+1));pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), operators)){document.write(format.substring(pos,pos+1));pos++;continue;} else {if ( format.substring(pos,pos+1) == '%'){pos++;if (format.substring(pos,pos+1) == '%'){document.write('%');pos++;continue;} else {if (format.substring(pos,pos+1) == 'H'){if(twoplace) LeadZero(hours);document.write(hours);pos++;continue;} else {if (format.substring(pos,pos+1) == 'M'){if(twoplace) LeadZero(minutes);document.write(minutes);pos++;continue;} else {if (format.substring(pos,pos+1) == 'I'){var newhours = hours;if(hours > 12) newhours = hours - 12;document.write(newhours);pos++;continue;} else {if (format.substring(pos,pos+1) == 'S'){if(twoplace) LeadZero(seconds);document.write(seconds);pos++;continue;} else {if (format.substring(pos,pos+1) == 'p'){if (hours < 12)document.write('am');else document.write('pm');pos++;continue;}  else {if (format.substring(pos,pos+1) == 'P'){if (hours < 12)document.write('AM');else document.write('PM');pos++;continue;}pos++;}} } } } } } } } }}function getCookieVal (offset) {var endstr = document.cookie.indexOf (";", offset);if (endstr == -1)endstr = document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}function GetCookie (name) {var argv = GetCookie.arguments;var argc = GetCookie.arguments.length;var defaultvalue = (argc > 1) ? argv[1] : null;var arg = name + "=";var alen = arg.length;var cookievalue;var clen = document.cookie.length;var i = 0;while (i < clen) {var j = i + alen;if (document.cookie.substring(i, j) == arg){cookievalue = getCookieVal(j);if(cookievalue == 'null') return defaultvalue;return getCookieVal (j);}i = document.cookie.indexOf(" ", i) + 1;if (i == 0) break;}return defaultvalue;}function ticktock(format,twoplace) {var operators = 'HIMSp%';var timenow = '';sCall = 'ticktock("' + format + '",' + twoplace + ')';var today = new Date;hours = today.getHours();minutes = today.getMinutes();seconds =today.getSeconds();var pos = 0;while (pos < format.length) {if( format.substring(pos,pos+1) != '%'){timenow += format.substring(pos,pos+1);pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), operators)){timenow += format.substring(pos,pos+1);pos++;continue;} else {if ( format.substring(pos,pos+1) == '%'){pos++;if (format.substring(pos,pos+1) == '%'){timenow += '%';pos++;continue;} else {if (format.substring(pos,pos+1) == 'H'){if(twoplace) if(hours<10) timenow += '0';timenow += hours;pos++;continue;} else {if (format.substring(pos,pos+1) == 'M'){if(twoplace) if(minutes<10) timenow += '0';timenow += minutes;pos++;continue;} else {if (format.substring(pos,pos+1) == 'I'){var newhours = hours;if(hours > 12) newhours = hours - 12;if(newhours == 0) newhours = 12;timenow += newhours;pos++;continue;} else {if (format.substring(pos,pos+1) == 'S'){if(twoplace) if(seconds<10) timenow += '0';timenow += seconds;pos++;continue;} else {if (format.substring(pos,pos+1) == 'p'){if (hours < 12)timenow += 'am';else timenow += 'pm';pos++;continue;}   else {if (format.substring(pos,pos+1) == 'P'){if (hours < 12)timenow += 'AM';else timenow += 'PM';pos++;continue;}pos++;}} } } } } } } } }document.ticktock.Clock.value = timenow; timer = setTimeout(sCall,1000);}function search4it(el,target) {var url = '';var pos = 0;var tpos = 0;var wlf = '';var what = '';url = el.engines.options[el.engines.selectedIndex].value;pos = url.indexOf('JBOT');wlf = el.fwhat.value;what = '';for (var x=0; x < wlf.length; x++){if (wlf.charAt(x) == ' '){what += '+';}else{what += wlf.charAt(x);}}tpos = pos + 4;if (tpos < url.length){wlf = url.substring(tpos, url.length);}else{wlf = '';}url = url.substring(0,pos);url = url + what + wlf;window.open( url,target);}function Answer(format,test,score,el) {x = el.length;for(i = 0; i < x; i++) {el[i].onclick= new Function("alert('Question already answered!');");}if(test) { ++score[1]; } else { ++score[2]; }++score[3];if(format == "") return;sNewMsg = "";pos = 0;while(pos < format.length ) {if( format.substring(pos,pos+1) != '%'){sNewMsg += format.substring(pos,pos+1);pos++;continue;} else {if (!IsIn(format.substring(pos,pos+1), "wctpa%")){sNewMsg += format.substring(pos,pos+1);pos++;continue;} else {if ( format.substring(pos,pos+1) == '%') {pos++;if (format.substring(pos,pos+1) == '%'){sNewMsg += '%';pos++;continue;} else {if (format.substring(pos,pos+1) == 'w'){sNewMsg += " " + score[2];pos++;continue;} else {if (format.substring(pos,pos+1) == 'c'){sNewMsg += " " + score[1];pos++;continue;} else {if (format.substring(pos,pos+1) == 'p'){sNewMsg += " " + Math.abs(Math.floor(1 - score[1] / score[0] * 100)-1);pos++;continue;} else {if (format.substring(pos,pos+1) == 'a'){sNewMsg += " " + score[3];pos++;continue;} else {if (format.substring(pos,pos+1) == 't'){sNewMsg += " " + score[0];pos++;continue;}}}}}}}}}}alert(sNewMsg);}function getNextSize(i,method,textLength) {if (method == 0) {while (i > 12) i = i - 12;if (i <=7) return i;if (i == 8) return 6;if (i == 9) return 5;if (i == 10) return 4;if (i == 11) return 3;if (i == 12) return 2;}if (method == 1) {return (7*Math.sin(i/(textLength/3.14)));}if (method == 2) {return (7*Math.abs(Math.cos(i/(textLength/3.14))));}}function WavyText(text,method) {steps = text.length;for (i=0; i<=steps; i++) {document.write("<FONT SIZE='"+ getNextSize(i,method,steps) +"'>" + text.substring(i,i+1)+"</FONT>");}}