function GW_isDefined(A){return(new String(A)!="undefined")}function GW_isString(){if(typeof arguments[0]=="string"){return true}if(typeof arguments[0]=="object"){var A=arguments[0].constructor.toString().match(/string/i);return(A!=null)}return false}function GW_DateToSmallDateStr(fullDate){with(fullDate){var result=""+(getMonth()+1)+"/"+getDate()+"/"+getYear()+" "+getHours()+":"+getMinutes()}return result}function GW_charCount(C,D){var A=0;for(var B=0;B<D.length;B++){if(D.charAt(B)==C){A++}}return A}function GW_RplSubString(B,C,D){var A=B+"";while(A.indexOf(C)>-1){pos=A.indexOf(C);A=""+(A.substring(0,pos)+D+A.substring((pos+C.length),A.length))}return A}function GW_InsertString(A,C,B){return A.substring(0,B)+C+A.substring(B,A.length)}function GW_FixCharacter(C,D){var A=""+C;var B=0;while(B<A.length){if(A.charAt(B)==D){A=GW_InsertString(A,"\\",B);B++}B++}return A}function GW_isIP(B){if(GW_charCount(".",B)!=3){return false}for(var A=0;A<B.length;A++){if((B.charAt(A)!=".")&&((B.charAt(A)<"0")||(B.charAt(A)>"9"))){return false}}return true}function GW_DomainSuffix(B){var A=""+B;if(GW_isIP(B)){return A}if(A.indexOf(".")!=-1){A=A.substring(A.indexOf(".")+1,A.length)}return A}function GW_IntToCommaStr(C){var A=""+C;for(var B=A.length-4;B>=0;B=B-3){A=GW_InsertString(A,",",B+1)}return A}function GW_CommaStrToInt(B){var A=""+B;A=GW_RplSubString(A,",","");return new Number(A)}function GW_IsAlphaNumeric(D){var A=true;var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var B=0;B<D.length;B++){if(C.indexOf(D.charAt(B))==-1){A=false}}return A}function GW_IsNumeric(D){var A=true;var C="0123456789";for(var B=0;B<D.length;B++){if(C.indexOf(D.charAt(B))==-1){A=false}}return A}function GW_LTrim(A){return A.replace(/^\s*/,"")}function GW_RTrim(A){return A.replace(/\s*$/,"")}function GW_Trim(A){return GW_RTrim(GW_LTrim(A))}function GW_StripSpaces(A){return A.replace(/ /g,"")}function GW_SerialCheck(C){var A=true;if(C==""){A="Please enter the Serial Number.\n"}else{var B=false;switch(C.length){case 10:case 11:if(GW_IsNumeric(C)){B=true}break;case 13:case 16:case 17:case 18:case 19:case 22:if(!GW_IsNumeric(C)&&GW_IsAlphaNumeric(C)){B=true}break}if(B==false){A="Your Product SNID or Serial # should contain either of the following:\n\n";A+="\ta) 10 or 11 digits numeric\n";A+="\tb) 13,16,17,18,19 or 22 digits alphanumeric\n\n";A+="Please do not use spaces between characters for your serial number\n"}}return A}function Emachines_SerialCheck(C){var A=true;if(C==""){A="Please enter the Product SNID or Serial #.\n"}else{var B=false;switch(C.length){case 11:if(GW_IsNumeric(C)){B=true}break;case 13:case 16:case 17:case 18:case 19:case 22:if(!GW_IsNumeric(C)&&GW_IsAlphaNumeric(C)){B=true}break}if(B==false){A="Your Product SNID or Serial # should contain either of the following:\n\n";A+="\ta) 11 digits numeric\n";A+="\tb) 13,16,17,18,19 or 22 digits alphanumeric\n\n";A+="Please do not use spaces between characters for your serial number\n"}}return A}function GW_isRetail(A){var B=A.length;if(B==11||B==13||B==16||B==17||B==18||B==19||B==22){return true}else{return false}};