(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}
this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}
validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);else if(element.parentNode.name in this.submitted)
this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}
$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}
this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return /radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages;}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}
return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\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])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\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})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);;
/*
 * jQuery UI 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
(function($){$.ui=$.ui||{};if($.ui.version){return;}
$.extend($.ui,{version:"1.8.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==='number'?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();(fn&&fn.call(elem));},delay);}):this._focus.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none');},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css('zIndex',zIndex);}
if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css('position');if(position=='absolute'||position=='relative'||position=='fixed')
{value=parseInt(elem.css('zIndex'));if(!isNaN(value)&&value!=0){return value;}}
elem=elem.parent();}}
return 0;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});})(jQuery);;
/*
 * jQuery UI Widget 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function($){var _remove=$.fn.remove;$.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).length){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});}}
return _remove.call($(this),selector,keepData);});};$.widget=function(name,base,prototype){var namespace=name.split(".")[0],fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
$.expr[":"][fullName]=function(elem){return!!$.data(elem,name);};$[namespace]=$[namespace]||{};$[namespace][name]=function(options,element){if(arguments.length){this._createWidget(options,element);}};var basePrototype=new base();basePrototype.options=$.extend({},basePrototype.options);$[namespace][name].prototype=$.extend(true,basePrototype,{namespace:namespace,widgetName:name,widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);$.widget.bridge(name,$[namespace][name]);};$.widget.bridge=function(name,object){$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.substring(0,1)==="_"){return returnValue;}
if(isMethodCall){this.each(function(){var instance=$.data(this,name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,name);if(instance){if(options){instance.option(options);}
instance._init();}else{$.data(this,name,new object(options,this));}});}
return returnValue;};};$.Widget=function(options,element){if(arguments.length){this._createWidget(options,element);}};$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){this.element=$(element).data(this.widgetName,this);this.options=$.extend(true,{},this.options,$.metadata&&$.metadata.get(element)[this.widgetName],options);var self=this;this.element.bind("remove."+this.widgetName,function(){self.destroy();});this._create();this._init();},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled");},widget:function(){return this.element;},option:function(key,value){var options=key,self=this;if(arguments.length===0){return $.extend({},self.options);}
if(typeof key==="string"){if(value===undefined){return this.options[key];}
options={};options[key]=value;}
$.each(options,function(key,value){self._setOption(key,value);});return self;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget()
[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",value);}
return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_trigger:function(type,event,data){var callback=this.options[type];event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};})(jQuery);;(function($){$.widget("ui.accordion",{options:{active:0,animated:'slide',autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},_create:function(){var o=this.options,self=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset");this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){$(this).addClass('ui-state-hover');}).bind("mouseleave.accordion",function(){$(this).removeClass('ui-state-hover');}).bind("focus.accordion",function(){$(this).addClass('ui-state-focus');}).bind("blur.accordion",function(){$(this).removeClass('ui-state-focus');});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(o.navigation){var current=this.element.find("a").filter(o.navigationFilter);if(current.length){var header=current.closest(".ui-accordion-header");if(header.length){this.active=header;}else{this.active=current.closest(".ui-accordion-content").prev();}}}
this.active=this._findActive(this.active||o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass('ui-accordion-content-active');this._createIcons();this.resize();this.element.attr('role','tablist');this.headers.attr('role','tab').bind('keydown',function(event){return self._keydown(event);}).next().attr('role','tabpanel');this.headers.not(this.active||"").attr('aria-expanded','false').attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr('tabIndex','0');}else{this.active.attr('aria-expanded','true').attr('tabIndex','0');}
if(!$.browser.safari)
this.headers.find('a').attr('tabIndex','-1');if(o.event){this.headers.bind((o.event)+".accordion",function(event){self._clickHandler.call(self,event,this);event.preventDefault();});}},_createIcons:function(){var o=this.options;if(o.icons){$("<span/>").addClass("ui-icon "+o.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);this.element.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons");},destroy:function(){var o=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind('.accordion').removeData('accordion');this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var contents=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(o.autoHeight||o.fillHeight){contents.css("height","");}
return this;},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key=="active"){this.activate(value);}
if(key=="icons"){this._destroyIcons();if(value){this._createIcons();}}},_keydown:function(event){var o=this.options,keyCode=$.ui.keyCode;if(o.disabled||event.altKey||event.ctrlKey)
return;var length=this.headers.length;var currentIndex=this.headers.index(event.target);var toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._clickHandler({target:event.target},event.target);event.preventDefault();}
if(toFocus){$(event.target).attr('tabIndex','-1');$(toFocus).attr('tabIndex','0');toFocus.focus();return false;}
return true;},resize:function(){var o=this.options,maxHeight;if(o.fillSpace){if($.browser.msie){var defOverflow=this.element.parent().css('overflow');this.element.parent().css('overflow','hidden');}
maxHeight=this.element.parent().height();if($.browser.msie){this.element.parent().css('overflow',defOverflow);}
this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()));}).css('overflow','auto');}else if(o.autoHeight){maxHeight=0;this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).height());}).height(maxHeight);}
return this;},activate:function(index){this.options.active=index;var active=this._findActive(index)[0];this._clickHandler({target:active},active);return this;},_findActive:function(selector){return selector?typeof selector=="number"?this.headers.filter(":eq("+selector+")"):this.headers.not(this.headers.not(selector)):selector===false?$([]):this.headers.filter(":eq(0)");},_clickHandler:function(event,target){var o=this.options;if(o.disabled)
return;if(!event.target){if(!o.collapsible)
return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);this.active.next().addClass('ui-accordion-content-active');var toHide=this.active.next(),data={options:o,newHeader:$([]),oldHeader:o.active,newContent:$([]),oldContent:toHide},toShow=(this.active=$([]));this._toggle(toShow,toHide,data);return;}
var clicked=$(event.currentTarget||target);var clickedIsActive=clicked[0]==this.active[0];o.active=o.collapsible&&clickedIsActive?false:$('.ui-accordion-header',this.element).index(clicked);if(this.running||(!o.collapsible&&clickedIsActive)){return;}
this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);if(!clickedIsActive){clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);clicked.next().addClass('ui-accordion-content-active');}
var toShow=clicked.next(),toHide=this.active.next(),data={options:o,newHeader:clickedIsActive&&o.collapsible?$([]):clicked,oldHeader:this.active,newContent:clickedIsActive&&o.collapsible?$([]):toShow,oldContent:toHide},down=this.headers.index(this.active[0])>this.headers.index(clicked[0]);this.active=clickedIsActive?$([]):clicked;this._toggle(toShow,toHide,data,clickedIsActive,down);return;},_toggle:function(toShow,toHide,data,clickedIsActive,down){var o=this.options,self=this;this.toShow=toShow;this.toHide=toHide;this.data=data;var complete=function(){if(!self)return;return self._completed.apply(self,arguments);};this._trigger("changestart",null,this.data);this.running=toHide.size()===0?toShow.size():toHide.size();if(o.animated){var animOptions={};if(o.collapsible&&clickedIsActive){animOptions={toShow:$([]),toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}else{animOptions={toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}
if(!o.proxied){o.proxied=o.animated;}
if(!o.proxiedDuration){o.proxiedDuration=o.duration;}
o.animated=$.isFunction(o.proxied)?o.proxied(animOptions):o.proxied;o.duration=$.isFunction(o.proxiedDuration)?o.proxiedDuration(animOptions):o.proxiedDuration;var animations=$.ui.accordion.animations,duration=o.duration,easing=o.animated;if(easing&&!animations[easing]&&!$.easing[easing]){easing='slide';}
if(!animations[easing]){animations[easing]=function(options){this.slide(options,{easing:easing,duration:duration||700});};}
animations[easing](animOptions);}else{if(o.collapsible&&clickedIsActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}
toHide.prev().attr('aria-expanded','false').attr("tabIndex","-1").blur();toShow.prev().attr('aria-expanded','true').attr("tabIndex","0").focus();},_completed:function(cancel){var o=this.options;this.running=cancel?0:--this.running;if(this.running)return;if(o.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""});}
this.toHide.removeClass("ui-accordion-content-active");this._trigger('change',null,this.data);}});$.extend($.ui.accordion,{version:"1.8.2",animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
if(!options.toShow.size()){options.toHide.animate({height:"hide"},options);return;}
var overflow=options.toShow.css('overflow'),percentDone=0,showProps={},hideProps={},fxAttrs=["height","paddingTop","paddingBottom"],originalWidth;var s=options.toShow;originalWidth=s[0].style.width;s.width(parseInt(s.parent().width(),10)-parseInt(s.css("paddingLeft"),10)-parseInt(s.css("paddingRight"),10)-(parseInt(s.css("borderLeftWidth"),10)||0)-(parseInt(s.css("borderRightWidth"),10)||0));$.each(fxAttrs,function(i,prop){hideProps[prop]='hide';var parts=(''+$.css(options.toShow[0],prop)).match(/^([\d+-.]+)(.*)$/);showProps[prop]={value:parts[1],unit:parts[2]||'px'};});options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{step:function(now,settings){if(settings.prop=='height'){percentDone=(settings.end-settings.start===0)?0:(settings.now-settings.start)/(settings.end-settings.start);}
options.toShow[0].style[settings.prop]=(percentDone*showProps[settings.prop].value)+showProps[settings.prop].unit;},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","");}
options.toShow.css("width",originalWidth);options.toShow.css({overflow:overflow});options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"easeOutBounce":"swing",duration:options.down?1000:200});}}});})(jQuery);;var eGlobal;var firstClick=new Array(100);var blendStep,slideCurrent;var objToHide,timerFly,flyoverMain,flyoverSelect;var fUnlock=new Array();var fUnlockAnchor=new Array();function firstRemove(x){for(i=1;i<firstClick.length;i++)
if(firstClick[i]==x)return;firstClick[firstClick.length]=x;x.value='';return(false);}
function FIND(item){if(window.mmIsOpera)return(document.getElementById(item));if(document.all)return(document.all[item]);if(document.getElementById)return(document.getElementById(item));return(false);}
function setBg(){document.body.style.backgroundPosition=''+(0+eGlobal.offsetLeft)+'px top';}
function getAbsolutePosition(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=getAbsolutePosition(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}
return r;}
function hideObj(){if(objToHide)objToHide.style.display='none';clearTimeout(timerFly);}
function hideFlyoverMain(){objToHide=flyoverMain;timerFly=setTimeout(hideObj,500);}
function showFlyoverMain(){flyoverMain.style.display='block';clearTimeout(timerFly);}
function hideFlyoverSelect(){objToHide=flyoverSelect;timerFly=setTimeout(hideObj,500);}
function showFlyoverSelect(){obj=FIND('anchorDrop');x=getAbsolutePosition(obj).x;y=getAbsolutePosition(obj).y;flyoverSelect.style.top=''+(y+obj.clientHeight+1)+'px';flyoverSelect.style.left=''+x+'px';flyoverSelect.style.marginLeft='0';flyoverSelect.style.display='block';clearTimeout(timerFly);}
function flyoversMainInit(){x=FIND('anchorFlyMain');flyoverMain=FIND('fly_main');if(x&&flyoverMain){x.onmouseover=showFlyoverMain;x.onmouseout=hideFlyoverMain;flyoverMain.onmouseover=showFlyoverMain;flyoverMain.onmouseout=hideFlyoverMain;}
x=FIND('anchorDrop');flyoverSelect=FIND('fly_select');if(x&&flyoverSelect){x.onmouseover=showFlyoverSelect;x.onmouseout=hideFlyoverSelect;flyoverSelect.onmouseover=showFlyoverSelect;flyoverSelect.onmouseout=hideFlyoverSelect;}}
function fUnlockDisplay1(){$j('#f_unlock_1').css('display','block')
$j('#f_unlock_2').css('display','none')
$j('#f_unlock_3').css('display','none')
if(x=FIND('b_unlock_my_phone')){x.style.backgroundPosition='-170px 0';x.style.cursor='default';x.disabled=true;}
if(fUnlockAnchor[1])fUnlockAnchor[1].focus();}
function fUnlockDisplay2(val,val1){$j('#f_unlock_1').css('display','none')
$j('#f_unlock_2').css('display','block')
$j('#f_unlock_3').css('display','none')
document.getElementById('manu_id').value=val;document.getElementById('manu_nam').value=val1;getGSMModel(val);if(document.getElementById('manuname')!=null)
{document.getElementById('manuname').innerHTML='&bull; '+val1+'&nbsp;&nbsp;<a href="#1" onclick="fUnlockDisplay1();">[x] clear</a>';}
else if(document.getElementById('manu_name')!=null)
{document.getElementById('manu_name').innerHTML='<b>'+val1+'</b>&nbsp;&nbsp;<a href="#1" onclick="fUnlockDisplay1();">[x] clear</a>';}
if(x=FIND('b_unlock_my_phone')){x.style.backgroundPosition='-170px 0';x.style.cursor='default';x.disabled=true;}
if(fUnlockAnchor[2])fUnlockAnchor[2].focus();}
function fUnlock_Display2(val,val1){$j('#f_unlock_1').css('display','none')
$j('#f_unlock_2').css('display','block')
$j('#f_unlock_3').css('display','none')
document.getElementById('manu_id').value=val;document.getElementById('manu_nam').value=val1;if(document.getElementById('manuname')!=null)
{document.getElementById('manuname').innerHTML=val1+'&nbsp;&nbsp;<a href="#" onclick="fUnlockDisplay1();">[x] clear</a>';}
else if(document.getElementById('manu_name')!=null)
{document.getElementById('manu_name').innerHTML='<b>'+val1+'</b>&nbsp;&nbsp;<a href="#" onclick="fUnlockDisplay1();">[x] clear</a>';}
if(x=FIND('b_unlock_my_phone')){x.disabled=false;x.style.cursor='default';x.style.display='block';}
if(fUnlockAnchor[2])fUnlockAnchor[2].focus();}
function fUnlock_Display22(val){if(val.indexOf(':')!=-1){var arr=val.split(":");mval=arr[0];modname=arr[1];$j('#f_unlock_1').css('display','none')
$j('#f_unlock_2').css('display','block')
$j('#f_unlock_3').css('display','none')
document.getElementById('manu_id').value=mval;document.getElementById('manu_nam').value=modname;getGSMModel(mval);if(document.getElementById('manuname')!=null)
{document.getElementById('manuname').innerHTML=modname+'&nbsp;&nbsp;<a href="#" onclick="fUnlockDisplay1();fUnlockDisplay22return(); return false">[x] clear</a>';}
else if(document.getElementById('manu_name')!=null)
{document.getElementById('manu_name').innerHTML='<b>'+modname+'</b>&nbsp;&nbsp;<a href="#" onclick="fUnlockDisplay1();fUnlockDisplay22return(); return false">[x] clear</a>';}
if(x=FIND('b_unlock_my_phone')){x.disabled=true;}
if(fUnlockAnchor[2])fUnlockAnchor[2].focus();}}
function fUnlockDisplay22return(val){if(document.getElementById('manufacturer-general')){document.getElementById('manufacturer-general').style.display='block'}
if(document.getElementById('manufacturer-models'))
document.getElementById('manufacturer-models').innerHTML='';}
function fUnlockDisplay3(val){var arr=val.split(":");mval=arr[0];modname=arr[1];url=arr[2];url_rest=arr[3];if(x=FIND('b_unlock_my_phone')){x.style.backgroundPosition='0 0';x.style.cursor='pointer';x.disabled=false;x.style.display='block';}else{var url_needed=url_rest.split("/shop/");window.location.href=url_needed[1];return;}
$j('#f_unlock_1').css('display','none')
fUnlock[2].style.display='none';fUnlock[3].style.display='block';document.getElementById('model_id').value=mval;var mn1=document.getElementById('manu_id').value;var mn2=document.getElementById('manu_nam').value;if(document.getElementById('manuname1')!=null)
{document.getElementById('manuname1').innerHTML=document.getElementById('manuname').innerHTML+"<dl><dt>Model</dt><dd>&bull; "+modname+"&nbsp;<a href='#2' onclick=fUnlockDisplay2("+mn1+",'"+mn2+"');>[x] clear</a></dd></d1>";}
else if(document.getElementById('manuname2')!=null)
{document.getElementById('manuname2').innerHTML=document.getElementById('manu_name').innerHTML;document.getElementById('modname2').innerHTML="<b>&gt;&nbsp;&nbsp;"+modname+"</b>&nbsp;&nbsp;<a href='#' onclick=fUnlockDisplay2("+mn1+",'"+mn2+"');>[x] clear</a>";}}
function unlockNowInit(){for(i=1;i<=3;i++){fUnlock[i]=FIND('f_unlock_'+i);if(!fUnlock[i])return(false);}
fUnlockAnchor[1]=FIND('anchorDrop');fUnlockAnchor[2]=FIND('modelSelect');if(fUnlockAnchor[2])fUnlockAnchor[2].onchange=fUnlockDisplay3;fUnlockDisplay1();}
function setDefaults(){if(eGlobal=FIND('global')){setBg();window.onResize=setBg;}
flyoversMainInit();unlockNowInit();}
function umpFilterManufacture(val){if(val.indexOf(':')!=-1){var arr=val.split(":");mval=arr[0];modname=arr[1];$j('table#tab_compare').hide()
$j('#product_display').append('<div id="ajax-preloader" style="width:670px;"><div style="overflow:hidden;"><div style="width:6px; float:left;"></div><div ></div><div style="width:6px; float:right;"></div></div><div align="center" style="overflow:hidden; "><div style="width:700px;"><div id="row" align="center" style="width:100%;height:225px; font-size:16px; color:#000000; margin-top:100px;" class="product-bottom123"><img src="images/ajax_loader/ajax-loader.gif" alt="GSM Liberty" style="vertical-align:middle;" title="GSM Liberty" border="0" />&nbsp;<span class="manuf">Loading.........</span></div></div></div><div style="clear:both;"></div></div>');var i=0
$j('table#tab_compare_filter').hide().html('');var tr=$j('<tr>')
$j("#tab_compare td.product.m_id_"+mval+"").each(function(index,element){td=$j(element).clone()
tr.append(td);i=i+1
if(i==3){$j('table#tab_compare_filter').append(tr)
i=0
tr=$j('<tr>')}})
if(i!=0)$j('table#tab_compare_filter').append(tr)
$j('#ajax-preloader').remove();$j('table#tab_compare_filter').show()
$j("#tab_compare_filter td.product input:checkbox").click(function(){$j('table#tab_compare #'+$j(this).attr('id')).get(0).checked=this.checked})}else{$j('table#tab_compare_filter').hide()
$j('table#tab_compare').show()}}
function fget_Attributes_Values(attributeId,pId,taxId){if(attributeId==0){document.getElementById('turnaroundId').style.display='none';document.getElementById('turnaroundId2').style.display='none';document.getElementById('priceId').style.display='none';return true;}
getAttributesValues(attributeId,pId,taxId);}
function fget_Attributes_Values_old(attributeId,pId,taxId){if(attributeId==0){document.getElementById('turnaroundId').style.display='none';if(document.getElementById("turnaroundId2")){document.getElementById('turnaroundId2').style.display='none';}
document.getElementById('priceId').style.display='none';return true;}
getAttributesValuesOld(attributeId,pId,taxId);}
function fget_Attributes_Values_New(attributeId,pId,taxId){if(attributeId==0){$j('#helptext').html("<p>Please enter phone IMEI and select Carrier for pricing and turnaround time</p>");$j('#helptext').show();$j('#priceInfo').hide();$j('#turnaroundId').html("&nbsp;&nbsp;&nbsp;");$j('#priceId').html("&nbsp;&nbsp;&nbsp;");$j('#cartButton').attr("className","btt btt-add-to-cart-disabled");return true;}
getAttributesValuesNew(attributeId,pId,taxId);}
function fUnlock_Display22_Nokia_Unlock(val){getGSMModelNokiaUnlcok(val);}
function fUnlock_Models(val,section){getUnlcokModels(val,section);}
window.onload=setDefaults;;$j=jQuery.noConflict();function getXMLObject()
{var requestObj;if(window.XMLHttpRequest){requestObj=new XMLHttpRequest();}
else if(window.ActiveXObject){requestObj=new ActiveXObject("Microsoft.XMLHTTP");}
return requestObj;}
function voteLink(str,link_id)
{var requestObj=getXMLObject();if(requestObj)
{var url="rate_link.php?str="+str+"&link_id="+link_id;requestObj.open("GET",url,true);requestObj.onreadystatechange=function()
{if(requestObj.readyState==4&&requestObj.status==200)
{var str_image=requestObj.responseText;document.getElementById('lnk'+link_id).innerHTML=str_image;document.getElementById('rate_Lnk'+link_id).innerHTML='';document.getElementById('rate_Lnk1'+link_id).innerHTML='';}}
requestObj.send(null);}}
function checkVideo(obj)
{var MsgStr="Sorry, we cannot complete your request.\nPlease provide us the missing or incorrect information below:\n\n";var str="";if(obj.video_title.value==""){str+="Video title shouldn't be blank.\n";}
if(obj.video_url.value==""){str+="Video URL shouldn't be blank.\n";}
if(str!=''){alert(MsgStr+str);return false;}else{return true;}}
function rate_video(rate_point,video_id)
{var requestObj=getXMLObject();if(requestObj)
{var url="rate_video.php?rate_point="+rate_point+"&video_id="+video_id;requestObj.open("GET",url,true);requestObj.onreadystatechange=function()
{if(requestObj.readyState==4&&requestObj.status==200)
{var str_image=requestObj.responseText;var imagename=str_image.split('~',3);document.getElementById('current_rating').innerHTML=imagename[0];document.getElementById('rating_no').innerHTML="("+imagename[2]+" out of 5)";if(imagename[1]==0){document.getElementById('voted').innerHTML="You have already rated this phone video.";}}}
requestObj.send(null);}}
function checkForm(){var error=0;var error_message="Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n";var review=document.product_reviews_write.review.value;if(review.length<50){error_message=error_message+"\n* The \'Review Text\' must have at least 50 characters.";error=1;}
if(error==1){alert(error_message);return false;}else{return true;}}
function selectionChange(delta,aid,grp,products_id)
{var requestObj=getXMLObject();if(requestObj)
{var url="accessories_helper.php?query="+delta+","+aid+","+grp+","+products_id;requestObj.open("GET",url,true);requestObj.onreadystatechange=function()
{if(requestObj.readyState==4&&requestObj.status==200)
{var sum=requestObj.responseText;document.getElementById('summary').innerHTML=sum;}}
requestObj.send(null);}}
function phone_finder_update(url,string)
{var xmlHttp=getXMLObject();document.getElementById('product_display').innerHTML='<div id="featuredProd"><div style="width:670px;"><div style="overflow:hidden;"><div style="width:6px; float:left;"></div></div><div align="center" style="overflow:hidden; "><div style="width:700px;"><div style="width:100%;height:225px; font-size:16px; color:#000000; margin-top:100px;"><img src="images/ajax_loader/ajax-loader.gif" alt="GSM Liberty" style="vertical-align:middle;" title="GSM Liberty" border="0" />&nbsp;Loading.........</div><div style="clear:both; height:9px;"></div></div><div style="clear:both"></div></div></div><div style="overflow:hidden;"><div style="width:11px; float:left;"></div><div style=" float:left; width:700px; height:13px;"></div><div style="width:11px; float:right;"></div></div><div style="clear:both; height:15px;"></div></div>';if(xmlHttp)
{var manf=document.getElementById('manufacturer_id').value;url=url+"?counter="+string+"&mn="+manf;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=function()
{if((xmlHttp.readyState==4)&&(xmlHttp.status==200))
{phoneUupdateChanged(xmlHttp.responseText);}}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function phoneUupdateChanged(result)
{var strAccess=result.split('<>',9);var features_id='feature'+strAccess[3];var fea_idd='fea'+strAccess[3];var range_id='range'+strAccess[6];var r_id='r'+strAccess[6];var idsarr=strAccess[7].split(':');var idslen=idsarr.length;var imgname="images/box.jpg";var bgcol="#F2F2F4";document.getElementById('product_display').innerHTML=strAccess[0];if(strAccess[6])
{document.getElementById(range_id).innerHTML='<img src="'+strAccess[4]+'"  border="none" />';for(var i=0;i<(idslen-1);i++)
{var rowid=idsarr[i];document.getElementById('range'+rowid).innerHTML='<img src="'+imgname+'"  border="none" />';}}
else
{document.getElementById(features_id).innerHTML='<img src="'+strAccess[4]+'"  border="none" />';}
document.getElementById('dispTab').innerHTML=strAccess[8];}
function unlock_mobile_tabs(url,str,divID)
{var requestObj=getXMLObject();document.getElementById('product_display').innerHTML='<div style="width:670px;;"><div style="overflow:hidden;"><div style="width:6px; float:left;"></div><div ></div><div style="width:6px; float:right;"></div></div><div align="center" style="overflow:hidden; "><div style="width:700px;"><div id="row" align="center" style="width:100%;height:225px; font-size:16px; color:#000000; margin-top:100px;" class="product-bottom123"><img src="images/ajax_loader/ajax-loader.gif" alt="GSM Liberty" style="vertical-align:middle;" title="GSM Liberty" border="0" />&nbsp;<span class="manuf">Loading.........</span></div></div></div><div style="clear:both;"></div></div>';if(requestObj)
{mnid=document.getElementById('manufacturer_id').value;url=url+"?q="+str+"&m="+mnid;url=url+"&sid="+Math.random();requestObj.onreadystatechange=function()
{if((requestObj.readyState==4)&&(requestObj.status==200))
{chengedTab(requestObj.responseText);}}}
requestObj.open("GET",url,true);requestObj.send(null);}
function chengedTab(result)
{var strAccess=result.split('~',2);document.getElementById('dispTab').innerHTML=strAccess[0];if(strAccess[1]!=undefined)
document.getElementById('product_display').innerHTML=strAccess[1];else
document.getElementById('product_display').innerHTML='<div>No products in this category.</div>';$j('#anchorDrop').trigger('change');}
function calculate_checkout_shipping(url,str,thisvalue,divID)
{var xmlHttp=getXMLObject();if(xmlHttp)
{url=url+"?q="+str+'&countryCode='+thisvalue;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=function()
{if((xmlHttp.readyState==4)&&(xmlHttp.status==200))
{var strShip=xmlHttp.responseText
var strShipCal=strShip.split('~',2);$j('#shiping_prices').html(strShipCal[0])
$j('#cartTotal').html('---')
$j('#shipPrice').html()
$j('#shiping_prices').trigger('change');}}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function shippingPriceDisplay(url,str,divID)
{var xmlHttp=getXMLObject();if(xmlHttp)
{url=url+"&qString="+str;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=function()
{if((xmlHttp.readyState==4)&&(xmlHttp.status==200))
{alert(xmlHttp.responseText);document.getElementById(shipPrice).innerHTML=result;}}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function get_accessories(strURL,str_id,divID)
{var requestObj=getXMLObject();if(requestObj)
{var url=strURL+"?str_id="+str_id;url=url+"&sid="+Math.random();requestObj.open("GET",url,true);requestObj.onreadystatechange=function()
{if(requestObj.readyState==4&&requestObj.status==200)
{var strResponse=requestObj.responseText;var divDispId=divID+str_id;document.getElementById(divDispId).innerHTML=strResponse;}}
requestObj.send(null);}}
function getGSMModel()
{var manufacturers_id=document.getElementById('manu_id').value;var requestObj;requestObj=getXMLObject();if(requestObj)
{var url="manufacturer_product.php?manufacturers_id="+manufacturers_id;var funlock=document.getElementById('f_unlock_2');requestObj.open("GET",url,true);requestObj.onreadystatechange=function()
{if(requestObj.readyState==4&&requestObj.status==200)
{document.getElementById('loader').style.display='none';document.getElementById('lbl1').innerHTML='Select your model';var obj=eval("("+requestObj.responseText+")");document.getElementById('modname1').innerHTML=obj.select;if(document.getElementById('manufacturer-general')){document.getElementById('manufacturer-general').style.display='none';}
if(document.getElementById('manufacturer-models')){document.getElementById('manufacturer-models').innerHTML=obj.list;}}else{document.getElementById('loader').style.display='block';;}}
requestObj.send(null);}}
function AllMobilePhones(url,path)
{var requestObj1;requestObj1=getXMLObject();if(requestObj1)
{var url=url;}
requestObj1.open("GET",url,true);requestObj1.onreadystatechange=function()
{if(requestObj1.readyState==4&&requestObj1.status==200)
{window.location.href=path;}}
requestObj1.send(null);}
function popupWindow(url){window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=150,screenX=150,screenY=150,top=150,left=150')}
function removeDiv()
{document.getElementById('fly_main').style.display="none";}
function searchRemove(x){if((x.value=='find it here...')||(x.value=='find it here...')){x.value='';}}
function searchField(x){if(x.value==''){x.value='find it here...';}}
$j(document).ready(function(){$j('#tabs>div').hide();$j('#tabs>div:first').show();$j('#tabs>ul li:first').addClass('active');$j('#tabs>ul li a').click(function(){$j('#tabs>ul li').removeClass('active');$j(this).parent().addClass('active');var currentTab=$j(this).attr('href');$j('#tabs>div').hide();$j(currentTab).show();return false;});if($j('#shiping_prices').get(0)){$j('#shiping_prices').change(function(){result=$j(this).val()
if(result.indexOf('---')!=-1){var amount=result.split('---',2);var amountNumeric=parseFloat(amount[1].replace(/[^0-9\.]/g,''))
var totalNumeric=$j('#subtotal').html()
totalNumeric=parseFloat(totalNumeric.replace(/[^0-9,\.]/g,''))+amountNumeric
$j('#shipPrice').html(amount[1])
$j('#cartTotal').html("$"+totalNumeric)}else{$j('#cartTotal').html('---')
$j('#shipPrice').html()}});}
$j(function(){$j('form.f_top .inp').keydown(function(){var input=$j('.inp input').val();if((input.length==1)&&($j('.close').length==0)){$j(this).append($j('<div class="close"></div>'));}else if(input.length==0){$j('.close').remove();}});$j('form.f_top .inp').keyup(function(){var input=$j('.inp input').val();if((input.length==1)&&($j('.close').length==0)){$j(this).append($j('<div class="close"></div>'));}else if(input.length==0){$j('.close').remove();}});$j('form.f_top .close').live('click',function(){$j('.inp input').val('find it here..');$j(this).remove();});maxHeight=220;minHeight=17;$j('#rc .good_know .fold').mouseenter(function(){$j(this).siblings().stop().animate({height:minHeight+"px"},{queue:false,duration:300},function(){}).find('a.title').removeClass('active');$j(this).stop().animate({height:maxHeight+"px"},{queue:false,duration:300}).find('a.title').addClass('active');});$j('#rc .good_know .fold:first').trigger('mouseenter');var previous_id=1;$j('#slider').jCarouselLite({visible:1,speed:800,circular:true,auto:60000,btnGo:["#sliderButton1","#sliderButton2","#sliderButton3"],beforeStart:function(li){if(previous_id)
$j('#sliderButton'+previous_id).css('background-position','left top');},afterEnd:function(li){var id=li.children('a').attr('href').substr(1,2);$j('#sliderButton'+id).css('background-position','right top');previous_id=id;},pauseOnHover:true});maxWidth=87;minWidth=0;$j("ul.pfinder li").mouseenter(function(){$j(this).siblings().animate({width:minWidth+"px"},{queue:false,duration:400});$j(this).siblings().children('div.in').animate({width:minWidth+"px"},{queue:false,duration:400});$j(this).animate({width:maxWidth+"px"},{queue:false,duration:400});$j(this).children('div.in').animate({width:maxWidth+"px"},{queue:false,duration:400});});$j('#mycarousel').jCarouselLite({btnNext:".jcarousel-next",btnPrev:".jcarousel-prev",circular:false,vertical:true,scroll:1,visible:2,mouseWheel:true});$j('#cart_quantity').validate();$j(".tool_tip").hide();$j("#give_hints").mouseover(function(){$j(".tool_tip").show("slow");});$j('#service_guarantee_modal').jqm();if($j('#summary_box').get(0)){$j(window).scroll(function(){var box=$j('#summary_box').get(0);var boxh=box.offsetHeight
var h=$j(this).scrollTop()+boxh
var limit=$j('#lc').get(0).offsetHeight
if(h>limit&&$j(box).css('position')=='fixed'){$j(box).css('position','absolute').css('marginTop',$j(box).position().top+boxh)
$j(box).animate({marginTop:limit-box.offsetHeight})}
if(h<=limit&&$j(box).css('position')=='absolute'){$j(box).css('marginTop',0).css('position','fixed')}});}});});function goforward(ismenu)
{if(ismenu){var manufac_id=document.getElementById('finder-phone-brand').value;var modelidArray=document.getElementById('finder-phone-model').value.split(":");}
else{var manufac_id=document.getElementById('get-code-manufacturer').value;var modelidArray=document.getElementById('get-code-phone').value.split(":");}
var modelid=modelidArray[0];window.location.href="product_model_info.php?&model_id="+modelid;}
function getAttributesValues(val1,val2,val3){$j('#carrier-attributes-loader').show();var attribute_id=val1;var product_id=val2;var tax_id=val3;var url="group_attributes.php?attribute_id="+attribute_id+"&product_id="+product_id+"&tax_id="+tax_id;$j.ajax({url:url,context:document.body,success:function(returneddata){var content=returneddata.split("%-%-");$j('#carrier-attributes-loader').hide();$j('#turnaroundId').show();$j('#priceId').show();$j('#turnaroundId2').show();$j('#turnaroundId').html(content[0]);$j('#priceId').html(content[1]);$j('#turnaroundId2').html(content[2]);}});}
function getAttributesValuesOld(val1,val2,val3){$j('#carrier-attributes-loader').show();var attribute_id=val1;var product_id=val2;var tax_id=val3;var url="group_attributes_old.php?attribute_id="+attribute_id+"&product_id="+product_id+"&tax_id="+tax_id;$j.ajax({url:url,context:document.body,success:function(returneddata){var content=returneddata.split("%-%-");$j('#carrier-attributes-loader').hide();$j('#turnaroundId').show();$j('#priceId').show();if(document.getElementById("turnaroundId2")){$j('#turnaroundId2').show();}
$j('#turnaroundId').html(content[0]);$j('#priceId').html(content[1]);if(document.getElementById("turnaroundId2")){$j('#turnaroundId2').html(content[2]);}}});}
function getAttributesValuesNew(val1,val2,val3){var is_price_info_show_once=false;if(!is_price_info_show_once){$j('#helptext').html("<img src='images/ajax-loader.gif'/>");}
$j('#infoId').hide();$j('#turnaroundId').html("<img src='images/ajax-loader.gif'/>&nbsp;&nbsp;&nbsp;");$j('#priceId').html("<img src='images/ajax-loader.gif'/>&nbsp;&nbsp;&nbsp;");$j('#infoId').hide();var attribute_id=val1;var product_id=val2;var tax_id=val3;var url="group_attributes_new.php?attribute_id="+attribute_id+"&product_id="+product_id+"&tax_id="+tax_id;$j.ajax({url:url,context:document.body,success:function(returneddata){$j('#helptext').hide();is_price_info_show_once=true;var content=returneddata.split("%-%-");$j('#priceInfo').show();$j('#turnaroundId').html(content[0]);$j('#priceId').html(content[1]);$j('#turnaroundid2').html(content[2]);$j('#infoId').show();$j('#cartButton').attr("className","btt btt-add-to-cart");}});}
function is_valid_imei(str){if(str.match('^[0-9]{15}$')){return true;}
else{return false;}}
function closewindow(e){if(e.keyCode==27){$j("#mod-method").hide();$j("#mod-time").hide();$j("#mod-type").hide();$j("#mod-guarantees").hide();$j("#mod-imei").hide();}}
function check_compatabilty(url,val1,val2,val3){$j('#carrier-supported-status').html("<img src='images/ajax-loader.gif'/>");var finalUrl=url+"?carrier_to_be_used="+val1+"&product_model_id="+val2;$j.ajax({url:finalUrl,context:document.body,success:function(returneddata){$j("#carrier-supported-status").html(returneddata);}})}
function getGSMModelNokiaUnlcok(val)
{var manufacturers_id=val;var url="manufacturer_product_nokia_unlock.php?manufacturers_id="+manufacturers_id;$j.ajax({url:url,context:document.body,success:function(returneddata){$j("#phModel").html(returneddata);}});}
function close_nokia_unlock_window(e){if(e.keyCode==27){$j("#mod-imei").hide();}}
function getUnlcokModels(val,section){var manufacturers_id=val;ismenu=section;var url="manufacturer_products_for_menu.php?manufacturers_id="+manufacturers_id+"&section="+ismenu;$j.ajax({url:url,context:document.body,success:function(returneddata){if(ismenu){$j("#menu-phone-model").html(returneddata);set_jquery_refresh("for_model");}
else{jQuery("#get-code-phone").html(returneddata);}}});}
function getCarriers(val,section){var product_id=val;ismenu=section;var url="products_carriers_for_menu.php?products_id="+product_id+"&section="+ismenu;$j.ajax({url:url,context:document.body,success:function(returneddata){if(ismenu){document.getElementById('menu-carrier').className="field";$j("#menu-carrier").html(returneddata);set_jquery_refresh("for_carrier");}
else{$j("#get-code-carrier-phone").html(returneddata);}}});}
function goforward_2(ismenu)
{if(ismenu){var model_id=document.getElementById('modelSelect').value;}
m_id=new Array();m_id=model_id.split(":");var modelid=parseFloat(model_id);window.location.href="product_model_info.php?&model_id="+m_id[0];}
function goforward_1(ismenu)
{if(ismenu){var model_id=document.getElementById('model_id_field').innerHTML;}
var modelid=parseFloat(model_id);window.location.href="product_model_info.php?&model_id="+modelid;};var divID;function getXmlHttpRequestObject(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}else{alert("Your browser doesn't support Ajax. Some parts of our website will not be accessible.");}}
function ajaxFunction(url,str,divID)
{xmlHttp=getXmlHttpRequestObject();document.getElementById(divID).innerHTML="<div style=\"padding:5px 0px 0px 0px \"/><img src=image/ajax_loader/ajax-loader.gif> Updating ... </div />";url=url+"?q="+str;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4)
{stateChanged(divID);}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function stateChanged(divID)
{document.getElementById(divID).innerHTML=xmlHttp.responseText;}
function ajaxFunction()
{var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
return xmlHttp;}
function searchSuggest()
{var x=1;var searchReq=ajaxFunction();if((searchReq.readyState==4)||(searchReq.readyState==0))
{var str=document.quick_find.keywords.value;searchReq.open("GET","ajax_searchSuggest.php?search="+str,true);searchReq.onreadystatechange=function()
{if(searchReq.readyState==4)
{var ss=document.getElementById('fly_main');ss.style.display='block';ss.innerHTML='<div class="close" onClick="removeDiv();"></div>';var str1=searchReq.responseText.split("&&");var suggest="";for(j=0;j<str1.length;j++)
{var str2=str1[j].split("\n");if(j==0)
suggest+='<h5>Find in Unlocked Phones</h5>';if(j==1)
suggest+='<h5>Find in Unlock Codes</h5>';if(j==2)
suggest+='<h5>Other Results</h5>';suggest+='<div>';var undef=0;for(i=0;i<((5)-1);i++)
{if((str2[i]!="")&&(str2[i]!=undefined))
{var content=str2[i].split("%^%");suggest+='<a href="'+content[1]+'">'+content[0]+'</a>';undef++;}}
if(undef==0)suggest+='<p>No results found</p>';suggest+='</div>';}
document.getElementById('defstr').value=searchReq.responseText;suggest+='<h5><i><a href="http://www.gsmliberty.net/shop/advanced_search.php?keywords='+str+'" onclick="javascript:moreResults();">See More Search Results >></a></i></h5>';ss.innerHTML+=suggest;}}
searchReq.send(null);}}
function moreResults()
{$newstr=document.getElementById('defstr').value;document.getElementById('fly_main').style.display='';var sss=document.getElementById('fly_main');sss.innerHTML='';var str1=$newstr.split("&&");var suggest="";for(j=0;j<str1.length;j++)
{var str=str1[j].split("\n");if(j==0)
suggest+='<h5>Find in Unlocked Phones</h5>';if(j==1)
suggest+='<h5>Find in Unlock Codes</h5>';if(j==2)
suggest+='<h5>Other Results</h5>';suggest+='<div>';for(i=0;i<((str.length)-1);i++)
{if((str[i]!="")&&(str[i]!=undefined))
{var content=str[i].split("%^%");suggest+='<a href="'+content[1]+'" onclick="location.href(\"'+content[1]+'\");">'+content[0]+'</a>';}}
suggest+='</div>';}
sss.innerHTML+=suggest;}
function suggestOver(div_value)
{div_value.className='suggest_link_over';}
function suggestOut(div_value)
{div_value.className='suggest_link';}
function setSearch(value){document.quick_find.keywords.value=value;document.getElementById('fly_main').style.display='none';};function manageCompareList(pid)
{if(document.getElementById('cid'+pid).checked)
{if(addToCompate(pid)==false)
{document.getElementById('cid'+pid).checked=false;}}
else
{RemoveFromCompate(pid);}}
function addToCompate(prod_id)
{var StrMsg="Sorry! We can't complete your request. \nThe following information is incomplete or missing:\n";var numberOfProd=document.getElementById('noOfProd').value;var productsIds=document.getElementById('products_ids').value;if(productsIds!=""){var productAdded_ids=productsIds.split(':');if(productAdded_ids.length>3)
{var msg="Sorry! We can't complete your request.\n You are not allowed to compare more than 4 results:\n";alert(msg);return false;}
for(var i=0;i<productAdded_ids.length;i++)
{if(productAdded_ids[i]==prod_id){var msg="\nYou have already added this product to your compare list.";alert(StrMsg+msg);return false;}}}
if((numberOfProd!="")&&(productsIds!="")){numberOfProd=parseInt(numberOfProd)+1;productsIds=productsIds+':'+prod_id;}else{numberOfProd=1;productsIds=prod_id;}
document.getElementById('products_ids').value=productsIds;var xmlHttp=getXMLObject();if(xmlHttp)
{url="setBasket_ids.php?ids="+productsIds;url=url+'&rand='+Math.random();xmlHttp.onreadystatechange=function()
{if((xmlHttp.readyState==4)&&(xmlHttp.status==200))
{IdsUupdateChanged(xmlHttp.responseText);}}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function IdsUupdateChanged(result)
{var arr=result.split(':');var len=arr.length;document.getElementById('noOfProd').value=len;}
function RemoveFromCompate(prod_id)
{var StrMsg="Sorry! We can't complete your request. \nThe following information is incomplete or missing:\n";var numberOfProd=document.getElementById('noOfProd').value;var productsIds=document.getElementById('products_ids').value;var productsIdsnew="";if(productsIds!=""){var productAdded_ids=productsIds.split(':');for(var i=0;i<productAdded_ids.length;i++)
{if(productAdded_ids[i]!=prod_id){if(productsIdsnew!="")
productsIdsnew=productsIdsnew+':'+productAdded_ids[i];else
productsIdsnew=productAdded_ids[i];}}}
if(numberOfProd!=1)
numberOfProd=parseInt(numberOfProd)-1;else
numberOfProd="";document.getElementById('products_ids').value=productsIdsnew;var xmlHttp=getXMLObject();if(xmlHttp)
{url="setBasket_ids.php?ids="+productsIdsnew;url=url+'&rand='+Math.random();xmlHttp.onreadystatechange=function()
{if((xmlHttp.readyState==4)&&(xmlHttp.status==200))
{IdsUupdateChanged(xmlHttp.responseText);}}}
xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function checkNoProduct()
{var StrMsg="Sorry! We can't complete your request. \nThe following information is incomplete or missing:\n";var msg="\nAt least two product should be selected for its comparision.";var queryString;var noOfProd=document.getElementById('noOfProd').value;var products_ids=document.getElementById('products_ids').value;if((noOfProd=="")||(noOfProd==1))
{alert(StrMsg+msg);return false;}
else
{var prod_ids=products_ids.split(':');for(var i=0;i<prod_ids.length;i++){if(i==0){queryString="?products_id"+i+"="+prod_ids[i];}else{queryString+="&products_id"+i+"="+prod_ids[i];}}
window:location.href="compared_products.php"+queryString;return true;}}
function getFeaturedProduct(value){if(document.getElementById(value).style.visibility!="hidden"){document.getElementById(value).style.visibility="hidden";document.getElementById(value).style.display="none";}
else if(document.getElementById(value).style.visibility=="hidden"){document.getElementById(value).style.visibility="visible";document.getElementById(value).style.display="block";}}
function getPriceList(list)
{if(document.getElementById(list).style.visibility!="hidden"){document.getElementById(list).style.visibility="hidden";document.getElementById(list).style.display="none";}
else if(document.getElementById(list).style.visibility=="hidden"){document.getElementById(list).style.visibility="visible";document.getElementById(list).style.display="block";}}
function hideAll(noOfCat)
{var prod_id;for(var i=1;i<noOfCat+1;i++)
{prod_id=document.getElementById('id'+i).value;document.getElementById(prod_id).style.display='none';document.getElementById(prod_id).style.visibility='hidden';}}
function showAll(noOfCat)
{var prod_id;for(var i=1;i<noOfCat+1;i++)
{prod_id=document.getElementById('id'+i).value;document.getElementById(prod_id).style.display='block';document.getElementById(prod_id).style.visibility='visible';}}
function changeColor(no)
{var no_feat;no_feat=document.getElementById('totfea').value;for(var j=0;j<no_feat;j++)
{var flag="";var flag1="";for(var n=0;n<no;n++)
{flag=document.getElementById('d'+n+'_'+j).innerHTML;if(flag!=""&&(flag!=flag1)&&flag1!="")
{for(var m=0;m<no;m++)
{document.getElementById('d'+m+'_'+j).style.backgroundColor="#FFFCCC";}
document.getElementById('highlight_row').value="yes";}
var flag1=flag;}}
document.getElementById('highlight').style.display='none';document.getElementById('hide').style.display='';}
function colorRemove(no)
{var no_feat=document.getElementById('totfea').value;for(var j=0;j<no_feat;j++)
{for(var m=0;m<no;m++)
{if(m%2==0)
document.getElementById('d'+m+'_'+j).style.backgroundColor="#FFFFFF";else
document.getElementById('d'+m+'_'+j).style.backgroundColor="#F6F6F6";}}
document.getElementById('highlight_row').value="";document.getElementById('highlight').style.display='';document.getElementById('hide').style.display='none';};(function($){$.fn.dTabs=function(options){var defaults={activeClass:"active",firstTab:true}
options=$.extend(defaults,options);return this.each(function(){var $this=$(this);$(".d-tabs-nav ul li a").each(function(){var tabContent=$(this).attr("href");$(tabContent).css("display","none");$(this).click(function(){$(".d-tabs-nav ul li a").removeClass(options.activeClass);$(this).addClass(options.activeClass);$(".d-tabs-content .d-tabs-content-box").css("display","none");$(tabContent).css("display","block");});});if(options.firstTab==true){$(".d-tabs-nav ul li a:first").addClass(options.activeClass);$(".d-tabs-content .d-tabs-content-box:first").css("display","block");}});}})(jQuery);
