// GenericJS v2.0
String.prototype.capitalize=function(){return this.replace(/\w+/g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();});};function show(elem){if(document.getElementById(elem)){document.getElementById(elem).style.display='';}}function hide(elem){if(document.getElementById(elem)){document.getElementById(elem).style.display='none';}}function goTo(link){document.location.href=link;}function isAlphaNumeric(string){var regex=/^[0-9A-Za-z]+$/;if(regex.test(string)){return true;}else{return false;}}function isNumeric(string){var regex=/^[0-9]+$/;if(regex.exec(string)){return true;}else{return false;}}function charOccurences(argString,argChar){var occ=0;for(var i=0;i<argString.length;i++){if(argString.charAt(i)==argChar){occ++;}}return occ;}function checkForUs(){var current=document.getElementById('countries').selectedIndex;current=document.getElementById('countries').options[current].value;if(current=='840'){hide('state');show('us_states');}else{show('state');hide('us_states');}}function isProperEmail(argEmail){if(charOccurences(argEmail,'@')+charOccurences(argEmail,'.')<2){return false;}var atPos=argEmail.indexOf('@');var dotPos=argEmail.indexOf('.');if((atPos==0)||(atPos==(argEmail.length-1))){return false;}if((dotPos==0)||(dotPos==(argEmail.length-1))){return false;}var emailPat=/^(.+)@(.+)$/;var quotedUser="(\"[^\"]*\")";var atom='\[^\\s\\(\\)><@,;:\\\\\\\"\\.\\[\\]\]+';var word="("+atom+"|"+quotedUser+")";var userPat=new RegExp("^"+word+"(\\."+word+")*$");var domainPat=new RegExp("^"+atom+"(\\."+atom+")*$");var matchArray=argEmail.match(emailPat);if(matchArray==null){return false;}var user=matchArray[1];var domain=matchArray[2];for(i=0;i<user.length;i++){if(user.charCodeAt(i)>127){return false;}}for(i=0;i<domain.length;i++){if(domain.charCodeAt(i)>127){return false;}}if(user.match(userPat)==null||domain.match(domainPat)==null){return false;}return true;}function validateForm(theForm,prevItem,borderError,borderOk,passMinLenght,alternateFunction){if(!borderError){var borderError="#ff0000";}if(!borderOk){var borderOk="#000000";}if(!passMinLenght){var passMinLenght=4;}var passwordTemp=false;var parseFilter=false;var errorAt=false;var errorReg=false;var errorMessages=new Array();{errorMessages[1]="Please complete all required fields.";errorMessages[2]="Please enter a valid email address.";errorMessages[3]=" must contain only letters or digit.";errorMessages[4]="Please enter at least "+passMinLenght+" characters for your password.";errorMessages[5]="Your passwords do not match, please make sure your password is re-entered properly.";}for(var i=0;i<theForm.elements.length;i++){if(theForm.elements[i].alt){parseFilter=theForm.elements[i].alt;}else if(theForm.elements[i].title){parseFilter=theForm.elements[i].title;}else{parseFilter='';}if((parseFilter!=''&&parseFilter.indexOf("optional")>=0)||theForm.elements[i].style.display=="none"){if(!errorAt){prevItem=theForm.elements[i].name;}continue;}if(theForm.elements[i].type=="text"||theForm.elements[i].type=="password"||theForm.elements[i].type=="textarea"){if(theForm.elements[i].value==""){if(!errorAt){errorAt=theForm.elements[i];errorReg=errorMessages[1];}theForm.elements[i].style.borderColor=borderError;}else if(parseFilter.indexOf("email")>=0&&!isProperEmail(theForm.elements[i].value)){if(!errorAt){errorAt=theForm.elements[i];errorReg=errorMessages[2];}theForm.elements[i].style.borderColor=borderError;}else if(parseFilter.indexOf("alphanumeric")>=0&&!isAlphaNumeric(theForm.elements[i].value)){if(!errorAt){errorAt=theForm.elements[i];errorReg=errorAt.name.capitalize()+errorMessages[3];}theForm.elements[i].style.borderColor=borderError;}else if(parseFilter.indexOf("password")>=0){if(theForm.elements[i].value.length<passMinLenght){if(!errorAt){errorAt=theForm.elements[i];errorReg=errorMessages[4];}theForm.elements[i].style.borderColor=borderError;theForm.elements[i].value='';}else{if(!passwordTemp){passwordTemp=theForm.elements[i];}else if(passwordTemp.value!=theForm.elements[i].value){if(!errorAt){errorAt=passwordTemp;errorReg=errorMessages[5];}passwordTemp.style.borderColor=borderError;passwordTemp.value='';theForm.elements[i].style.borderColor=borderError;theForm.elements[i].value='';}else{passwordTemp.style.borderColor=borderOk;theForm.elements[i].style.borderColor=borderOk;}}}else{theForm.elements[i].style.borderColor=borderOk;if(!errorAt){prevItem=theForm.elements[i].name;}}}else if(theForm.elements[i].type=="select-one"){if(theForm.elements[i].selectedIndex==0){if(!errorAt){errorAt=theForm.elements[i];errorReg=errorMessages[1];}theForm.elements[i].style.borderColor=borderError;}else{theForm.elements[i].style.borderColor=borderOk;}}}if(errorAt!=''){document.location.href='#'+prevItem;alert(errorReg);errorAt.focus();if(alternateFunction){alternateFunction(0);}return false}else if(alternateFunction){return alternateFunction(1);}return true;}function validateCreditCardInfo(flag){if(!document.getElementById('method_buy1')||!document.getElementById('method_buy1').checked){if(flag){document.location.href='#';hide('shopping_cart_process');show('shopping_cart_load');}return true;}var borderError="#CD0292";var borderOk="#CCCCCC";var error=false;var errorAt=false;var cci_no=document.getElementById("cci_no");var cci_expdate=document.getElementById("cci_expdate");var cci_csc=document.getElementById("cci_csc");if(cci_no.value==""||!isNumeric(cci_no.value.replace(/\s/g,""))){error="You must enter a valid Card Number.";errorAt=cci_no;cci_no.style.borderColor=borderError;}else{cci_no.style.borderColor=borderOk;}var month=cci_expdate.value.substring(0,2);var year=cci_expdate.value.substring(2,4);if(cci_expdate.value==""||cci_expdate.value.length!=4||!(isNumeric(month)&&month>=1&&month<=12)||!isNumeric(year)){if(!error){error="You must enter the expiration date of the credit card.";errorAt=cci_expdate;}cci_expdate.style.borderColor=borderError;}else{cci_expdate.style.borderColor=borderOk;}if(cci_csc.value.length<3||!isNumeric(cci_csc.value)){if(!error){error="You must enter a valid Card Security Code.";errorAt=cci_csc;}cci_csc.style.borderColor=borderError;}else{cci_csc.style.borderColor=borderOk;}if(error&&flag){document.location.href='#'+errorAt.name;errorAt.focus();alert(error);return false;}if(flag){document.location.href='#';hide('shopping_cart_process');show('shopping_cart_load');}return true;}function jcShowTab(group,id){var i=1;while(document.getElementById(group+'_'+i)){if(i==id){document.getElementById(group+'_'+i).className='show';document.getElementById(group+'_a_'+i).className='jc_tab_selected';document.getElementById(group+'_a_'+i).blur();}else{document.getElementById(group+'_'+i).className='hidden';document.getElementById(group+'_a_'+i).className='jc_tab1';}i++;}}function OutputLink(text,href,title,after_text,rel){if(text==null||typeof(text)=='undefined')text='undefined';if(href==null||typeof(href)=='undefined')href='/';if(title==null||typeof(title)=='undefined')title=text;if(rel==null||typeof(rel)=='undefined')rel='nofollow';if(after_text==null||typeof(after_text)=="undefined")after_text="";document.write('<a rel='+rel+' href="'+href+'" title="'+title+'">'+text+'</a>'+after_text);}function goItem(obj){if(obj.value!=''){goTo(obj.value);}}function addToFavorites(){var title=window.document.title;var url=window.document.location;if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(window.opera){var a=document.createElement("A");a.rel="sidebar";a.target="_search";a.title=title;a.href=url;a.click();}else if(window.external){window.external.AddFavorite(url,title);}}function selectTechnology(tech){elem=document.getElementById('technology');if(elem){elem.selectedIndex=tech;}}
// SWFObject v1.5
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
// XMLHttpRequest v1.2
if(window.ActiveXObject&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){var msxmls=new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');for(var i=0;i<msxmls.length;i++){try{return new ActiveXObject(msxmls[i]);}catch(e){}}return null;};}if(window.opera&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){this.readyState=0;this.status=0;this.statusText='';this._headers=[];this._aborted=false;this._async=true;this._defaultCharset='ISO-8859-1';this._getCharset=function(){var charset=_defaultCharset;var contentType=this.getResponseHeader('Content-type').toUpperCase();val=contentType.indexOf('CHARSET=');if(val!=-1){charset=contentType.substring(val);}val=charset.indexOf(';');if(val!=-1){charset=charset.substring(0,val);}val=charset.indexOf(',');if(val!=-1){charset=charset.substring(0,val);}return charset;};this.abort=function(){this._aborted=true;};this.getAllResponseHeaders=function(){return this.getAllResponseHeader('*');};this.getAllResponseHeader=function(header){var ret='';for(var i=0;i<this._headers.length;i++){if(header=='*'||this._headers[i].h==header){ret+=this._headers[i].h+': '+this._headers[i].v+'\n';}}return ret;};this.getResponseHeader=function(header){var ret=getAllResponseHeader(header);var i=ret.indexOf('\n');if(i!=-1){ret=ret.substring(0,i);}return ret;};this.setRequestHeader=function(header,value){this._headers[this._headers.length]={h:header,v:value};};this.open=function(method,url,async,user,password){this.method=method;this.url=url;this._async=true;this._aborted=false;this._headers=[];if(arguments.length>=3){this._async=async;}if(arguments.length>3){opera.postError('XMLHttpRequest.open() - user/password not supported');}this.readyState=1;if(this.onreadystatechange){this.onreadystatechange();}};this.send=function(data){if(!navigator.javaEnabled()){alert("XMLHttpRequest.send() - Java must be installed and enabled.");return;}if(this._async){setTimeout(this._sendasync,0,this,data);}else{this._sendsync(data);}};this._sendasync=function(req,data){if(!req._aborted){req._sendsync(data);}};this._sendsync=function(data){this.readyState=2;if(this.onreadystatechange){this.onreadystatechange();}var url=new java.net.URL(new java.net.URL(window.location.href),this.url);var conn=url.openConnection();for(var i=0;i<this._headers.length;i++){conn.setRequestProperty(this._headers[i].h,this._headers[i].v);}this._headers=[];if(this.method=='POST'){conn.setDoOutput(true);var wr=new java.io.OutputStreamWriter(conn.getOutputStream(),this._getCharset());wr.write(data);wr.flush();wr.close();}var gotContentEncoding=false;var gotContentLength=false;var gotContentType=false;var gotDate=false;var gotExpiration=false;var gotLastModified=false;for(var i=0;;i++){var hdrName=conn.getHeaderFieldKey(i);var hdrValue=conn.getHeaderField(i);if(hdrName==null&&hdrValue==null){break;}if(hdrName!=null){this._headers[this._headers.length]={h:hdrName,v:hdrValue};switch(hdrName.toLowerCase()){case'content-encoding':gotContentEncoding=true;break;case'content-length':gotContentLength=true;break;case'content-type':gotContentType=true;break;case'date':gotDate=true;break;case'expires':gotExpiration=true;break;case'last-modified':gotLastModified=true;break;}}}var val;val=conn.getContentEncoding();if(val!=null&&!gotContentEncoding)this._headers[this._headers.length]={h:'Content-encoding',v:val};val=conn.getContentLength();if(val!=-1&&!gotContentLength)this._headers[this._headers.length]={h:'Content-length',v:val};val=conn.getContentType();if(val!=null&&!gotContentType)this._headers[this._headers.length]={h:'Content-type',v:val};val=conn.getDate();if(val!=0&&!gotDate)this._headers[this._headers.length]={h:'Date',v:(new Date(val)).toUTCString()};val=conn.getExpiration();if(val!=0&&!gotExpiration)this._headers[this._headers.length]={h:'Expires',v:(new Date(val)).toUTCString()};val=conn.getLastModified();if(val!=0&&!gotLastModified)this._headers[this._headers.length]={h:'Last-modified',v:(new Date(val)).toUTCString()};var reqdata='';var stream=conn.getInputStream();if(stream){var reader=new java.io.BufferedReader(new java.io.InputStreamReader(stream,this._getCharset()));var line;while((line=reader.readLine())!=null){if(this.readyState==2){this.readyState=3;if(this.onreadystatechange){this.onreadystatechange();}}reqdata+=line+'\n';}reader.close();this.status=200;this.statusText='OK';this.responseText=reqdata;this.readyState=4;if(this.onreadystatechange){this.onreadystatechange();}if(this.onload){this.onload();}}else{this.status=404;this.statusText='Not Found';this.responseText='';this.readyState=4;if(this.onreadystatechange){this.onreadystatechange();}if(this.onerror){this.onerror();}}};};}if(!window.ActiveXObject&&window.XMLHttpRequest){window.ActiveXObject=function(type){switch(type.toLowerCase()){case'microsoft.xmlhttp':case'msxml2.xmlhttp':case'msxml2.xmlhttp.3.0':case'msxml2.xmlhttp.4.0':case'msxml2.xmlhttp.5.0':return new XMLHttpRequest();}return null;};}function ajaxCall(){var xmlHtp;var uri='/scripts/ajax/serve.php';var dataForPost;args=ajaxCall.arguments;dataForPost="function_name="+escape(args[0]);for(i=1;i<args.length;i++){dataForPost=dataForPost+"&args[]="+args[i];}dataForPost+="&random="+new Date().getTime();var msxmlhttp=new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');for(var i=0;i<msxmlhttp.length;i++){try{xmlHtp=new ActiveXObject(msxmlhttp[i]);}catch(e){xmlHtp=null;}}if(!xmlHtp&&typeof XMLHttpRequest!="undefined"){xmlHtp=new XMLHttpRequest();}if(xmlHtp==null){return false;}else{xmlHtp.open('POST',uri,false);xmlHtp.setRequestHeader("Method","POST "+uri+" HTTP/1.1");xmlHtp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");xmlHtp.send(dataForPost);var data=xmlHtp.responseText.replace(/^\s*|\s*$/g,"");eval(data);delete xmlHtp;try{return ret;}catch(e){return;}}}
