Monday, February 6, 2017

How to fend off hijack of home devices – Deccan Herald

/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement(“a”),bV.href=””,bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!=”string”&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(” “);if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h=”GET”;c&&(f.isFunction(c)?(d=c,c=b):typeof c==”object”&&(c=f.param(c,f.ajaxSettings.traditional),h=”POST”));var i=this;f.ajax({url:a,type:h,dataType:”html”,data:c,complete:function(a ,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f(“

“).append(c.replace(bN,””)).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,”\r\n”)}}):{name:b.name,value:c.replace(bF,”\r\n”)}}).get()}}),f.each(“ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend”.split(” “),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript :function(a,c){return f.get(a,b,c,”script”)},getJSON:function(a,b,c){return f.get(a,b,c,”json”)},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:”GET”,contentType:”application/x-www-form-urlencoded”,processData:!0,async:!0,accepts:{xml:”application/xml, text/xml”,html:”text/html”,text:”text/plain”,json:”application/json, text/javascript”,”*”:bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:”responseXML”,text:”responseText”},converters:{“* text”:a.String,”text html”:!0,”text json”:f.parseJSON,”text xml”:f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||”” ,v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a0&&(q=setTimeout(function(){v.abort(“timeout”)},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s1){ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod) } } //END int() function } //END Prototype assignment function mainmenu(){ $ (” #nav ul “).css({display: “none”}); // Opera Fix $ (” #nav li”).hover(function(){ $ (this).find(‘ul:first’).css({visibility: “visible”,display: “none”}).show(400); },function(){ $ (this).find(‘ul:first’).css({visibility: “hidden”}); }); } $ (document).ready(function(){ mainmenu(); }); //function for removing white spaces function Trim(txt){ if(txt.split(” “).join(“”).length == 0) return true; else return false; } function trim_str(str) { return str.split(” “).join(“”); } //function to alert error messages for text fields function retunMessage(message,fldId) { alert(message); document.getElementById(fldId).focus(); return false; } //function to check empty text fields function nullCheck(fldId,message) { var objValue = document.getElementById(fldId).value; if( (objValue == “”) || (Trim(objValue))) retunMessage(message,fldId); else return true; } //function to check length function checkLen(len,fldId,message) { var objValue = document.getElementById(fldId).value; var length = objValue.length if(length []{}`\;()@$ #%_^”; var string = document.getElementById(fldId).value; var leng = string.length; for(i=0; i;’:”[]\{\}]+)$ /; //only letters and numbers tinyMCE.triggerSave(); var obj = eval(‘document.’ + formname); subject = obj.subject.value; if(!nullCheck(“subject”,”Please enter title”) || !isValidName(‘subject’) ) { return false; } /* alert(“subject=”+subje ct); if( !keyRegex.test(subject)){ alert(“Please enter valid title”); return false; } */ if(countWords(obj.summary.value)>2000){ alert(‘You can enter maximum of 2000 words into the summary’); obj.summary.focus(); return false; } if( (obj.image_type[1].checked) && (obj.image_file.value == ”) && (obj.img_path.value == ”)){ alert(‘Please select photo’); obj.image_file.focus(); return false; } if(obj.image_file.value != ”){ imagePath = obj.image_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image for mats. Your file-type is ” + fileType); return false; } } var s=obj.content.value; if(s.indexOf(‘/g,””); s=s.replace(//g,””); s=s.replace(/[ ]/g,””); } s = s.replace(/ /g,”); s=Trimstr(s); if(s.length==0){ alert(“Please enter the content”) //obj.content.focus(); return false; } if(s.length>35000){ alert(“Please enter the content not more than 35000 characters”) //obj.content.focus(); return false; } if (obj.category_id.value==0){ alert(“Select the category”); obj.category_id.focus(); return false; } if( (obj.publish_date.value != ”) || (obj.publish_end_date.value != ”) ) { var today = new Date(); var month = today.getMonth() + 1; if (month supplements, 69 -> news , 105 -> movie guide if(id == 120 || id == 69 || id == 105 || id == 125 || id == 121 || id == 127 || id == 126 || id == 124 || id == 122 || id == 123){ document.getElementById(‘parent_i d’).disabled = true; }else{ document.getElementById(‘parent_id’).disabled = false; } //document.getElementById(‘parent_id’).selectedIndex = parent_id; //document.formAdd.parent_id.selectedIndex = parent_id; } function resetMessage(){ if(document.getElementById(‘ErrorMessage’)) document.getElementById(‘ErrorMessage’).innerHTML = ”; } function strpos( haystack, needle, offset){ // http://kevin.vanzonneveld.net // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: strpos(‘Kevin van Zonneveld’, ‘e’, 5); // * returns 1: 14 var i = haystack.indexOf( needle, offset ); // returns -1 return i >= 0 ? i : -1; } function showHide(theid){ var browser=navigator.appName; if (browser==’Netscape’){ if (document.getElementById){ var switch_id = document.getElementById(theid); if (switch_id.className != ‘ShowRowFireFox’){ document.getElementById(theid).classNam e = ‘ShowRowFireFox’; } else{ document.getElementById(theid).className = ‘Hide’; } } } else if (document.getElementById){ var switch_id = document.getElementById(theid); if (switch_id.className != ‘Show’){ document.getElementById(theid).className = ‘Show’; } else{ document.getElementById(theid).className = ‘Hide’; } } } //Photo validation function validatePhoto(formname){ var obj = eval(‘document.’ + formname); var id = obj.id.value; if(id > 0){ if(obj.photo_file.value != ”){ imagePath = obj.photo_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only . JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } if(obj.title.value == ”){ alert(“Please enter photo title”); obj.title.focus(); return false; } if (!isValidString(‘title’,’Please enter valid title’)){ return false; } if(obj.copyright.value != ”){ if(obj.copyright.value.length>99) { alert(“Copyright cannot exceed more than 100 characters”); obj.copyright.focus(); return false; } } } else{ if(obj.photo_file.value == ”){ if(obj.photo_file.value == ”){ alert(“Please select photo”); return false; } } if(obj.photo_file.value != ”){ imagePath = obj.photo_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || ( fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } if(obj.title.value == ”){ alert(“Please enter photo title”); obj.title.focus(); return false; } if (!isValidString(‘title’,’Please enter valid title’)){ return false; } if(obj.copyright.value != ”){ if(obj.copyright.value.length>99) { alert(“Copyright cannot exceed more than 100 characters”); obj.copyright.focus(); return false; } } } IGNORE_UNLOAD = true; return true; } function validateWeather(formname){ var obj = eval(‘document.’ + formname); var id = obj.id.value; if(id ==””) { if(!nullCheck(“summary”,”Please enter summary”)) { return false; } if(obj.summary.value != ”){ if(obj.summary.value.length>9999) { alert(“Summary ca nnot exceed more than 10000 characters”); obj.summary.focus(); return false; } } if(obj.temp_max.value != ” && isNaN(obj.temp_max.value)){ alert(“please enter number only as maximum temperature”); return false; } if(obj.temp_min.value != ” && isNaN(obj.temp_min.value)){ alert(“please enter number only as minimum temperature”); return false; } if(obj.image_big.value == ”){ alert(“Please select Detailed page image”); return false; } if(obj.image_big.value != ”){ imagePath = obj.image_big.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(& #8220;Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } if(obj.publish_date.value == ”){ alert(“Please select date”); obj.publish_date.focus(); return false; } } else { if(obj.summary.value == ”){ alert(“Please enter summary”); obj.summary.focus(); return false; } if(obj.summary.value != ”){ if(obj.summary.value.length>9999) { alert(“Summary cannot exceed more than 10000 characters”); obj.summary.focus(); return false; } } if(obj.temp_max.value != ” && isNaN(obj.temp_max.value)){ alert(“please enter number only as maximum temperature”); return false; } if(obj.temp_min.value != ” && isNaN(obj.temp_min.value)){ alert(“please enter number only as minimum temperature”); return false; } if(obj.image_big.value != ”){ imagePath = obj.image_big.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(& #8220;.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } } //} IGNORE_UNLOAD = true; return true; } function validateCartoon(formname){ var obj = eval(‘document.’ + formname); var id = obj.id.value; if(id ==””) { if(obj.title.value == ”){ alert(“Please enter title”); obj.title.focus(); return false; } if(obj.description.value != ”){ if(obj.description.value.length>4999) { alert(“Description cannot exceed more than 5000 characters”); obj.description.focus(); return false; } } if(obj.image_big.value == ”){ alert(“Pleas e select Detailed page image”); return false; } if(obj.image_big.value != ”){ imagePath = obj.image_big.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } if(obj.publish_date.value == ”){ alert(“Please enter date”); obj.publish_date.focus(); return false; } } else { if(obj.title.value == ”){ alert(“Please enter title”); obj.title.focus(); return false; } if(obj.image_big.value != ”){ imagePath = obj.image_big.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } } //} IGNORE_UNLOAD = true; return true; } function checkStartDate(datestr){ var orgdate=datestr.split(‘ ‘); var dte=orgdate[0].split(‘-‘); var dt= new Date(); dt.setFullYear(dte[0]); dt.setMonth(dte[1]-1); dt.setDate(dte[2]); var day=dt.getDate(); var dayofweek=dt.getDay(); if(dayofweek == 0)return true; return false; } function checkEndDate(datestr){ var orgdate=datestr.split(‘ ‘); var dte=orgdate[0].split(‘-‘); var dt= new Date(); dt.setFullYear(dte[0 ]); dt.setMonth(dte[1]-1); dt.setDate(dte[2]); var day=dt.getDate(); var dayofweek=dt.getDay(); if(dayofweek == 6)return true; return false; } function validateDates(obj){ var start_date=obj.start_date.value; var end_date=obj.end_date.value; var year=obj.year.value; var day=obj.day.value; if(!obj.func[0].checked && !obj.func[1].checked && !obj.func[2].checked ){ alert(“Please select Yearly / Weekly / Daily”); return false; } if(obj.func[0].checked){ if(year==”){ alert(‘Please select the year’); return false; } } if(obj.func[1].checked){ if(start_date==”){ alert(‘Select start date (Sunday)’); return false; } if(start_date!=”){ if(!checkStartDate(start_date)){ alert(‘Select valid start date of week(Sunday)’); return false; } } if(end_date==”){ alert(‘Select end date (Saturday)’); return false; } if(end_date!=”){ if(!checkEndDate(end_date)){ alert(‘Select valid end date of we ek(Saturday)’); return false; } } var one_day = 1000 * 60 * 60 * 24 ; var start_dd = start_date.split(” “); var dat1 = start_dd[0].split(“-“); if(dat1[1]7 || days_diff == 0 || days_diff 4999) { alert(“Description cannot exceed more than 5000 characters”); eval(‘obj.description_’+tag+’.focus()’); return false; } } if(obj.start_date.value!=”){ if(eval(‘obj.gem_’+tag+’.value’)==”){ alert(‘Enter ‘+tag+’ gem value’); eval(‘obj.gem_’+tag+’.focus()’); return false; } if(Trim(eval(‘obj.gem_’+tag+’.value’))){ alert(‘Enter ‘+tag+’ valid gem value’); eval(‘obj.gem_’+tag+’.focus()’); return false; } if (!alphanumeric(‘gem_’+tag)){ return false; } } if(eval(‘obj.oldimage_’+tag+’.value’)==”){ if(eval(‘obj.image_’+tag+’. value’)!=”){ imagePath = eval(‘obj.image_’+tag+’.value’); var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“In”+” “+tag+” “+”Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } } if(eval(‘obj.image_’+tag+’.value’)!=”){ imagePath = eval(‘obj.image_’+tag+’.value’); var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“In”+” ” +tag+” “+”Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } //} if(obj.day.value!=” || obj.start_date.value!=” ){ if(eval(‘obj.color_’+tag+’.value’)==”){ alert(‘Enter ‘+tag+’ color value’); eval(‘obj.color_’+tag+’.focus()’); return false; } if(Trim(eval(‘obj.color_’+tag+’.value’))){ alert(‘Enter ‘+tag+’ valid color’); eval(‘obj.color_’+tag+’.focus()’); return false; } if (!alphanumeric(‘color_’+tag)){ return false; } if(eval(‘obj.number_’+tag+’.value’) ==”){ alert(‘Enter ‘+tag+’ number’); eval(‘obj.number_’+tag+’.focus()’); return false; } if(!isInteger(‘number_’+tag)){ //alert(‘Enter ‘+tag+’ number’); //eval(‘obj.number_’+tag+’.focus()’); return false; } } } if(obj.astro_image_id.value == ”){ alert(“please select a astrologer image”); return false; } return true; } function validateRegistration(val) { if(val != ‘1’ && val != ‘2’) { if(!nullCheck(“register_username”,”Please enter user name”) || !checkLen(4,”register_username”,”Username should contain minimum 4 characters”) || !validateUserName(‘register_username’)) { return false; } if(!nullCheck(“register_password”,”Please enter password”) || !checkLen(6,”register_password”,”Password should contain minimum 6 characters ”) || !nullCheck(“cpassword”,”Please enter confirm password”) || !equal(“register_password”,”cpassword”,”Passwords do not Matched”)) return false; } if(val != ‘2’ && val != ‘3’) { if(document.getElementById(‘user_type’) && document.getElementById(‘user_type’).selectedIndex == ‘0’) { alert(“Please select user type”); return false; } } if(!nullCheck(“first_name”,”Please enter first name”) || !alphaSpaceOnly(“first_name”)) { return false; } if(val == ‘4’){ if(!nullCheck(“last_name”,”Please enter last name”) || !alphaSpaceOnly(“last_name”)) { return false; } if(!nullCheck(“email”,”Please enter email”) || !emailValidation(“email”) ) { return false; } if(document.getElementById(‘zip’).value != ”){ var s = document.getElementById(‘zip’).value; if (isNaN(s)) { alert(“Please Enter Numbers Only in Zipcode”); return false; } } } if(document.getElementById(‘phone1_1′).value != ”){ if(!isPhoneValid(“phone1_1″)){ return false; } } if(document.getElementById(‘last_name’).value != ”) { if(!alphaSpaceOnly(“last_name”)) return false; } if(val != ‘4’){ if(!nullCheck(“email”,”Please enter email”) || !emailValidation(“email”) || !isPhoneValid(“phone1_1″)) { return false; } if(document.getElementById(‘address1′).value == ”) { alert(“Please enter address1″); document.getElementById(‘address1′).focus(); return false; } if(document.getElementById(‘country_id’).selectedIndex == ‘0’) { alert(“Please select country”); return false; } if(document.getElementById(‘state_id’) .selectedIndex == ‘0’) { alert(“Please select state”); return false; } if(document.getElementById(‘city_id’).value == ”) { alert(“Please enter city”); document.getElementById(‘city_id’).focus(); return false; } if(!nullCheck(“zip”,”Please enter zip”)) { return false; } } //IGNORE_UNLOAD = true; return true; } function validateChangePassword(frm) { if(frm.current_password.value == ”) { alert(‘Please enter current password’); return false; } if(frm.new_password.value == ”) { alert(‘Please enter new password’); return false; } else if(frm.new_password.value.length 8){ alert(“please enter 8 digits only in bse sensex”); obj.bse_sensex.focus(); return false; } } } else{ alert(“please enter valid bse sensex”); obj.bse_sensex.focus(); return false; } } if(!nullCheck(“bse_difference”,”Please enter bse difference”)) { ob j.bse_difference.focus(); return false; } if(obj.bse_difference.value != ” || Trim(obj.bse_difference.value)){ obj.bse_difference.value = obj.bse_difference.value.split(“,”).join(“”); if(!isNaN(obj.bse_difference.value)){ if(obj.bse_difference.value.lastIndexOf(“.”) == ‘-1′){ if(obj.bse_difference.value.length > 8){ alert(“please enter 8 digits only in bse difference”); obj.bse_difference.focus(); return false; } } } else{ alert(“please enter valid bse difference”); obj.bse_difference.focus(); return false; } } if(!nullCheck(“nse_sensex”,”Please enter nse sensex”)) { obj.nse_sensex.focus(); return false; } if(obj.nse_sensex.value != ” || Trim(obj.nse_sensex.value)){ obj.nse_sensex.value = obj.nse_sensex.value.split(“,”).join(“”); if(!isNaN(obj.nse_sensex.value)){ if(obj.nse_sensex.value.lastIndexOf(“.”) == ‘-1′){ if(obj.nse_se nsex.value.length > 8){ alert(“please enter 8 digits only in nse sensex”); obj.nse_sensex.focus(); return false; } } } else{ alert(“please enter valid nse sensex”); obj.nse_sensex.focus(); return false; } } if(!nullCheck(“nse_difference”,”Please enter nse difference”)) { obj.nse_difference.focus(); return false; } if(obj.nse_difference.value != ” || Trim(obj.nse_difference.value)){ obj.nse_difference.value = obj.nse_difference.value.split(“,”).join(“”); if(!isNaN(obj.nse_difference.value)){ if(obj.nse_difference.value.lastIndexOf(“.”) == ‘-1′){ if(obj.nse_difference.value.length > 8){ alert(“please enter 8 digits only in nse difference”); obj.nse_difference.focus(); return false; } } } else{ alert(“please enter valid nse difference”); obj.nse_difference.focus(); return false; } } var cnt=1; for (var i=0;i 8){ alert(“please enter 8 digits only̶ 1;); return false; } } } else if(trim(obj.elements[i].value) != “NA”){ alert(“please enter valid price”); return false; } } cnt++; } } if(!nullCheck(“publish_date”,”Please enter publish date”)) { return false; } return true; // } } /******************************************************************************* * To work with cancel button for yearly calender * @author Smitha R- Greynium Information Technologies Pvt. Ltd. | 10/07/2008 *********************************************************************************/ function cancelYearlyCalender(str){ IGNORE_UNLOAD = true; var msg1 = ‘Are you sure want to cancel?’; if (confirm(msg1)){ document.location.href=’index.php’; return true; }else{ return false; } } /*function isValidName(fldId,msg){ var obj = document.getElementById(fldId).value; var pattern=/[*/ //\:”> 3000 ) { alert(‘Message cannot exceed more than 3000 characters’); frmEmail.mess age.focus(); frmEmail.message.select(); return false; } if( !nullCheck(‘captcha’,’Please enter the code’)){ return false; } return true; } function validateCalender(formname){ var obj = eval(‘document.’ + formname); var id = obj.id.value; if(id ==””) { if(obj.year.value == ”){ alert(“Please select year”); obj.year.focus(); return false; } if(obj.photo_file.value == ”){ alert(“Please select photo”); return false; } if(obj.photo_file.value != ”){ imagePath = obj.photo_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“U pload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } } else { if(obj.year.value == ”){ alert(“Please enter year”); obj.year.focus(); return false; } if(obj.photo_file.value == ”){ alert(“Please select photo”); return false; } if(obj.photo_file.value != ”){ imagePath = obj.photo_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == “.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } } //} IGNORE_UNLOAD = true; return true; } function tellAFriend() { var urlAddress = window.location.href; var emailMatch = /^(([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+(\;)*)+$ /; var mail_to= document.getElementById(‘friend_email’).value; var mail_from = document.getElementById(‘your_name’).value; var mail_body = document.getElementById(‘message’).value; document.getElementById(‘addr’).value = window.location.href; if(frmEmail.your_name.value.length == 0 ) { alert(‘Please Enter Your Name’); frmEmail.your_name.focus(); frmEmail.your_name.select(); return false; } else if(frmEmail.friend_email.value.length == 0 || !emailMatch.test(frmEmail.friend_email.value)) { alert(‘Please Enter valid friends mail id’); frmEmail.friend_email.focus(); frmEmail.friend_email.select(); return false; } else if(frmEmail.message.value.length 3000 ) { alert(‘Message cannot exceed more than 3000 characters’); frmEmail.message.focus(); frmEmail.message.select(); return false; } else if(frmEmail.scode.value == ”) { alert(‘Please enter Security Code.’); frmEmail.scode.focus(); frmEmail.scode.select(); return false; } return true; } /*—————————————————————— Poll front end Module ——————————————————————*/ function viewPollResult(value, id){ var url = “weekly_polls.php?q=”+value+”&id=”+id; AjaxRequest.get( { ‘url’:url ,’onSuccess’:function(req){ document.getElementById(‘show_poll’).innerHTML=req.responseText; } } ); } function setPollOptionsFlag(){ if(document.getElementById(‘options_flag’).value==0){ document.getElementById(‘options_flag’).value=1; return 0 } else{ document.getElementById(‘o ptions_flag’).value=1; return 0 } } function setPollViewFlag(){ if(document.getElementById(‘view_flag’).value==1){ document.getElementById(‘view_flag’).value=0; document.frmPolls.action=”index.php”; document.frmPolls.submit(); return false; } return false; } function validatePolls(url){ if(document.getElementById(‘user_id’).value==”){ document.location = url+’login.php’; return false; } if(document.getElementById(‘options_flag’).value==0){ alert(“Please select an option”); return false; } return votePoll(url) } function votePoll(base_url){ var i; var options = ”; var temp=”; for(i=0;i= 4)) { window.external.AddFavorite(urlAddress,pageName); } else if (navigator.appName == “Firefox”) { window.sidebar.addPanel(pageName,urlAddress,””); } else { alert(“Press CTRL-D (Firefox) or CTRL-T (Opera) to bookmark”); } } function validateEditProfile(){ if (!nullCheck(“first_name”,”Please enter first name”) || !alphaSpaceOnly(“first_name”)) { return false; } if(!nullCheck(“last_name”,”Please enter last name”) || !alphaSpaceOnly(“last_name”)) { return false; } if(!nullCheck(“email”,”Please enter email”) || !emailValidation(“email”) ) { return false; } if(document.getElementById(‘zip’).value != ”){ var s = document.getElementById(‘zip’).value; if (isNaN(s)) { alert(“Please Enter Numbers Only in Zipcode”); return false; } } } function validateHorizontalMenu(formname) { var obj = eval(‘document.’ + formname); if(document.getElementById(‘type_id’).value == ‘0’){ alert(‘Please select type’); return false; } if(document.getElementById(‘type_id’).value == ‘2’){ if(obj.parent_id.value==’0′){ alert(‘Please se lect a different category’); return false; } } if( !nullCheck(‘title’,’Please enter title’)){ return false; } if (!validateMenuTitle(‘title’)){ return false; } if(Trimstr(obj.url.value) != ”){ var myRegxp = /”/; var str = obj.url.value; if(myRegxp.test(str)){ alert(“please enter valid URL”); PageLoadFocus(‘url’); return false; } } var temp_id = document.getElementById(‘id’).value; var temp_parent_id = document.getElementById(‘parent_menu’).value; if(temp_id == temp_parent_id){ alert(“A menu item cannot be parent of itself”); return false; } IGNORE_UNLOAD = true; return true; } function validateMenuTitle(fldId) { var myRegxp = /^[a-zA-Z0-9\.\-\'& ]+$ /; var str = document.getElementById(fldId).value; if(! myRegxp.test(str)){ alert(‘Please enter valid title’); //PageLoadFocus(fldId); return false; }else{ return true; } } function validateWisdom(formname) { var obj = eval(‘document.’ + formname); var id = obj.id.value; if(id ==””) { if(!nullCheck(“quote”,”Please enter quote”)) { return false; } if(!nullCheck(“author”,”Please enter author”)) { return false; } if(obj.wisdom_date.value == ”){ alert(“Please enter date”); obj.wisdom_date.focus(); return false; } } else { if(!nullCheck(“quote”,”Please enter quote”)) { return false; } if(!nullCheck(“author”,”Please enter author”)) { return false; } if(obj.wisdom_date.value == ”){ alert(“Please enter date”); obj.wisdom_date.focus(); return false; } } //} IGNORE_UNLOAD = true; return true; } function cancelThis() { if(confirm(“Are you sure you want to cancel?”)){ history.go(-1); return true; }else{ return false; } } //for resize the images function resize(which, max) { var elem = document.getElementById(which); if (elem == unde fined || elem == null) return false; if (max == undefined) max = 100; if (elem.width > elem.height) { if (elem.width > max) elem.width = max; } else { if (elem.height > max) elem.height = max; } } function validatehoro_images(formname){ //alert(“dfji”); var obj = eval(‘document.’ + formname); if(obj.astro_name.value == ”){ alert(“Please enter astro name”); obj.astro_name.focus(); return false; } if(obj.photo_file.value == ”){ alert(“Please select photo”); return false; } if(obj.photo_file.value != ”){ imagePath = obj.photo_file.value; var pathLength = imagePath.length; var lastDot = imagePath.lastIndexOf(“.”); var fileType = imagePath.substring(lastDot,pathLength); if((fileType == “.gif”) || (fileType == “.gif”)|| (fileType == “.jpg”) || (fileType == “.jpeg”) || (fileType == “.GIF”) || (fileType == “.JPG”) || (fileType == R 20;.JPEG”)) { } else { alert(“Upload only .JPG, .JPEG, and .GIF image formats. Your file-type is ” + fileType); return false; } } IGNORE_UNLOAD = true; return true; } function loadBreakingNewsCategory(id, name){ resetMessage(); document.getElementById(‘id’).value = id; document.getElementById(‘name’).value = name; } function showMovies(show){ $ (“#movies_”+show).html(”
  • Loading..
  • “); $ .ajax({ url: base_url+”photo_gallery.php?func=get-album-list&show=”+show, beforeSend: function() { $ (“#movies_”+show).html(“
  • Loading..
  • “); }, success: function(data){ $ (“#movies_”+show).html(data); $ (“#”+show+”_loaded_count”).val(no_of_records); $ (“#”+show+”_more_link”).show(); $ (“#”+show+”_more_load”).hide(); } }); } function showMoreMovies(show){ var loaded_count; loaded_count = $ (“#”+show+”_loaded_count”).val(); $ .ajax({ url: base_url+”photo_gallery.php?func=get-album-list&show=”+show+”&loaded_count=”+loaded_count, beforeSend: function() { $ (“#”+show+”_more_link”).hide(); $ (“#”+show+”_more_load”).show(); }, success: function(data){ $ (“#”+show+”_more_link”).show(); $ (“#”+show+”_more_load”).hide(); var data_arr = data.split(“_!@#$ %_”); //alert(“#”+show+”_loaded_count”); $ (“# ”+show+”_loaded_count”).val(data_arr[1]); if(data_arr[0] != “”){ $ (“#movies_”+show).append(data_arr[0]); } if(data_arr[0] == “”){ $ (“#”+show+”_more_link”).hide(); } } }); } /* * Slides, A Slideshow Plugin for jQuery * Intructions: http://slidesjs.com * By: Nathan Searles, http://nathansearles.com * Version: 1.1.9 * Updated: September 5th, 2011 * * Licensed under the Apache License, Version 2.0 (the “License”); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an “AS IS” BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(a){a.fn.slides=function(b){return b=a.extend({},a.fn.slides.option,b),this.each(function(){function w(g,h,i){if(!p&&o){p=!0,b.animationStart(n+1);switch(g){case”next”:l=n,k=n+1,k=e===k?0:k,r=f*2,g=-f*2,n=k;break;case”prev”:l=n,k=n-1,k=k===-1?e-1:k,r=0,g=0,n=k;break;case”pagination”:k=parseInt(i,10),l=a(“.”+b.paginationClass+” li.”+b.currentClass+” a”,c).attr(“href”).match(“[^#/]+$ “),k>l?(r=f*2,g=-f*2):(r=0,g=0),n=k}h===”fade”?b.crossfade?d.children(“:eq(“+k+”)”,c).css({zIndex:10}).fadeIn(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(“:eq(“+k+”)”,c).outerHeight()},b.autoHeightSpeed,function(){d.children(“:eq(“+l+”)”,c).css({display:”none”,zIndex:0}),d.children(“:eq(“+k+”)”,c).css({zIndex:0}),b.animationComplete( k+1),p=!1}):(d.children(“:eq(“+l+”)”,c).css({display:”none”,zIndex:0}),d.children(“:eq(“+k+”)”,c).css({zIndex:0}),b.animationComplete(k+1),p=!1)}):d.children(“:eq(“+l+”)”,c).fadeOut(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(“:eq(“+k+”)”,c).outerHeight()},b.autoHeightSpeed,function(){d.children(“:eq(“+k+”)”,c).fadeIn(b.fadeSpeed,b.fadeEasing)}):d.children(“:eq(“+k+”)”,c).fadeIn(b.fadeSpeed,b.fadeEasing,function(){a.browser.msie&&a(this).get(0).style.removeAttribute(“filter”)}),b.animationComplete(k+1),p=!1}):(d.children(“:eq(“+k+”)”).css({left:r,display:”block”}),b.autoHeight?d.animate({left:g,height:d.children(“:eq(“+k+”)”).outerHeight()},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(“:eq(& #8220;+k+”)”).css({left:f,zIndex:5}),d.children(“:eq(“+l+”)”).css({left:f,display:”none”,zIndex:0}),b.animationComplete(k+1),p=!1}):d.animate({left:g},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(“:eq(“+k+”)”).css({left:f,zIndex:5}),d.children(“:eq(“+l+”)”).css({left:f,display:”none”,zIndex:0}),b.animationComplete(k+1),p=!1})),b.pagination&&(a(“.”+b.paginationClass+” li.”+b.currentClass,c).removeClass(b.currentClass),a(“.”+b.paginationClass+” li:eq(“+k+”)”,c).addClass(b.currentClass))}}function x(){clearInterval(c.data(“interval”))}function y(){b.pause?(clearTimeout(c.data(“pause”)),clearInterval(c.data(“interval”)),u=setTimeout(function(){clearTimeout(c.data(“pause”)),v=setInterval(function(){w(“next”,i)},b.play),c.data(“in terval”,v)},b.pause),c.data(“pause”,u)):x()}a(“.”+b.container,a(this)).children().wrapAll(‘ ‘);var c=a(this),d=a(“.slides_control”,c),e=d.children().size(),f=d.children().outerWidth(),g=d.children().outerHeight(),h=b.start-1,i=b.effect.indexOf(“,”)<0?b.effect:b.effect.replace(” “,””).split(“,”)[0],j=b.effect.indexOf(“,”)<0?i:b.effect.replace(” “,””).split(“,”)[1],k=0,l=0,m=0,n=0,o,p,q,r,s,t,u,v;if(e<2)return a(“.”+b.container,a(this)).fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()}),a(“.”+b.next+”, .”+b.prev).fadeOut(0),!1;if(e<2)return;h<0&&(h=0),h>e&&(h=e-1),b.start&&(n=h),b.randomize&&d.randomize(),a(“.”+b.container,c).css({overflow:”hidden”,position:”relative”}),d.children().css({position:R 21;absolute”,top:0,left:d.children().outerWidth(),zIndex:0,display:”none”}),d.css({position:”relative”,width:f*3,height:g,left:-f}),a(“.”+b.container,c).css({display:”block”}),b.autoHeight&&(d.children().css({height:”auto”}),d.animate({height:d.children(“:eq(“+h+”)”).outerHeight()},b.autoHeightSpeed));if(b.preload&&d.find(“img:eq(“+h+”)”).length){a(“.”+b.container,c).css({background:”url(“+b.preloadImage+”) no-repeat 50% 50%”});var z=d.find(“img:eq(“+h+”)”).attr(“src”)+”?”+(new Date).getTime();a(“img”,c).parent().attr(“class”)!=”slides_control”?t=d.children(“:eq(0)”)[0].tagName.toLowerCase():t=d.find(“img:eq(“+h+”)”),d.find(“img:eq(“+h+”)”).attr(“src”,z).load(functio n(){d.find(t+”:eq(“+h+”)”).fadeIn(b.fadeSpeed,b.fadeEasing,function(){a(this).css({zIndex:5}),a(“.”+b.container,c).css({background:””}),o=!0,b.slidesLoaded()})})}else d.children(“:eq(“+h+”)”).fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()});b.bigTarget&&(d.children().css({cursor:”pointer”}),d.children().click(function(){return w(“next”,i),!1})),b.hoverPause&&b.play&&(d.bind(“mouseover”,function(){x()}),d.bind(“mouseleave”,function(){y()})),b.generateNextPrev&&(a(“.”+b.container,c).after(‘Prev’),a(“.”+b.prev,c).after(‘Next’)),a(“.”+b.next,c).click(function(a){a.preventDefault(),b.play&&y(),w(“next”,i)}),a(“.”+b.prev,c).click(function(a){a.preventDefault(),b.play&&y(),w(“prev”,i)}),b.generatePagination?(b.pr ependPagination?c.prepend(” “):c.append(” “),d.children().each(function(){a(“.”+b.paginationClass,c).append(‘
  • ‘+(m+1)+”
  • “),m++})):a(“.”+b.paginationClass+” li a”,c).each(function(){a(this).attr(“href”,”#”+m),m++}),a(“.”+b.paginationClass+” li:eq(“+h+”)”,c).addClass(b.currentClass),a(“.”+b.paginationClass+” li a”,c).click(function(){return b.play&&y(),q=a(this).attr(“href”).match(“[^#/]+$ “),n!=q&&w(“pagination”,j,q),!1}),a(“a.link”,c).click(function(){return b.play&&y(),q=a(this).attr(“href”).match(“[^#/]+$ “)-1,n!=q&&w(“pagination”,j,q),!1}),b.play&&(v=setInterval(function(){w(“next”,i)},b.play),c.data(“interval”,v))})},a.fn.slides.option={preload:!1,preloadImage:”/img/loading.gif”,container:”slides_container”,generateNextPrev:!1,next:”next”,prev:”prev”,pagination:!0,generate Pagination:!0,prependPagination:!1,paginationClass:”pagination”,currentClass:”current”,fadeSpeed:350,fadeEasing:””,slideSpeed:350,slideEasing:””,start:1,effect:”slide”,crossfade:!1,randomize:!1,play:0,pause:0,hoverPause:!1,autoHeight:!1,autoHeightSpeed:350,bigTarget:!1,animationStart:function(){},animationComplete:function(){},slidesLoaded:function(){}},a.fn.randomize=function(b){function c(){return Math.round(Math.random())-.5}return a(this).each(function(){var d=a(this),e=d.children(),f=e.length;if(f>1){e.hide();var g=[];for(i=0;i1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages=”all”),o.minThreshold =o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp=”vertical”==o.settings.mode?”top”:”left”,o.usingCSS=o.settings.useCSS&&”fade”!=o.settings.mode&&function(){var t=document.createElement(“div”),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace(“Perspective”,””).toLowerCase(),o.animProp=”-“+o.cssPrefix+”-transform”,!0;return!1}(),”vertical”==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data(“origStyle”,r.attr(“style”)),r.children(o.settings.slideSelector).each(function(){t(this).data(“origStyle”,t(t his).attr(“style”))}),c()},c=function(){r.wrap(‘ ‘),o.viewport=r.parent(),o.loader=t(‘ ‘),o.viewport.prepend(o.loader),r.css({width:”horizontal”==o.settings.mode?100*o.children.length+215+”%”:”auto”,position:”relative”}),o.usingCSS&&o.settings.easing?r.css(“-“+o.cssPrefix+”-transition-timing-function”,o.settings.easing):o.settings.easing||(o.settings.easing=”swing”),f(),o.viewport.css({width:”100%”,overflow:”hidden”,position:”relative”}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:”0 auto 0px”}),o.children.css({“float”:”horizontal”==o.settings.mode?”left”:”none”,listStyle:”none”,position:”relative”}),o.children.css(“width”,u()),”horizontal”==o.settings.mode&&o. settings.slideMargin>0&&o.children.css(“marginRight”,o.settings.slideMargin),”vertical”==o.settings.mode&&o.settings.slideMargin>0&&o.children.css(“marginBottom”,o.settings.slideMargin),”fade”==o.settings.mode&&(o.children.css({position:”absolute”,zIndex:0,display:”none”}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:”block”})),o.controls.el=t(‘ ‘),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);”all”==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)), g(e,h)},g=function(e,i){var s=e.find(“img, iframe”).length;if(0==s)return i(),void 0;var n=0;e.find(“img, iframe”).each(function(){t(this).one(“load”,function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&”fade”!=o.settings.mode&&!o.settings.ticker){var e=”vertical”==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass(“bx-clone”),s=o.children.slice(-e).clone().addClass(“bx-clone”);r.append(i).prepend(s)}o.loader.remove(),S(),”vertical”==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind(“resize”,B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.sett ings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if(“vertical”==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return”vertical”==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t=”100%”;return o.settings.slideWidth>0&&(t=”horizontal”==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin :o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||”vertical”==o.settings.mode?t=e:o.settings.maxSlides>1&&”horizontal”==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else”vertical”==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if(“hor izontal”==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),”reset”,0)}else if(“vertical”==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,”reset”,0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&(“horizontal”==o.settings.mode?b(-e.left,”reset”,0):”vertical”==o.settings.mode&&b(-e.top,”reset”,0))}},b=function(t,e,i,s){if(o.usingCSS){var n=”vertical”==o.settings.mode?”translate3d(0, “+t+”px, 0)”:”translate3d(“+t+”px, 0, 0)”;r.css(“-“+o.cssPrefix+”-transition-duration”,i/1e3+”s”),”slide”==e?(r.css(o.animProp,n),r.bind(“transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd”,function (){r.unbind(“transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd”),D()})):”reset”==e?r.css(o.animProp,n):”ticker”==e&&(r.css(“-“+o.cssPrefix+”-transition-timing-function”,”linear”),r.css(o.animProp,n),r.bind(“transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd”,function(){r.unbind(“transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd”),b(s.resetValue,”reset”,0),N()}))}else{var a={};a[o.animProp]=t,”slide”==e?r.animate(a,i,o.settings.easing,function(){D()}):”reset”==e?r.css(o.animProp,t):”ticker”==e&&r.animate(a,speed,”linear”,function(){b(s.resetValue,”reset”,0),N()})}},w=function(){for(var e=””,i=x(),s=0;i>s;s++){var n=””;o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass( 220;bx-custom-pager”)):(n=s+1,o.pagerEl.addClass(“bx-default-pager”)),e+=’ “}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t(‘ ‘),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass(“bx-has-pager”).append(o.pagerEl),w()),o.pagerEl.delegate(“a”,”click”,q)},C=function(){o.controls.next=t(”+o.settings.nextText+””),o.controls.prev=t(”+o.settings.prevText+””),o.controls.next.bind(“click”,y),o.controls.prev.bind(“click”,z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t(‘ ‘),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.contr ols.el.addClass(“bx-has-controls-direction”).append(o.controls.directionEl))},E=function(){o.controls.start=t(‘ “),o.controls.stop=t(‘ “),o.controls.autoEl=t(‘ ‘),o.controls.autoEl.delegate(“.bx-start”,”click”,k),o.controls.autoEl.delegate(“.bx-stop”,”click”,M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass(“bx-has-controls-auto”).append(o.controls.autoEl),A(o.settings.autoStart?”stop”:”start”)},P=function(){o.children.each(function(){var e=t(this).find(“img:first”).attr(“title”);void 0!=e&&(“”+e).length&&t(this).append(‘

    ‘+e+”

    “)})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr(“data-slide-index”));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return”short”==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find(“a”).removeClass(“active”),o.pagerEl.each(function(i,s){t(s).find(“a”).eq(e).addClass(“active”)}),void 0)},D=function(){if(o.settings.infiniteLoop){var t=””;0==o.active.index?t=o.children.eq(0).position() :o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),”horizontal”==o.settings.mode?b(-t.left,”reset”,0):”vertical”==o.settings.mode&&b(-t.top,”reset”,0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find(“a”).removeClass(“active”),o.controls.autoEl.find(“a:not(.bx-“+t+”)”).addClass(“active”))},W=function(){1==x()?(o.controls.prev.addClass(“disabled”),o.controls.next.addClass(“disabled”)):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass(“disabled”),o.controls.next.removeClass(“disabled” )):o.active.index==x()-1?(o.controls.next.addClass(“disabled”),o.controls.prev.removeClass(“disabled”)):(o.controls.prev.removeClass(“disabled”),o.controls.next.removeClass(“disabled”)))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if(“next”==o.settings.autoDirection)r.append(o.children.clone().addClass(“bx-clone”));else{r.prepend(o.children.clone().addClass(“bx-clone”));var i=o.children.first().position();e=”horizontal”==o.settings.mode?-i.left:-i.top}b(e,”reset”,0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},functi on(){var e=0;o.children.each(function(){e+=”horizontal”==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s=”horizontal”==o.settings.mode?”left”:”top”,n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};”next”==o.settings.autoDirection?e=r.find(“.bx-clone”).first().position():i=o.children.first().position();var s=”horizontal”==o.settings.mode?-e.left:-e.top,n=”horizontal”==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,”ticker”,speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind(“touchstart”,X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind(“touchmove̶ 1;,Y),o.viewport.bind(“touchend”,V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),”fade”!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if(“horizontal”==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,”reset”,0)}},V=function(t){o.viewport.unbind(“touchmove”,Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,”fade”==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide ():r.goToPrevSlide(),r.stopAuto())}else{var s=0;”horizontal”==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,”reset”,200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,”reset”,200)}o.viewport.unbind(“touchend”,V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),”next”==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):”prev”==i&&o .settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),”fade”==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(“:visible”).fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css(“zIndex”,51).fadeIn(o.settings.speed,function(){t(this).css(“zIndex”,50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if(“horizontal”==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings. minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&”prev”==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(“.bx-clone”).eq(d);n=a.position()}else if(“next”==i&&0==o.active.index)n=r.find(“> .bx-clone”).eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if(“undefined”!=typeof n){var g=”horizontal”==o.settings.mode?-(n.left-s):-n.top;b(g,”slide”,o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,”next”)}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,”prev”)}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){ 220;next”==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A(“stop”))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A(“start”))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(“.bx-clone”)).outerWidth(u()),o.viewport.css(“height”,p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(“.bx-clone”,this).remove(),o.children.each(function(){void 0!=t(this).data(“origStyle”)?t(this).attr(“style”,t(this).data( 220;origStyle”)):t(this).removeAttr(“style”)}),void 0!=t(this).data(“origStyle”)?this.attr(“style”,t(this).data(“origStyle”)):t(this).removeAttr(“style”),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(“.bx-caption”,this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind(“resize”,B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery); !function(e){var t={trigger:”atendpage”,animation:”fade”,delay:0,showOnce:true,autoClose:false,scrollableModal:false};e.fn.subscribeBetter=function(n){var r=e.extend({},t,n),i=e(this),s=false,o=false;i.addClass(“sb”);e.fn.openWindow=functi on(){var t=e(this);if(t.is(“:hidden”)&&s==false&&o==false){o=true;setTimeout(function(){if(r.scrollableModal==true){if(e(“.sb-overlay”).length<1){e(“body”).append(” “);e(“.sb-close-backdrop, .sb-close-btn”).one(“click”,function(){e(“.sb.sb-withoverlay”).closeWindow();return false});e(“.sb.sb-withoverlay”).removeClass(“sb-animation-“+r.animation.replace(“In”,”Out”)).addClass(“sb-animation-“+r.animation);setTimeout(function(){e(“.sb.sb-withoverlay”).show();e(“body”).addClass(“sb-open sb-open-with-overlay”)},300)}}else{if(e(“.sb-overlay”).length<1){e(“body”).append(” “);e(“.sb”).removeClass(“sb-animation-“+r.animation.replace(“In”,”Out”)).addClass(“sb-animation-“+r.animation);e(“.sb-cl ose-backdrop, .sb-close-btn”).one(“click”,function(){e(“.sb”).closeWindow();return false});setTimeout(function(){e(“.sb”).show();e(“body”).addClass(“sb-open”)},300)}}if(r.showOnce==true)s=true;o=false},r.delay)}};e.fn.closeWindow=function(){var t=e(this);if(t.is(“:visible”)&&o==false){o=true;if(r.scrollableModal==true){e(“.sb.sb-withoverlay”).removeClass(“sb-animation-“+r.animation).addClass(“sb-animation-“+r.animation.replace(“In”,”Out”));setTimeout(function(){e(“.sb.sb-withoverlay”).hide();e(“body”).removeClass(“sb-open sb-open-with-overlay”);setTimeout(function(){e(“.sb-overlay”).remove()},300)},300)}else{e(“.sb”).removeClass(“sb-animation-“+r.animation).addClass(“sb-animation-“+r.animation.replace(“In”,”Out”));setTimeout(function (){e(“.sb”).hide();e(“body”).removeClass(“sb-open”);setTimeout(function(){e(“.sb-overlay”).remove()},300)},300)}o=false}};e.fn.scrollDetection=function(t,n){var r,i=(new Date).getTime();e(window).scroll(function(){var t=(new Date).getTime();if(t-i>400){e(this).trigger(“scrollStart”);i=t}clearTimeout(r);r=setTimeout(function(){e(window).trigger(“scrollEnd”)},300)});if(t==”scrollStart”){e(window).bind(“scrollStart”,function(){e(window).unbind(“scrollEnd”);n()})}if(t==”scrollEnd”){e(window).bind(“scrollEnd”,function(){e(window).unbind(“scrollStart”);n()})}};switch(r.trigger){case”atendpage”:e(window).scroll(function(){var t=e(window).scrollTop();if(t>=e(document).height()-e(window).height()){i.openWindow()}else{if(t+300< pCOOKIES.length; bb++){ NmeVal = new Array(); NmeVal = pCOOKIES[bb].split(‘=’); if(NmeVal[0] == name){ cName = unescape(NmeVal[1]); } } return cName; } $ (document).ready(function() { $ (“#popup-signup-form”).submit(function(e){ e.preventDefault(); var $ form = $ (this); var email = $ form.find(‘input[name="email"]‘).val(); var action = $ (“input[type=submit][clicked=true]“).val(); var url = $ form.attr(‘action’); $ .post(url, {email:email,action:action}, function(payload) { var resp = $ .parseJSON(payload); var data = resp.result; if(resp.action == ‘subscribe’) { if(data) { if((data==”Some fields are missing.”) || (email == “Your Email Address”)) { //$ (“#status”).text(“Please fill your email.”); // // $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); alert(“Please fill your email.”); } else if(data==”Invalid email address.”) { $ (“#status”).tex t(“Your email address is invalid.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else if(data==”Invalid list ID.”) { $ (“#status”).text(“Your list ID is invalid.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else if(data==”Already subscribed.”) { $ (“#status”).text(“You’re already subscribed!”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else { $ (“#status”).text(“Thank you. Please check your mail inbox to confirm your email address”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } else { $ (“#status”).text(“Sorry, unable to subscribe. Please try again later!”); $ (‘#status’). hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } else { if(data) { if(data==”Some fields are missing.”) { $ (“#status”).text(“Please fill your email.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else if(data==”Invalid email address.”) { $ (“#status”).text(“Your email address is invalid.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else { $ (“#status”).text(“You’re Unsubscribed!”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } else { $ (“#status”).text(“Sorry, unable to Unsubscribe. Please try again later!”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } } ); }); $ (&# 8220;#unsub-form”).submit(function(e){ e.preventDefault(); var $ form = $ (this), email = $ form.find(‘input[name="email"]‘).val(); url = $ form.attr(‘action’); $ .post(url, {email:email}, function(data) { if(data) { if(data==”Some fields are missing.”) { $ (“#status”).text(“Please fill your email.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else if(data==”Invalid email address.”) { $ (“#status”).text(“Your email address is invalid.”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } else { $ (“#status”).text(“You’re Unsubscribed!”); $ (“#status”).css(“color”, “green”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } else { $ (“#status”).text(“Sorry, unable to Unsubscribe. Please try again later!”); $ (‘#status’).hide().fadeIn(‘slow’).delay(5000).fadeOut(‘slow’); } } ); }); $ (“#popup-signup-form”).keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); $ (this).submit(); } }); $ (“#submit-btn”).click(function(e){ e.preventDefault(); $ (“#submit-btn”, $ (this).parents(“#popup-signup-form”)).removeAttr(“clicked”); $ (this).attr(“clicked”, “true”); $ (“#unsubscribe-btn”).attr(“clicked”, “false”); $ (“#popup-signup-form”).submit(); }); $ (“#unsubscribe-btn”).click(function(e){ e.preventDefault(); $ (“#unsubscribe-btn”, $ (this).parents(“#popup-signup-form”)).removeAttr(“clicked”); $ (this).attr(“clicke d”, “true”); $ (“#submit-btn”).attr(“clicked”, “false”); $ (“#popup-signup-form”).submit(); }); }); /************************************************************************** * @name Zozo UI Tabs * @descripton Create awesome tabbed content area * @version 6.5 * @Licenses: http://codecanyon.net/licenses/ * @requires jQuery v1.7 or later * @copyright Copyright (c) 2013 Zozo UI * @author Zozo UI * @URL: http://www.zozoui.com * This files should be not used in production. ***************************************************************************/ /** * jQuery.browser.mobile (http://detectmobilebrowser.com/) **/ ; (function (a) { (jQuery.browser = jQuery.browser || {}).mobile = /(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|seri es(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50 (0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); ; (function ($ , window, document, undefined) { if (!window.console) window.console = {}; if (!window.console.log) window.console.log = function () { }; $ .fn.extend({ hasClasses: function (selectors) { var _base = this; for (i in selectors) { if ($ (_base).hasClass(selectors[i])) return true; } return false; } }); $ .zozo = {}; $ .zozo.core = {}; $ .zozo.core.console = { debug: false, log: function (message) { if ($ (“#zozo-console”).length != 0) { $ (“”) .css({ marginTop: -24 }) .html(message) .prependTo(“#zozo-console”) .animate({ marginTop: 0 }, 300) .animate({ backgroundColor: “#ffffff” }, 800); } else { if (console && this.debug === true) { console.log(message); } } } }; $ .zozo.core.content = { debug: false, video: function (_content) { if (_content) { _content.find(“iframe”).each(function () { var _iframeSrc = $ (this).attr(‘src’); var wmode = “wmode=transparent”; if (_iframeSrc && _iframeSrc.indexOf(wmode) === -1) { if (_iframeSrc.indexOf(‘?’) != -1) $ (this).attr(‘src’, _iframeSrc + ‘&’ + wmode); else $ (this).attr(‘src’, _iframeSrc + ‘?’ + wmode); } }); } }, check: function (_content) { this.video(_content); } }; $ .zozo.core.keyCodes = { tab: 9, enter: 13, esc: 27, space: 32, pageup: 33, pagedown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40 }; $ .zozo.core.debug = { startTime: new Date(), log: function (msg) { if (console) { console.log(msg); } }, start: function () { this.startTime = +new Date(); this.log(“start: ” + this.startTime); }, stop: function () { var _end = +new Date(); var _diff = _end – this.startTime; this.log(“end: ” + _end); this.log(“diff: ” + _diff); var Seconds_from_T1_to_T2 = _diff / 1000; var Seconds_Between_Dates = Math.abs(Seconds_from_T1_to_T2); //this.log(“diff s: ” + Seconds_Between_Dates); } }; $ .zozo.core.support = { is_mouse_present: function () { return ((‘onmousedown’ in window) && (‘onmouseup’ in window) &&a mp; (‘onmousemove’ in window) && (‘onclick’ in window) && (‘ondblclick’ in window) && (‘onmousemove’ in window) && (‘onmouseover’ in window) && (‘onmouseout’ in window) && (‘oncontextmenu’ in window)); }, is_touch_device: function () { return ((‘ontouchstart’ in window) || // html5 browsers (navigator.maxTouchPoints > 0) || // future IE (navigator.msMaxTouchPoints > 0)) && // current IE10 (jQuery.browser.mobile); // mobile browser }, html5_storage: function () { try {//https://github.com/artberri/jquery-html5storage/blob/master/jquery.html5storage.js return ‘localStorage’ in window && window['localStorage'] !== null; } catch (e) { return false; } }, supportsCss: (function () { var div = document.createElement(‘div’), vendors = ‘khtml ms o moz webkit’.split(‘ ‘), cssPre = f alse; return function (prop) { (prop in div.style) && (cssPre = prop) var propUp = prop.replace(/^[a-z]/, function (val) { return val.toUpperCase(); }); $ .each(vendors, function (index, value) { (value + propUp in div.style) && (cssPre = ‘-‘ + value + ‘-‘ + prop); }); return cssPre; }; })(), css: { transition: false } }; $ .zozo.core.utils = { toArray: function (_object) { return $ .map(_object, function (value, key) { return value; }); }, createHeader: function (_t, _c) { var _tab = $ (“

  • ” + _t + “
  • “); var _content = $ (”

    ” + _c + “

    “); return { tab: _tab, content: _content }; }, isEmpty: function (_str) { return (!_str || 0 === _str.length); }, isNumber: function (_input) { return typeof _input === ‘number’ && isFinite(_input); }, isEven: function (_number) { return _number % 2 === 0; }, isOdd: function (_input) { return !(_number % 2 === 0); }, animate: function (_base, _elem, _pre, _prop, _post, _hidePre) { var _duration = (_base.settings.animation.effects === “none”) ? 0 : _base.settings.animation.duration; var _easing = _base.settings.animation.easing; var _transition = $ .zozo.core.support.css.transition; if (_elem && _prop) { if (_pre) { _elem.css(_pre); } /* moz transitions css transition fix*/ var _prLeft = _elem.css(“left”); var _preTop = _elem.css(“top”); if (_base.settings.animation.type === “css”) { //pre animation _prop[_transition] = “all ” + _duration + “ms ease-in-out” //animation set Timeout(function () { _elem.css(_prop); }); //post animation setTimeout(function () { // _base.settings.animating = false; if (_post) { _elem.css(_post); } _elem.css(_transition, “”); //_container.removeClass(ANIMATINGCLASS); }, _duration); } else { //lem.show().animate(_prop, { _elem.animate(_prop, { duration: _duration, easing: _easing, complete: function () { // _base.settings.animating = false; if (_post) { _elem.css(_post); } // _container.removeClass(ANIMATINGCLASS); if (_hidePre) { _elem.hide(); } } }); } } return _base; } }; $ .zozo.core.plugins = { easing: function (_base) { var _exist = false; if (_base) { if (_base.settings) { //set up a default value for easing var _defEasing = ‘swing’; // check for the existence of the easing plugin if ($ .easing.def) { _exist = true; } else { if (_base.settings.animation.easing != ‘swing’ && _base.settings.animation.easing != ‘linear’) { _base.settings.animation.easing = _de fEasing; } } } } return _exist; } }; $ .zozo.core.browser = { init: function () { this.browser = this.searchString(this.dataBrowser) || “An unknown browser”; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || “an unknown version”; $ .zozo.core.console.log(“init: ” + this.browser + ” : ” + this.version); if (this.browser === “Explorer”) { var _el = $ (“html”); var version = parseInt(this.version); if (version === 6) { _el.addClass(“ie ie7″); } else if (version === 7) { _el.addClass(“ie ie7″); } else if (version === 8) { _el.addClass(“ie ie8″); } else if (version === 9) { _el.addClass(“ie ie9″); } } }, isIE: function (_version) { if ($ .zozo.core.utils.isNumber(_version)) { return (this.browser === “Explorer” && this.version <= _version) } else { return (this.browser === “Expl orer”) } }, isChrome: function (_version) { if ($ .zozo.core.utils.isNumber(_version)) { return (this.browser === “Chrome” && this.version <= _version) } else { return (this.browser === “Chrome”) } }, searchString: function (data) { for (var i = 0; i < data.length; i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); }, dataBrowser: [ { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, { string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version" }, { prop : window.opera, identity: "Opera" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" } ] }; $ .zozo.core.hashHelper = { mode: “single”, separator: null, all: function (_sep) { var hashArray = []; var hash = document.location.hash; if (!this.hasHash()) { return hashArray; } if (this.isSimple(_sep)) { return hash.substring(1); } else { hash = hash.substring(1).split(‘&’); for (var i = 0; i < hash.length; i++) { var match = hash[i].split(_sep); //if (match.length != 2 || match[0] in hashArray) return undefined; if (match.length != 2 || match[0] in hashArray) { match[1] = “none”; } hashArray[match[0]] = match[1]; } } return hashArray; }, get: function (key, _sep) { var all = this.all(_sep); if (this.isSimple(_sep)) { return all; } else { if (typeof all === ‘undefined’ || typeof all.length < 0) { //self.log( “get: undefined or null all”); return null; } else { if (typeof all[key] !== ‘undefined’ && all[key] !== null) { //self.log(“get: exist key”); return all[key]; } else { //self.log(“get: undefined or null key” + key); return null; } } } }, set: function (key, value, _sep, _mod) { if (this.isSimple(_sep)) { document.location.hash = value; } else { if (_mod === “multiple”) { var all = this.all(_sep); var hash = []; all[key] = value; for (var key in all) { hash.push(key + _sep + all[key]); } document.location.hash = hash.join(‘&’); } else { document.location.hash = key + _sep + value; } } }, isSimple: function (_sep) { if (!_sep || _sep === “none”) { return true; } else { return false; } }, hasHash: function () { var hash = document.location.hash; if (hash.length > 0) { return true; } else { return false; } } }; $ .zozo.core.support.css.transition = $ .zozo.core.support.supportsCss(& #8220;transition”); $ .zozo.core.browser.init(); })(jQuery, window, document); ; (function ($ ) { $ .event.special.ztap = { // Abort tap if touch moves further than 10 pixels in any direction distanceThreshold: 10, // Abort tap if touch lasts longer than half a second timeThreshold: 500, //isTouchSupported: ‘ontouchstart’ in window || window.DocumentTouch && document instanceof DocumentTouch, isTouchSupported: jQuery.zozo.core.support.is_touch_device(), setup: function (_event) { var self = this, _base = $ (self); var originalEvent = “click”; if (_event) { if (_event.data) { originalEvent = _event.data; } } if ($ .event.special.ztap.isTouchSupported) { // Bind touch start _base.on(‘touchstart’, function (startEvent) { // Save the target element of the start event var target = startEvent.target, touchStart = startEvent.originalEvent.touches[0], startX = touchStart.pageX, startY = touchStart.pageY, threshold = $ .even t.special.ztap.distanceThreshold, timeout; function clearTapHandler() { clearTimeout(timeout); _base.off(‘touchmove’, moveHandler).off(‘touchend’, tapHandler); }; function tapHandler(endEvent) { clearTapHandler(); // When the touch end event fires, check if the target of the // touch end is the same as the target of the start, and if // so, fire a click. if (target == endEvent.target) { $ .event.simulate(‘ztap’, self, endEvent); } }; // Remove tap and move handlers if the touch moves too far function moveHandler(moveEvent) { var touchMove = moveEvent.originalEvent.touches[0], moveX = touchMove.pageX, moveY = touchMove.pageY; if (Math.abs(moveX – startX) > threshold || Math.abs(moveY – startY) > threshold) { clearTapHandler(); } }; // Remove the tap and move handlers if the timeout expires timeout = setTimeout(clearTapHandler, $ .event.special.ztap.timeThreshold); // When a touch starts, bind a touch end and touch move handl er _base.on(‘touchmove’, moveHandler).on(‘touchend’, tapHandler); }); } else { // Bind click _base.on(originalEvent, function (endEvent) { $ .event.simulate(‘ztap’, self, endEvent); }); } } }; })(jQuery); ;(function ($ , window, document, undefined) { if (window.zozo == null) { window.zozo = {}; } var ZozoTabs = function (elem, options) { this.elem = elem; this.$ elem = $ (elem); this.options = options; this.metadata = (this.$ elem.data(“options”)) ? this.$ elem.data(“options”) : {}; this.attrdata = (this.$ elem.data()) ? this.$ elem.data() : {}; this.tabID; this.$ tabGroup; this.$ mobileNav; this.$ mobileDropdownArrow; this.$ tabs; this.$ container; this.$ contents; this.autoplayIntervalId; this.resizeWindowIntervalId; this.currentTab; this.BrowserDetection = $ .zozo.core.browser; this.Deeplinking = $ .zozo.core.hashHelper; this.lastWindowHeight; this.lastWindowWidth; this.re sponsive; }; var zozo = { pluginName: “zozoTabs”, elementSpacer: “”, commaRegExp: /,/g, space: ” “, responsive: { largeDesktop: 1200, desktop: 960, tablet: 720, phone: 480 }, modes: { tabs: “tabs”, stacked: “stacked”, menu: “menu”, slider: “slider” }, states:{ closed: “z-state-closed”, open: “z-state-open”, active: “z-state-active” }, events: { click: “click”, mousover: “mouseover”, touchend: “touchend”, touchstart: “touchstart”, touchmove: “touchmove” }, animation: { effects:{ fade: “fade”, none: “none”, slideH: “slideH”, slideV: “slideV”, slideLeft: “slideLeft”, slideRight: “slideRight”, slideUp: “slideUp”, slideUpDown: “slideUpDown”, slideDown: “slideDown” }, types: { css: “css”, jquer y: “jquery” } }, classes: { prefix: “z-“, wrapper: “z-tabs”, tabGroup: “z-tabs-nav”, tab: “z-tab”, first: “z-first”, last: “z-last”, left: “z-left”, right: “z-right”, firstCol: “z-first-col”, lastCol: “z-last-col”, firstRow: “z-first-row”, lastRow: “z-last-row”, active: “z-active”, link: “z-link”, container: “z-container”, content: “z-content”, shadows: “z-shadows”, bordered: “z-bordered”, dark: “z-dark”, spaced: “z-spaced”, rounded: “z-rounded”, themes: [ "gray", "black", "blue", "crystal", "green", "silver", "red", "orange", "deepblue", "white" ], flatThemes: [ "flat-turquoise",//1 "flat-emerald", "flat-peter-river", "flat-amethyst", "flat-wet-asphalt", "flat-green-sea",//2 "flat-nephritis", "flat-belize-hole", "flat-wist eria", "flat-midnight-blue", "flat-sun-flower",//3 "flat-carrot", "flat-alizarin", "flat-graphite", "flat-concrete", "flat-orange",//4 "flat-pumpkin", "flat-pomegranate", "flat-silver", "flat-asbestos", "flat-zozo-red" ], styles: [ "contained", "pills", "underlined", "clean", "minimal" ], orientations: [ "vertical", "horizontal" ], sizes: [ "mini", "small", "medium", "large", "xlarge", "xxlarge" ], positions: { top: “top”, topLeft: “top-left”, topCenter: “top-center”, topRight: “top-right”, topCompact: “top-compact”, bottom: “bottom”, bottomLeft: “bottom-left”, bottomCenter: “bottom-center”, bottomRight: “bottom-right”, bottomCompact: “bottom-compact” } } }, FLATCLASS = “flat”, READY = “ready”, ERROR = “error”, SELECT = “select”, ACTIVATE = “activate”, DEACTIVATE = “deactivate”, HOVERCLASS = &# 8220;hover”, BEFORESEND = “beforeSend”, CONTENTLOAD = “contentLoad”, CONTENTURL = “contentUrl”, CONTENTTYPE = “contentType”, DISABLED = “disabled”, MENUICONCLASS = “z-icon-menu”, DISABLEDCLASS = “z-disabled”, STACKEDCLASS = “z-stacked”, LIGHTICONCLASS = “z-icons-light”, DARKICONCLASS = “z-icons-dark”, AJAXSPINNERCLASS = “z-spinner”, UNDERLINEDCLASS = “underlined”, CONTAINEDCLASS = “contained”, CLEANCLASS = “clean”, PILLS = “pills”, VERTICALCLASS = “vertical”, HORIZONTALCLASS = “horizontal”, TOPLEFTCLASS = “top-left”, TOPRIGHTCLASS = “top-right”, TOPCLASS = “top”, BOTTOMCLASS = “bottom”, BOTTOMRIGHTCLASS = “bottom-right”, BOTTOMLEFTCLASS = “bottom-left”, MOBILECLASS = “mobile”, MULTILINECLASS = “z-multiline”, TRANSITION = “transition”, ANIMATINGCLASS = “z-animating”, MOBILEDROPDOWNARROWCLASS = “z-dropdown-arrow”, RESPONSIVECLASS = “responsive”, CONTENTINNERCLASS = “z-content-inner”; ZozoTabs.prototype = { defaults: { delayAjax:50, animation: { duration: 600, effects: “slideH”, easing: “easeInQuad”, type: “css”, mobileDuration: 00 }, autoContentHeight:true, autoplay: { interval: 0, smart: true }, bordered: true, dark: false, cacheAjax: true, contentUrls: null, deeplinking: false, deeplinkingAutoScroll:false, deeplinkingMode: “single”, deeplinkingPrefix: null, deeplinkingSeparator: “”, defaultTab: “tab1″, event: zozo.events.click, maxRows: 3, minWidth: 200, minWindowWidth: 480, mobileAutoScrolling: null,//{navTopOffset:-10, contentTopOffset: -10}, mobileNav: true, mobileMenuIcon: null, mode: zozo.modes.tabs, multiline:false, hashAttr ibute: “data-link”, position: zozo.classes.positions.topLeft, orientation: HORIZONTALCLASS, ready: function () { }, responsive: true, responsiveDelay: 0, rounded: false, shadows: true, theme: “silver”, scrollToContent: false, select: function () { }, spaced: false, deactivate: function () { }, beforeSend: function () { }, contentLoad: function () { }, next: null, prev:null, error: function () { }, noTabs: false, rememberState:false, size: “medium”, style: CONTAINEDCLASS, tabRatio: 1.03, tabRatioCompact: 1.031, original:{ itemWidth: 0, itemMinWidth: null, itemMaxWidth: null, groupWidth: 0, initGroupWidth: 0, itemD: 0, itemM: 0, firstRowWidth: 0, lastRowItems:0, count:0, contentMaxHeight: null, contentMaxWidth: null, navHeight: null, position: null, bottomLeft: null, tabGroupWidth:0 }, animating: false }, init: function () { var _base = this; //setTimeout( function(){ _base.settings = $ .extend(true,{}, _base.defaults, _base.options, _base.metada ta, _base.attrdata); _base.$ elem.find(“>.” + AJAXSPINNERCLASS).remove(); _base.$ elem.removeClass(“z-tabs-loading”); if (_base.settings.contentUrls != null) { _base.$ elem.find(“> div > div”).each(function (index, item) { $ (item).data(CONTENTURL, _base.settings.contentUrls[index]); }); } methods.initAnimation(_base,true); methods.updateClasses(_base); methods.checkWidth(_base, true); methods.bindEvents(_base); methods.initAutoPlay(_base); $ .zozo.core.plugins.easing(_base); /*load tab state from html5 local storage*/ if (_base.settings.rememberState === true && $ .zozo.core.support.html5_storage()) { var tab = localStorage.getItem(_base.tabID + “_defaultTab”); if (methods.tabExist(_base, tab)) { _base.settings.defaultTab = tab; } } // check if Deeplinking is enabled if (_base.settings.deeplinking === true) { var _prefix = (_base.settings.deeplinkingPrefix) ? _base.settings.deeplinkingPrefix : _base. tabID; if (document.location.hash) { var tab = _base.Deeplinking.get(_prefix, _base.settings.deeplinkingSeparator); if (methods.tabExist(_base, tab)) { methods.showTab(_base, tab); //scroll to top if (_base.settings.deeplinkingAutoScroll === true) { $ (‘html, body’).animate({ scrollTop: _base.$ elem.offset().top – 150 }, 2000); } } else { methods.showTab(_base, _base.settings.defaultTab); } } else { methods.showTab(_base, _base.settings.defaultTab); } // bind the event hashchange, using jquery-hashchange-plugin if (typeof ($ (window).hashchange) != “undefined”) { $ (window).hashchange(function () { var _newTab = _base.Deeplinking.get(_prefix, _base.settings.deeplinkingSeparator); if (!_base.currentTab || _base.currentTab.attr(_base.settings.hashAttribute) !== _newTab) { methods.showTab(_base, _newTab); } }); } else { // Bind the event hashchange, using jquery event binding, not supported (IE6, IE7) $ (window).bind(‘hashchange’ , function () { var _newTab = _base.Deeplinking.get(_prefix, _base.settings.deeplinkingSeparator); if (!_base.currentTab || _base.currentTab.attr(_base.settings.hashAttribute) !== _newTab) { methods.showTab(_base, _newTab); } }); } } else { if (_base.settings.noTabs === true) { methods.showContent(_base, methods.getActive(_base, 0)); } else { methods.showTab(_base, _base.settings.defaultTab); } } methods.checkWidth(_base); //fire ready event _base.$ elem.trigger(READY, _base.$ elem); return _base; //}, 2000); }, setOptions: function (_option) { var _base = this; _base.settings = $ .extend(true, _base.settings, _option); methods.initAnimation(_base); methods.updateClasses(_base, true); //version 5.0 methods.initTransition(_base, _base.$ tabs.index(_base.currentTab)); methods.checkWidth(_base, false, true); methods.initAutoPlay(_base); return _base; }, add: function (item, content, tabID) { var _base = this; var tabOjb = {}; if (item != null && typeof item === R 16;object’) { if (item.tab) { tabOjb.tab = $ (item.tab); (item.tabID && _base.settings.deeplinking === true) && (tabOjb.tab.attr(_base.settings.hashAttribute, item.tabID)); } if (item.content) { tabOjb.content = $ (item.content); } } else if (item && content) { tabOjb.tab = $ (“

  • ” + item + “
  • “); tabOjb.content = $ (”

    ” + content + “

    “); (tabID && _base.settings.deeplinking === true) && (tabOjb.tab.attr(_base.settings.hashAttribute, tabID)); } if (tabOjb.tab && tabOjb.content) { tabOjb.tab.appendTo(_base.$ tabGroup).hide().fadeIn(300).css(“display”, “”); tabOjb.content.appendTo(_base.$ container); methods.updateClasses(_base); methods.bindEvent(_base, tabOjb.tab); setTimeout(function () { methods.checkWidth(_base, false, true); }, 350); } return _base; }, insertAfter: function (_t, _c, _d) { var _base = this; return _base; }, insertBefore: function (_t, _c, _d) { var _base = this; return _base; }, remove: function (_i) { var _base = this; var _index = (_i – 1); var _tabToRemove = _base.$ tabs.eq(_index); var _contentToRmove = _base.$ contents.eq(_index); _contentToRmove.remove(); _tabToRemove.fadeOut(300, function () { $ (this).remove(); methods.updateClasses(_base); }); setTimeout(function () { methods.checkWidth(_base, false, true); }, 350); return _base; }, enable: function (_i) { var _base = this; var _tabToEnable = _base.$ tabs.eq(_i); //var _contentToEnable= _base.$ contents.eq(_i); if (_tabToEnable.length) { _tabToEnable.removeClass(DISABLEDCLASS); _tabToEnable.data(DISABLED,false); } return _base; }, disable: function (_i) { var _base = this; var _tabToDisable = _base.$ tabs.eq(_i); //var _contentToDisable = _base.$ contents.eq(_i); if (_tabToDisable.length) { _tabToDisable.addClass(DISABLEDCLASS); _tabToDisable.data(DISABLED, true); } return _base; }, select: function (_i) { var _base = this; if (_base.settings.animating !== true) { if (_base.settings.noTabs === true) { methods.showContent(_base, methods.getActive(_base, _i)); } else { methods.changeHash(_base, _base.$ tabs.eq(_i).attr(_base.settings.hashAttribute)); } } return _base; }, first: function () { var _base = this; _base.select(methods.getFirst()); return _base; }, prev: function () { var _base = this; var _currentIndex = method s.getActiveIndex(_base) if (_currentIndex <= methods.getFirst(_base)) { _base.select(methods.getLast(_base)); } else { _base.select(_currentIndex – 1); $ .zozo.core.debug.log(“prev tab : ” + (_currentIndex – 1)); } return _base; }, next: function (_base) { _base = (_base) ? _base : this; var _currentIndex = methods.getActiveIndex(_base); var _count = parseInt(methods.getLast(_base)); if (_currentIndex >= _count) { _base.select(methods.getFirst()); } else { _base.select(_currentIndex + 1); $ .zozo.core.debug.log(“next tab : ” + (_currentIndex + 1)); } return _base; }, last: function () { var _base = this; _base.select(methods.getLast(_base)); return _base; }, play: function (interval) { var _base = this; if (interval == null || interval < 0) { interval = 2000; } _base.settings.autoplay.interval = interval; _base.stop(); _base.autoplayIntervalId = setInterval(function () { _base.next(_base); }, _base.settings.autoplay.interval); retur n _base; }, stop: function (_base) { _base = (_base) ? _base : this; clearInterval(_base.autoplayIntervalId); return _base; }, refresh: function () { var _base = this; _base.$ contents.filter(“.z-active”).css({ “display”: “block” }).show(); methods.checkWidth(_base); return _base; } }; var methods = { initAnimation: function (_base, _init) { var _effects = $ .zozo.core.utils.toArray(zozo.animation.effects); if ($ .inArray(_base.settings.animation.effects, _effects) < 0) { _base.settings.animation.effects = zozo.animation.effects.slideH; } if (jQuery.browser.mobile) { //_base.settings.event = zozo.events.touchend; _base.settings.shadows = false; } if ($ .zozo.core.support.css.transition === false) { _base.settings.animation.type = zozo.animation.types.jquery; if (jQuery.browser.mobile) { _base.settings.animation.duration = 0; } } if (_base.settings.animation.effects === zozo.animation.effects.none && _init ===true) { _base.se ttings.animation.duration = 0; } }, updateClasses: function (_base, _options) { _base.$ elem.find(‘*’).stop(true, true); _base.tabID = _base.$ elem.attr(“id”); _base.$ tabGroup = _base.$ elem.find(“> ul”).addClass(zozo.classes.tabGroup).not(“.z-tabs-mobile”).addClass(“z-tabs-desktop”); _base.$ tabs = _base.$ tabGroup.find(“> li”); _base.$ container = _base.$ elem.find(“> div”); _base.$ contents = _base.$ container.find(“> div”); if (_base.$ tabGroup.length<=0) { _base.settings.noTabs = true; } var _transition = $ .zozo.core.support.css.transition; var _noTabs = _base.settings.noTabs; //update container and content classes _base.$ container.addClass(zozo.classes.container).css({_transition:””}); _base.$ contents.addClass(zozo.classes.content); _base.$ contents.each(function (index, item) { var _cont = $ (item); _con t.css({ “left”: “”, “top”: “”, “opacity”: “”, “display”: “”, _transition: “” }); (_cont.hasClass(zozo.classes.active)) && _cont.show().css({ “display”: “block”, _transition: “” }); }); if (_noTabs != true) { _base.$ tabs.each(function (index, item) { var _tab =$ (item); _tab .removeClass(zozo.classes.first) .removeClass(zozo.classes.last) .removeClass(zozo.classes.left) .removeClass(zozo.classes.right) .removeClass(zozo.classes.firstCol) .removeClass(zozo.classes.lastCol) .removeClass(zozo.classes.firstRow) .removeClass(zozo.classes.lastRow) .css({ “width”: “”, “float”: “” }) .addClass(zozo.classes.tab) .find(“a”) .addClass(zozo.classes.link); (methods.isTabDisabled(_tab)) && (_base.disable(index)); (_base.settings.deeplinking === false) && $ (item). attr(_base.settings.hashAttribute, “tab” + (index + 1)) }); _base.$ tabs.filter(“li:first-child”).addClass(zozo.classes.first); _base.$ tabs.filter(“li:last-child”).addClass(zozo.classes.last); } var _positions = $ .zozo.core.utils.toArray(zozo.classes.positions); _base.$ elem .removeClass(zozo.classes.wrapper) .removeClass(zozo.classes.rounded) .removeClass(zozo.classes.shadows) .removeClass(zozo.classes.spaced) .removeClass(zozo.classes.bordered) .removeClass(zozo.classes.dark) .removeClass(MULTILINECLASS) .removeClass(LIGHTICONCLASS) .removeClass(DARKICONCLASS) .removeClass(STACKEDCLASS) .removeClass(FLATCLASS) .removeClass(zozo.classes.styles.join(zozo.space)) .removeClass(zozo.classes.orientations.join(zozo.space)) .removeClass(_positions.join().replace(zozo.commaRegExp, zozo.space)) .removeClass(zozo.classes.sizes.join(zozo.space)) .removeClass(zozo.classes.themes.join(zozo.space)) .removeClass(zozo.classes.flatThemes.join(zozo.s pace)) .addClass(HOVERCLASS) .addClass(_base.settings.style) .addClass(_base.settings.size) .addClass(_base.settings.theme); //console.log(zozo.classes.themes.join(zozo.space)); // console.log(zozo.classes.flatThemes.join(zozo.space)); //light or dark icons (methods.isFlatTheme(_base)) && _base.$ elem.addClass(FLATCLASS); (methods.isLightTheme(_base)) ? _base.$ elem.addClass(DARKICONCLASS): _base.$ elem.addClass(LIGHTICONCLASS); (_base.settings.rounded === true) && _base.$ elem.addClass(zozo.classes.rounded); (_base.settings.shadows === true) && _base.$ elem.addClass(zozo.classes.shadows); (_base.settings.bordered === true) && _base.$ elem.addClass(zozo.classes.bordered); (_base.settings.dark === true) && _base.$ elem.addClass(zozo.classes.dark); (_base.settings.spaced === true) && _base.$ elem.addClass(zozo.classes.spaced); (_base.settings.multiline === true) && _base.$ elem.addClass(MULTILINECLASS); methods.checkPosition(_base); if (_base.$ elem.find(“> ul.” + “z-tabs-mobile”).length) { _base.$ mobileNav = _base.$ elem.find(“> ul.” + “z-tabs-mobile”); } else { _base.$ mobileNav = $ (” “); } if (_base.$ mobileNav) { _base.$ tabGroup.before(_base.$ mobileNav); if (_base.$ elem.find(“> i.” + MOBILEDROPDOWNARROWCLASS).length) { _base.$ mobileDropdownArrow = _base.$ elem.find(“> i.” + MOBILEDROPDOWNARROWCLASS); } else { _base.$ mobileDropdownArrow = $ (“”); } _base.$ tabGroup.before(_base.$ mobileDropdownArrow); } //remove hover class for touch (jQuery.browser.mobile) && (_base.$ elem.removeClass(HOVERCLASS)); }, checkPosition: function (_base) { _base.$ container.appendTo(_base.$ elem); _base.$ tabGroup.prependTo(_base.$ elem); _base.$ elem.find(“> span.z-tab-spacer”).remove(); _base.$ elem.addClass(zozo.classes.wrapper); var _isTop = methods.isTop(_base); //set calculate and container height _base.$ contents.each(function (index, item) { var _content = $ (item); var _contentClass = CONTENTINNERCLASS; if (!_content.find(“> div.” + CONTENTINNERCLASS).length) { if (_content.hasClass(“z-row”)) { _content.removeClass(“z-row”); _contentClass = “z-row ” + CONTENTINNERCLASS; } _content.wrapInner(” “); $ .zozo.core.content.check(_content); } }); if (_base.settings.orientation === VERTICALCLASS) { if (_base.settings.position !== TOPRIGHTCLASS) { _base.settings.position = TOPLEFTCLASS; } } else { _base.settings.orientation = HORIZONTALCLASS; if (_isTop === false) { _base.$ tabGroup.appendTo(_base.$ elem); $ (zozo.elementSpacer).appendTo(_base.$ elem); _base.$ container.prependTo(_base.$ elem); } } _base.$ elem.addClass(_base.settings.orientation); _base.$ elem.addClass(_base.set tings.position); if (_isTop) { _base.$ elem.addClass(TOPCLASS); } else { _base.$ elem.addClass(BOTTOMCLASS); } }, bindEvents: function (_base) { //main tab events var _duration = (_base.settings.animation.effects === zozo.animation.effects.none) ? 0 : _base.settings.animation.duration; _base.$ tabs.each(function () { var _tab = $ (this); var href = _tab.find(“a”).attr(“href”); var target = _tab.find(“a”).attr(“target”); if (!$ .trim(href).length) { methods.bindEvent(_base, _tab); } else { _tab.on(‘ztap’, { data: _base.settings.event }, function (_event) { ($ .trim(target).length) ? window.open(href, target) :window.location = href; _event.preventDefault(); }); } }); /* $ (window).resize(function () { clearInterval(_base.resizeWindowIntervalId); _base.resizeWindowIntervalId = setTimeout(function () { methods.checkWidth(_base); }, 200) }); */ $ (window).resize(function () { if (/*_base.lastWindowHeight !== $ (window).height() ||*/ _base.lastWindowWidth !== $ (window).width()) { clearInterval(_base.resizeWindowIntervalId); _base.resizeWindowIntervalId = setTimeout(function () { _base.lastWindowHeight = $ (window).height(); _base.lastWindowWidth = $ (window).width(); //console.log(“resizing ” + $ (window).width()); methods.checkWidth(_base); }, _base.settings.responsiveDelay); } }); //bind next event var _nextButton = _base.settings.next; if (_nextButton != null) { $ (_nextButton).on(zozo.events.click, function (_event) { _event.preventDefault(); _base.next(); }); } //bind prve event var _prevButton = _base.settings.prev; if (_prevButton != null) { $ (_prevButton).on(zozo.events.click, function (_event) { _event.preventDefault(); _base.prev(); }); } //mobile dropdown menu event if (_base.$ mobileNav) { _base.$ mobileNav.find(“li”).on(‘ztap’, { data: _base.settings.event }, function (_event) { //_base.$ mobileNav.find (“li”).on(_base.settings.event, function (_event) { _event.preventDefault(); if (_base.$ mobileNav.hasClass(zozo.states.closed)) { _base.$ mobileNav.removeClass(zozo.states.closed); _base.$ tabGroup.removeClass(“z-hide-menu”); methods.mobileNavAutoScroll(_base); } else { _base.$ mobileNav.addClass(zozo.states.closed); _base.$ tabGroup.addClass(“z-hide-menu”); } methods.refreshParents(_base, _duration); }); } _base.lastWindowHeight = $ (window).height(); _base.lastWindowWidth = $ (window).width(); _base.$ elem.bind(READY, _base.settings.ready); _base.$ elem.bind(SELECT, _base.settings.select); _base.$ elem.bind(DEACTIVATE, _base.settings.deactivate); _base.$ elem.bind(ERROR, _base.settings.error); _base.$ elem.bind(CONTENTLOAD, _base.settings.contentLoad); }, bindEvent: function (_base, _tab) { _tab.on(‘ztap’, { data: _base.settings.event }, function (_event) { _event.preventDefault(); //stop autoplay if smart is true if (_base.settings.autoplay !== false && _base.settings.autoplay != null) { if (_base.settings.autoplay.smart === true) { _base.stop(); } } methods.changeHash(_base, _tab.attr(_base.settings.hashAttribute)); if (methods.allowAutoScrolling(_base) === true && methods.isMobile(_base)) { $ (window.opera ? ‘html’ : ‘html, body’).animate({ scrollTop: _base.$ elem.offset().top +_base.settings.mobileAutoScrolling.contentTopOffset }, 0); } }); }, mobileNavAutoScroll: function (_base) { if (methods.allowAutoScrolling(_base) === true) { $ (window.opera ? ‘html’ : ‘html, body’).animate({ scrollTop: _base.$ mobileNav.offset().top + _base.settings.mobileAutoScrolling.navTopOffset }, 0); } return _base; }, showTab: function (_base, tab) { if (methods.tabExist(_base, tab) && tab != null && _base.settings.animating !== true) { var nextTab = _base.$ tabs.filter(“li[" + _base.settings .hashAttribute + "='" + tab + "']“); var _nextIndex = _base.$ tabs.index(nextTab); var _tabElement = methods.getActive(_base, _nextIndex); if (_tabElement.enabled && _tabElement.preIndex !== _tabElement.index && _base.settings.noTabs !== true) { //_base.settings.animating = true //set current tab _base.currentTab = nextTab; //update classes _base.$ tabs.removeClass(zozo.classes.active); _base.currentTab.addClass(zozo.classes.active); //save to local html5 storage if (_base.settings.rememberState === true && $ .zozo.core.support.html5_storage()) { localStorage.setItem(_base.tabID + “_defaultTab”, nextTab.data(“link”)); } methods.mobileNav(_base, false, _tabElement.index); if (_tabElement.contentUrl) { if (_tabElement.preIndex === -1) { //transition.init(_base, _tabElement); _tabElement.content.css({ “opacity”: “”, “left”: “”, “top”: “”, “positio n”: “relative” }).show(); } if (_tabElement.contentType === “iframe”) { methods.iframeContent(_base, _tabElement); } else { methods.ajaxRequest(_base, _tabElement); } } else { methods.showContent(_base, _tabElement); } } } }, getActiveIndex: function (_base) { var _index; if (_base.settings.noTabs === true) { _index = _base.$ container.find(“>div.” + zozo.classes.active).index(); } else { if (_base.currentTab) { _index = parseInt(_base.currentTab.index()); } else { _index = _base.$ tabGroup.find(“li.” + zozo.classes.active).index(); } } return _index; }, getActive: function (_base, _index) { var _preIndex = methods.getActiveIndex(_base); var _nextContent = _base.$ contents.eq(_index); var _nextTab = _base.$ tabs.eq(_index); var _preTab = _base.$ tabs.eq(_preIndex); var _transition = $ .zozo.core.support.css.transition; var _duration = (_base.settings.animation.effects === zozo.animation.effects.none) ? 0 : _b ase.settings.animation.duration; var _tabElement = { index: _index, tab: _nextTab, content: _nextContent, contentInner: _nextContent.find(“> .z-content-inner”), enabled: methods.isTabDisabled(_nextTab)===false, contentUrl: _nextContent.data(CONTENTURL), contentType: _nextContent.data(CONTENTTYPE), noAnimation: false, transition: _transition, duration: _duration, preIndex: _preIndex, preTab: _preTab, preContent: _base.$ contents.eq(_preIndex) }; return _tabElement; }, iframeContent: function (_base, _tabElement) { var _iframe = _tabElement.contentInner.find(“> div >.z-iframe”); if (!_iframe.length) { methods.showLoading(_base); _tabElement.contentInner.append(‘ ‘); console.log(“add iframe”); } else { methods.hideLoading(_base); } methods.showContent(_base, _tabElement); _tabElement.contentInner.find(“.z-iframe”).load(function () { methods.hideLoading(_base); }); return _base; }, showLoading: function (_base) { _ base.$ container.append(”); return _base; }, hideLoading: function (_base) { _base.$ container.find(“>.” + AJAXSPINNERCLASS).remove(); return _base; }, ajaxRequest: function (_base, _tabElement) { var data = {}; var callbackOjb = { tab: _tabElement.tab, content: _tabElement.contentInner, index: _tabElement.index, xhr: null, message: “” }; $ .ajax({ type: “GET”, cache: (_base.settings.cacheAjax === true), url: _tabElement.contentUrl, dataType: “html”, data: data, beforeSend: function (xhr, settings) { //return fire(element, ‘ajax:beforeSend’, [xhr, settings]); methods.showLoading(_base); _base.settings.animating = true; }, error: function (xhr, status, error) { if (xhr.status == 404) { callbackOjb.message = ”

    Sorry, error: 404 – the requested content could not be found.

    “; } else { callbackOjb.message = ”

    An error occurred: ” + status + “\nError: ” + xhr + ” code: ” + xhr.status + “

    “; } callbackOjb.xhr = xhr; (_base.settings.error && typeof (_base.settings.error) == typeof (Function)) && _base.$ elem.trigger(ERROR, callbackOjb); _tabElement.contentInner.html(callbackOjb.message); }, complete: function (xhr, status) { //_base.$ elem.trigger(‘ajax:complete’, [xhr, status]); setTimeout(function () { _base.settings.animating = false; //methods.setContentHeight(_base, _tabElement.content); methods.showContent(_base, _tabElement); methods.hideLoading(_base); }, _base.settings.delayAjax); }, success: function (data, status, xhr) { setTimeout(function () { _tabElement.contentInner.html(data); callbackOjb.xhr = xhr; _base.$ elem.trigger(CONTENTLOAD, callbackOjb); }, _base.settings.delayAjax); } }); return _base; }, showContent: function (_base, _tabElement) { if (_tabElement.preIndex !== _tabElement.index && _base.settings.animating !== true) { _base.settings.animating = true; _base.$ contents.removeClass(zozo.cl asses.active); _tabElement.content.addClass(zozo.classes.active); if (_tabElement.preIndex === -1) { transition.init(_base, _tabElement); } else { var _effects = _base.settings.animation.effects; //var _preSize = methods.getElementSize(_tabElement.preContent).height; //var _nextSize = methods.getElementSize(_tabElement.content).height; //var _largest = methods.getContentHeight(_base, null, true).height; var _preSize = methods.getContentHeight(_base, _tabElement.preContent, true).height; var _nextSize = methods.getContentHeight(_base, _tabElement.content,true).height; var _largest = methods.isLarger(_preSize, _nextSize); if (_base.settings.orientation === HORIZONTALCLASS && _base.settings.autoContentHeight === true) { _largest = (_preSize > _nextSize) ? _preSize : _nextSize } var _width = (_effects === zozo.animation.effects.slideH || _effects === zozo.animation.effects.slideLeft || _effects === zozo.animation.effects.slideRight) ? _base.$ container.width() : _width = _ largest; if (_tabElement.preIndex < _tabElement.index && _effects === zozo.animation.effects.slideV) { var _vHeight = methods.isLarger(_preSize, _nextSize); (_vHeight > _width) && (_width = _vHeight); } var _prevValue = -_width; var _nextValue = _width; if (_tabElement.preIndex > _tabElement.index) { _prevValue = _width; _nextValue = -_width; } transition.before(_base, _tabElement); switch(_effects) { case zozo.animation.effects.slideV: methods.animate(_base, _tabElement.preContent,null, { “left”: 0, “top”: _prevValue + “px” }); methods.animate(_base, _tabElement.content, {“left”: 0, “top”: _nextValue + “px”}, { “top”: 0}); break; case zozo.animation.effects.slideUp: methods.animate(_base, _tabElement.preContent, { “opacity”: 1 }, { “left”: 0, “top”: (-_width) + “px”}); methods.animate(_base, _tabElement.content, { “left&# 8221;: 0, “top”: (_width * 1) + “px” }, { “top”: 0 }); break; case zozo.animation.effects.slideDown: methods.animate(_base, _tabElement.preContent, { “opacity”: 1 }, { “left”: 0, “top”: (_width) + “px” }); methods.animate(_base, _tabElement.content, { “left”: 0, “top”: (-_width) + “px”}, { “top”: 0 }); break; case zozo.animation.effects.slideUpDown: methods.animate(_base, _tabElement.preContent, { “opacity”: 1 }, { “left”: 0, “top”: (-_width*1) + “px” }); methods.animate(_base, _tabElement.content, { “left”: 0, “top”: (-(_width * 2)) + “px” }, { “top”: 0 }); break; case zozo.animation.effects.slideH: methods.animate(_base, _tabElement.preContent, null, { “left”: _prevValue + “px” }); methods.animate(_base, _tabElement.content, { “ ;left”: _nextValue + “px” }, { “left”: 0}); break; case zozo.animation.effects.slideRight: methods.animate(_base, _tabElement.preContent, { “opacity”: 1 }, { “top”: 0, “left”: (_width) + “px”}); methods.animate(_base, _tabElement.content, { “top”: 0, “left”: (-_width) + “px” }, { “top”: 0, “left”: 0}); break; case zozo.animation.effects.slideLeft: methods.animate(_base, _tabElement.preContent, { “opacity”: 1 }, { “top”: 0, “left”: (-_width) + “px” }); methods.animate(_base, _tabElement.content, { “top”: 0, “left”: (_width) + “px” }, { “top”: 0, “left”: 0 }); break; case zozo.animation.effects.fade: methods.animate(_base, _tabElement.preContent, { “display”: “block” }, { “opacity”: 0 }); methods.animate(_ba se, _tabElement.content, { “display”: “block”, “opacity”: 0 }, { “opacity”: 1 }); break; case zozo.animation.effects.none: _base.$ contents.css({ “position”: “absolute”, “left”: 0, “top”: 0 }).removeClass(zozo.classes.active).hide() .eq(_tabElement.index).addClass(zozo.classes.active).css({ “position”: “relative” }).show(); break; default: } transition.after(_base, _tabElement); } } }, refreshParents: function (_base, _duration) { setTimeout(function () { _base.$ elem.parents(“.z-tabs”).each(function (index, item) { $ (item).data(‘zozoTabs’).refresh(); }); }, _duration); }, animate: function (_base, _elem, _pre, _prop, _post, _hidePre) { $ .zozo.core.utils.animate(_base, _elem, _pre, _prop, _post, _hidePre); }, mobileNav: function (_base, _show, _nextIndex) { if (_nextIndex !== null && _base.$ mobileNav) { _base.$ m obileNav.find(“> li > a > span.z-title”).html(_base.$ tabs.eq(_nextIndex).find(“a”).html()); } if (_show === true) { setTimeout(function () { _base.$ mobileNav.removeClass(zozo.states.closed); }, _base.settings.animation.mobileDuration); _base.$ tabGroup.removeClass(“z-hide-menu”);; } else { (_base.$ mobileNav) && _base.$ mobileNav.addClass(zozo.states.closed); _base.$ tabGroup.addClass(“z-hide-menu”); } }, setResponsiveDimension: function (_base, _groupWidth, _rec) { var _container = _base.$ container; _base.settings.original.count = parseInt(_base.$ tabs.size()); if (!_rec) { _base.settings.original.itemD = parseInt(_container.width() / _base.settings.original.itemWidth); _base.settings.original.itemM = _base.settings.original.itemWidth + _base.settings.original.itemM; } _base.settings.original.firstRowWidth = (_base.settings.original.itemWidth / (parseInt(_base.settings.original.itemD) * _bas e.settings.original.itemWidth) * 100); _base.settings.original.itemCount = parseInt(_base.settings.original.itemD) * parseInt(_base.settings.original.count / (parseInt(_base.settings.original.itemD))); _base.settings.original.lastItem = 100 / (parseInt(_base.settings.original.count) – parseInt(_base.settings.original.itemCount)); _base.settings.original.navHeight = _base.settings.original.itemD * (parseInt(_base.$ tabs.eq(0).innerHeight())) + ((_base.settings.original.itemM > 0 ? _base.$ tabs.eq(0).innerHeight() : 0)); _base.settings.original.bottomLeft = _base.settings.original.count – (_base.settings.original.count – _base.settings.original.itemCount); _base.settings.original.rows = _base.settings.original.count > _base.settings.original.itemCount ? parseInt(_base.settings.original.itemCount / _base.settings.original.itemD) + 1 : parseInt(_base.settings.original.itemCount / _base.settings.original.itemD); _base.settings.original.lastRowItems = _base.s ettings.original.count – (_base.settings.original.itemCount * (_base.settings.original.rows – 1)); _base.settings.original.itemsPerRow = _base.settings.original.itemCount / _base.settings.original.rows; if (_container.width() > _groupWidth && !_rec) { _base.settings.original.itemD = _base.settings.original.count; _base.settings.original.itemM = 0; _base.settings.original.rows = 1; _base.settings.original.itemCount = _base.settings.original.count; } return _base; }, checkWidth: function (_base, _init, _options) { var _groupWidth = 0; var _container = _base.$ container; var _isCompact = methods.isCompact(_base); var _heightTotal = 0; var _tabR = _base.settings.tabRatio; var _tabRC = _base.settings.tabRatioCompact; _base.$ tabs.each(function (index) { var _itemTempWidth = $ (this).outerWidth(true) * _tabR; (_isCompact) && (_itemTempWidth = (_itemTempWidth * _tabRC)); if (_init === true) { if (_itemTempWidth > _base.settings.original.itemWidth) { _base.settings.original.itemWidth = _itemTempWidth; _base.settings.original.itemMaxWidth = _itemTempWidth; } if (_itemTempWidth < _base.settings.original.itemMinWidth) { _base.settings.original.itemMinWidth = _itemTempWidth; } } _heightTotal = _heightTotal + $ (this).innerHeight(); _groupWidth = _groupWidth + _itemTempWidth; }); if (_init === true) { _groupWidth = _groupWidth + (_base.settings.original.itemWidth * 0); } _base.settings.original.count = parseInt(_base.$ tabs.size()); _base.settings.original.groupWidth = _groupWidth; methods.setResponsiveDimension(_base, _base.settings.original.groupWidth); if (_base.settings.original.count > 3 && _base.settings.original.lastRowItems === 1) { _base.settings.original.itemD = _base.settings.original.itemD – 1; _base.settings.original.itemM = _container.width() % _base.settings.original.itemWidth; methods.setResponsiveDimension(_base, _base.settings.original.groupWidth,true); } if (_init === true || _options = == true) { _base.settings.original.initGroupWidth = _base.settings.original.groupWidth; if (methods.isCompact(_base)) { var _percent = 100 / _base.settings.original.count; _base.$ tabs.each(function () { $ (this).css({ “width”: _percent + “%” }) }); } _base.settings.original.position = _base.settings.position; } if (_base.settings.responsive === true) { methods.responsive(_base, _init); } var _isResORCompact = ( (methods.isCompact(_base) && !methods.isMobile(_base))); var _css = (methods.isResponsive(_base) && _base.BrowserDetection.isIE(7)) ? { “float”: “none”, “width”: “auto” } : { “float”: “” }; //version 5.1 removed float right var _hasResponsiveClass = _base.$ elem.hasClass(RESPONSIVECLASS); _base.$ tabs.each(function (index) { if (((_hasResponsiveClass === true && (index + 1) === _base.settings.original.itemD) || (index + 1) === _base.settings.ori ginal.count) && _isResORCompact) { $ (this).css(_css); } else { $ (this).css({ “float”: “” }); } }); if (_base.settings.orientation === VERTICALCLASS) { methods.setContentHeight(_base, null, true); } }, checkModes:function (_base) { var _isCompact = methods.isCompact(_base); if (_base.settings.mode === zozo.modes.stacked) { _base.$ elem.addClass(STACKEDCLASS); _base.$ elem.addClass(RESPONSIVECLASS); _base.$ tabs.css({ “width”: “” }); (_base.$ mobileNav) && _base.$ mobileNav.hide(); } else { if (_isCompact) { var _percent = 100 / _base.settings.original.count _base.$ tabs.each(function () { $ (this).css({ “float”: “”, “width”: _percent + “%” }) }); } else { _base.$ tabs.each(function () { $ (this).css({ “float”: “”, “width”: “” }) }); } } }, getContentHeight: function (_base, _contentElement, _ noAnimation) { var _autoContentHeight = _base.settings.autoContentHeight; var _size = { width: 0, height: 0 }; if (_autoContentHeight != true) { _base.$ contents.each(function (index, item) { var _content = $ (item); var contentSize = methods.getElementSize(_content); (contentSize.height > _size.height) && (_size.height = contentSize.height); (contentSize.width > _size.width) && (_size.width = contentSize.width); }); } else { var _activeContent = _base.$ elem.find(“> .z-container > .z-content.z-active”); if (_contentElement != null) { _activeContent = _contentElement; } _size.height = methods.getElementSize(_activeContent).height; } if (_base.settings.orientation === VERTICALCLASS && !methods.isMobile(_base)) { var _containerSize = 0; _base.$ tabs.each(function (index) { _containerSize = _containerSize + parseInt($ (this).height()) + parseInt($ (this).css(“border-top-width”)) + parseInt($ (this).css( 220;border-bottom-width”)); }); _size.height = methods.isLarger(_size.height, _base.$ tabGroup.innerHeight()); _size.height = methods.isLarger(_size.height, _containerSize); } return _size; }, setContentHeight: function (_base, _contentElement, _noAnimation) { //_heightOption: auto, largest, var _size = methods.getContentHeight(_base,_contentElement,_noAnimation); _base.settings.original.contentMaxHeight = _size.height; _base.settings.original.contentMaxWidth = _size.width; var _duration = (_base.settings.animation.effects === zozo.animation.effects.none || _noAnimation === true) ? 0 : _base.settings.animation.duration; var _autoContentHeight = _base.settings.autoContentHeight; var _transition = $ .zozo.core.support.css.transition; var _cssProperties = { _transition: “none”, ‘min-height’: _base.settings.original.contentMaxHeight + “px” }; //var _cssProperties = { _transition: “none”, “height”: _base.settings.ori ginal.contentMaxHeight + “px”, ‘min-height’: _base.settings.original.contentMaxHeight + “px” }; if (_noAnimation === true) { _base.$ container.css(_cssProperties); } else { methods.animate(_base, _base.$ container, null, _cssProperties, {}); } return _base; }, responsive: function (_base, _init) { var _windowSize = $ (window).width(); var _isTop = methods.isTop(_base); var _isCompact = methods.isCompact(_base); var _isContentLarger = _base.settings.original.initGroupWidth >= _base.$ container.width(); var _maxRowsExecuted = _base.settings.original.rows > _base.settings.maxRows; var _minWidthExecuted = _windowSize <= _base.settings.minWindowWidth; var _enableMobileNav = (!_base.BrowserDetection.isIE(8) && _base.settings.mobileNav === true && _base.$ mobileNav!=null); var _count = _base.settings.original.count; var _itemCount = _base.settings.original.itemCount; var _itemD = _base.settings.original.itemD; var _rows = _base.settings.original.rows; _base.$ elem.removeClass(STACKEDCLASS); _base.$ tabs.removeClass(zozo.classes.left).removeClass(zozo.classes.right).removeClass(zozo.classes.firstCol).removeClass(zozo.classes.lastCol).removeClass(zozo.classes.firstRow).removeClass(zozo.classes.lastRow) if (_base.settings.orientation === HORIZONTALCLASS) { var _compactResp = (_isCompact && (parseInt(_base.settings.original.count * _base.settings.original.itemWidth) >= _base.$ container.width())) var _normalResp = (!_isCompact && _isContentLarger); var _isHorizontalResponsive = _compactResp || _normalResp; if (_isHorizontalResponsive) { (_rows === _count || (_base.settings.mode === zozo.modes.stacked)) && (_base.$ elem.addClass(STACKEDCLASS)); _base.$ tabs.each(function (index) { var _item = $ (this); var _currentIndex = (index + 1); if (_base.settings.original.itemM > 0) { if (_currentIndex <= _itemCount) { _item.css({ “float”: ̶ 0;”, “width”: _base.settings.original.firstRowWidth + “%” }); } else { _item.css({ “float”: “”, “width”: _base.settings.original.lastItem + “%” }); } if (_isTop ===true) { (index === (_itemD – 1)) ? _item.addClass(zozo.classes.right) : _item.removeClass(zozo.classes.right); } else{ (_currentIndex === _count) && (_item.addClass(zozo.classes.right)); (index === _base.settings.original.bottomLeft) && (_item.addClass(zozo.classes.left)); } //console.log(“_currentIndex: ” + _currentIndex + ” _itemD: ” + _itemD + ” _itemCount: ” + _itemCount + ” _rows: ” + _rows + ” _count: ” + _count); if (_rows > 1 && _itemD!==1) { (_currentIndex === 1 || (_currentIndex > _itemD && (_currentIndex % _itemD === 1))) && (_item.addClass(zozo.classes.firstCol)); (_currentIndex === _count || (_currentIndex >= _itemD &am p;& (_currentIndex % _itemD === 0))) && (_item.addClass(zozo.classes.lastCol)); (_currentIndex <= _itemD) && (_item.addClass(zozo.classes.firstRow)); (_currentIndex > (_itemD * (_rows – 1))) && (_item.addClass(zozo.classes.lastRow)); } } }); methods.switchResponsiveClasses(_base, true); } else { if (_isCompact) { var _percent = 100 / _base.settings.original.count; _base.$ tabs.each(function () { $ (this).css({ “float”: “”, “width”: _percent + “%” }) }); } else { _base.$ tabs.each(function () { $ (this).css({ “float”: “”, “width”: “” }) }); } methods.switchResponsiveClasses(_base, false); } if (_windowSize >= 1200 && _base.responsive != zozo.responsive.largeDesktop) { _base.responsive = zozo.responsive.largeDesktop; methods.switchMenu(_base, false); } if (_base.responsive != zozo.responsive.phone && _enableMobileNav &am p;& ((_minWidthExecuted) || ((_maxRowsExecuted)))) { _base.responsive = ‘auto’; _base.$ elem.removeClass(RESPONSIVECLASS) _base.$ tabs.each(function () { $ (this).css({ “width”: “” }) }); _base.$ tabs.filter(“li:first-child”).addClass(zozo.classes.first); _base.$ tabs.filter(“li:last-child”).addClass(zozo.classes.last); methods.switchMenu(_base, true); } } else { // if (_enableMobileNav === true && (_windowSize <= zozo.responsive.phone || parseInt(_base.$ elem.width() – _base.settings.original.itemWidth) < _base.settings.minWidth)) { if (_enableMobileNav === true && (_minWidthExecuted || parseInt(_base.$ elem.width() – _base.settings.original.itemWidth) < _base.settings.minWidth)) { methods.switchMenu(_base, true); } else { methods.switchMenu(_base, false); } } methods.refreshParents(_base, 0); }, switchResponsiveClasses:function (_base, _resp) { var _isTop = met hods.isTop(_base); var _oriPos = _base.settings.original.position; var _topLeft = zozo.classes.positions.topLeft; var _bLeft = zozo.classes.positions.bottomLeft; if (_resp === true) { _base.$ elem.addClass(RESPONSIVECLASS); methods.switchMenu(_base, false); _base.$ elem.removeClass(_oriPos); } else { (_isTop === true) ? _base.$ elem.removeClass(_topLeft).addClass(_oriPos) : _base.$ elem.removeClass(_bLeft).addClass(_oriPos); methods.switchMenu(_base, false); _base.$ elem.removeClass(RESPONSIVECLASS); _base.$ tabs.removeClass(zozo.classes.last).filter(“li:last-child”).addClass(zozo.classes.last); } }, switchMenu: function (_base, _isMobile) { var _themes = zozo.classes.themes; var _sizes = zozo.classes.sizes; var _positions = $ .zozo.core.utils.toArray(zozo.classes.positions); _base.$ elem.removeClass(_themes.join(zozo.space)); if (_isMobile === true) { (_base.$ mobileNav) && _base.$ mobileNav.addClass(zozo.states.closed).show(); _bas e.$ tabGroup.addClass(“z-hide-menu”); _base.$ elem.addClass(MOBILECLASS); _base.$ elem.removeClass(_base.settings.orientation); _base.$ elem.removeClass(_base.settings.position); (_base.settings.style === UNDERLINEDCLASS) ? _base.$ elem.addClass(“m-” + _base.settings.theme) : _base.$ elem.addClass(_base.settings.theme); } else { _base.$ elem.addClass(_base.settings.orientation); _base.$ elem.addClass(_base.settings.theme); _base.$ elem.addClass(_base.settings.position); (_base.$ mobileNav) && _base.$ mobileNav.removeClass(zozo.states.closed); _base.$ tabGroup.removeClass(“z-hide-menu”); _base.$ tabs.filter(“li:first-child”).addClass(zozo.classes.first); _base.$ elem.removeClass(MOBILECLASS); (_base.$ mobileNav) && _base.$ mobileNav.hide(); } }, initAutoPlay: function (_base) { if (_base.settings.autoplay !== false && _base.settings.autoplay != null) { if (_base.set tings.autoplay.interval > 0) { _base.stop(); _base.autoplayIntervalId = setInterval(function () { _base.next(_base); }, _base.settings.autoplay.interval); } else { _base.stop(); } } else { _base.stop(); } }, changeHash: function (_base, tab) { var _prefix = (_base.settings.deeplinkingPrefix) ? _base.settings.deeplinkingPrefix : _base.tabID; if (_base.settings.animating !== true) { if (_base.settings.deeplinking === true) { if (typeof ($ (window).hashchange) != “undefined”) { //window.zozo.debug.start(); _base.Deeplinking.set(_prefix, tab, _base.settings.deeplinkingSeparator, _base.settings.deeplinkingMode); //window.zozo.debug.stop(); } else { if (_base.BrowserDetection.isIE(7)) { //IE and browsers that don’t support hashchange methods.showTab(_base, tab); } else { //modern browsers _base.Deeplinking.set(_prefix, tab, _base.settings.deeplinkingSeparator, _base.settings.deeplinkingMode); } } } else { methods.showTab(_base, tab); } } }, getFirst: function (_bas e) { return 0; }, getLast: function (_base) { if (_base.settings.noTabs === true) { return parseInt(_base.$ container.children(“div”).size()-1); } return parseInt(_base.$ tabGroup.children(“li”).size()-1); }, isCompact: function (_base) { return (_base.settings.position === zozo.classes.positions.topCompact || _base.settings.position === zozo.classes.positions.bottomCompact) }, isTop: function (_base) { if (_base.settings.original.position === null) { _base.settings.original.position = _base.settings.position; } return (_base.settings.original.position.indexOf(“top”) >= 0); }, isLightTheme: function (_base) { var _lightThemes = ["red", "deepblue", "blue", "green", "orange", "black"]; var _isLight = true; var _isFlat = methods.isFlatTheme(_base); if (_base.settings.style !== UNDERLINEDCLASS) { ($ .inArray(_base.settings.theme, _lightThemes) > -1) && (_isLight = false); (_isFlat) && (_isLight = false); } return _isLigh t; }, isFlatTheme: function (_base) { return (_base.settings.theme.indexOf(“flat”) >= 0); }, isResponsive: function (_base) { return (_base.$ elem.hasClass(RESPONSIVECLASS) === true) }, tabExist: function (_base, tab) { return (_base.$ tabs.filter(“li[" + _base.settings.hashAttribute + "='" + tab + "']“).length> 0) }, isMobile: function (_base) { return (_base.$ elem.hasClass(MOBILECLASS) === true) }, isTabDisabled:function (_tab) { return (_tab.hasClass(DISABLEDCLASS) || _tab.data(DISABLED) === true); }, allowAutoScrolling: function (_base) { return (_base.settings.mobileAutoScrolling != null && _base.settings.mobileAutoScrolling != false) }, getElementSize: function (_content) { var _size = { width: 0, height: 0 }; if (_content == null || _content.length == 0) { return _size; } if (_content.is(“:visible”) === false) { _size.height = _content.show().find(“>.z-content-inner”).innerHeight(); _size.width = _cont ent.show().find(“>.z-content-inner”).outerWidth(); if (_size.height >= 0) { //_size.height = _content.height(); } _content.hide(); } else { _size.height = _content.find(“>.z-content-inner”).innerHeight(); _size.width = _content.find(“>.z-content-inner”).outerWidth(); if (_size.height >= 0) { //_size.height = _content.height(); } } (_content.hasClass(“z-video”) && ( _size.height= _content.innerHeight())); return _size; }, getWidth: function (object) { if (object == null || object.length == 0) { return 0; } object = object.find(“a”); var value = object.outerWidth(); //value += parseInt(object.css(“padding-left”), 10) + parseInt(object.css(“padding-right”), 10); //Total Padding Width value += parseInt(object.css(“margin-left”), 10) + parseInt(object.css(“margin-right”), 10); //Total Margin Width value += parseInt(object.css(“borderLeftWidth”), 1 0) + parseInt(object.css(“borderRightWidth”), 10); //Total Border Width return value; }, isLarger: function (_small, _large) { var _r = _small; if (_small < _large) { _r = _large; } return _r; } }; var transition = { init: function (_base, _tabElement) { _base.$ contents.hide() _tabElement.content.css({ “opacity”: “”, “left”: “”, “top”: “”, “position”: “relative” }).show(); setTimeout(function () { _base.$ container.find(“.z-tabs”).each(function (index, item) {$ (item).data(‘zozoTabs’).refresh();}); _base.$ elem.trigger(SELECT, { tab: _tabElement.tab, content: _tabElement.content, index: _tabElement.index }); _base.settings.animating = false; }, _tabElement.duration >= 0 ? 200 : _tabElement.duration); if (_base.settings.orientation === VERTICALCLASS) { /*set content height for animation*/ methods.setContentHeight(_base, _tabElement.con tent,true); } return _base; }, before: function (_base, _tabElement) { setTimeout(function () { _tabElement.content.find(“.z-tabs”).each(function (index, item) { $ (item).data(‘zozoTabs’).refresh(); }); }, 50); if (_base.settings.animation.effects !== zozo.animation.effects.none) { /*set content height for animation*/ methods.setContentHeight(_base, _tabElement.preContent, true); methods.setContentHeight(_base, _tabElement.content); } _base.$ container.addClass(ANIMATINGCLASS); _tabElement.preContent.css({ “position”: “absolute”, “display”: “block”, “left”: 0, “top”: 0 }); _tabElement.content.css({ “position”: “absolute”, “display”: “block” }); return _base; }, after: function (_base, _tabElement) { setTimeout(function () { _tabElement.content.css({ “position”: “relative” }); _tabElement.preContent.css({ “ display”: “none” }); }, _tabElement.duration); /*hide all other tab contents*/ _base.$ contents.each(function (index, item) { if (_tabElement.index != index && _tabElement.preIndex != index) { $ (item).css({ _transition: “”, “position”: “”, “display”: “”, “left”: “”, “top”: “” }); } }); setTimeout(function () { _base.$ elem.trigger(SELECT, { tab: _tabElement.tab, content: _tabElement.content, index: _tabElement.index }); _base.$ elem.trigger(DEACTIVATE, { tab: _tabElement.preTab, content: _tabElement.preContent, index: _tabElement.preIndex }); var _cssProperties = (_base.settings.orientation === VERTICALCLASS) ? { “height”: “” } : { “height”: “”, “min-height”: “”, “overflow”: “” }; /*remove content height and set relative positioning*/ _base.$ container.css(_cssProperties); _base.$ container.removeClass(ANIMATINGCLASS); setTimeout(function () { _base.$ contents.removeClass(zozo.classes.active).eq(_tabElement.index).addClass(zozo.classes.active); _base.settings.animating = false; _base.$ contents.stop(true, true); }); }, _tabElement.duration+50); return _base; } }; ZozoTabs.defaults = ZozoTabs.prototype.defaults; $ .fn.zozoTabs = function (options) { return this.each(function () { if (undefined == $ (this).data(zozo.pluginName)) { var zozoTabs = new ZozoTabs(this, options).init(); $ (this).data(zozo.pluginName, zozoTabs); } }); }; window.zozo.tabs = ZozoTabs; $ (document).ready(function () { $ (“[data-role='z-tabs']“).each(function (index, item) { if (!$ (item).zozoTabs()) { $ (item).zozoTabs(); } }); }); })(jQuery, window, document);

    Brian X Chen, Feb 6, 2017, The International New York Times:

    As smart home devices become more popular, they will become bigger targets for hackers.

    When shopping for an Internet-connected home device like a smart speaker, or television set, a good rule of thumb is to go with a trusted brand, says Brian X Chen

    Modern homes today are getting Internet-connected light bulbs, thermostats, TVs and speakers. So with a simple voice command or the touch of a button on our smartphones, we can set the temperature, turn on a light or prepare the TV to record a programme.

    What could go wrong? A lot more than most people are prepared for, it turns out. If one of these devices gets hijacked, hackers could potentially snoop around for sensitive data like financial or health information. Or they could use a network of compromised devices to perform a widespread attack that takes down major websites, which is what happened in October.

    The good news is that so far, online attacks on home devices are relatively uncommon. Only 10% of US consumers said they were victims of the crime in a recent study done for the Hartford Steam Boiler Inspection and Insurance Co. However, those who experienced such an attack through their home gadgets reported losses of $ 1,000 to $ 5,000 from the incidents.

    "There's still this whole sort of, 'Gee whiz, it's so cool' thing that's going on" with Internet-connected home appliances, said Lee Tien, a lawyer for the Electronic Frontier Foundation, a nonprofit that focuses on digital rights. "That's also what often gets us into trouble."

    As smart home devices become more popular, they will become bigger targets for hackers. So it behooves us to get ahead of the curve by securing our home appliances, using these tips from security experts who have closely studied smart home accessories.

    Research before you buy

    When shopping for an Internet-connected home device like a smart speaker, lighting system or television set, a good rule of thumb is to go with a trusted brand. Larger, well-regarded companies like Amazon or Google have a background in developing products with security in mind, said Liviu Arsene, an analyst for Bitdefender, which sells security hardware for protecting smart home accessories.
    Before buying a product, consumers should do a web search on it to see if the company regularly issues software updates that fix security vulnerabilities, he said. People should also carefully read company privacy policies. David Britton, a vice president in the fraud and identity department of Experian, the credit reporting agency, said people should be curious about whether companies themselves were a threat to user privacy.

    "What are they capturing about you?" he said. "Is the data leaving the device? Is it being sent back to the mother ship?" Consider the smart speakers from Amazon and Google. Amazon said its Alexa smart assistant, which is used in its Echo speakers, automatically downloads software updates to defend against new security threats. Data from the Echo is also uploaded to Amazon's servers only after people utter the wake word "Alexa," the company said. That minimises the likelihood that the device will record conversations unrelated to requests intended for Alexa.

    Google said its Home speaker similarly issued regular software updates and employed advanced security features, like a technique that disables the device if its software is tampered with. The company added that the speaker processed speech only after the words "OK Google" or "Hey Google" were detected.

    But other large brands occasionally engage in behaviour that customers may find objectionable. The smart TV maker Vizio, for example, made headlines with revelations from the investigative news site ProPublica that it kept a detailed record of customer viewing habits and shared it with advertisers, who could then use the information to identify other devices you owned.

    Strengthen your Wi-Fi security

    Your Wi-Fi network is the pulse of your smart home, thus it is a vulnerable attack point. Britton and Arsene suggest connecting all your smart home accessories — for example, your Amazon Echo, Nest thermostat, Samsung smart refrigerator and Philips Hue smart lights — onto a Wi-Fi network that is separate from the one connected to your computing devices, like your smartphone, tablet and computer.

    With two distinct Wi-Fi networks, it will be harder for a hacker to jump from infiltrating your smart accessory on one network to a personal computer on the other network, Arsene said. The easiest way to create a second Wi-Fi network is to make a guest network. Many modern Wi-Fi routers, like TP-Link's Archer C7, include the ability to host a network for guests that uses a name and password different from that of your primary network.

    Quarantining your smart speakers, lights and TV onto a guest network will allow them all to interact with one another, while keeping your computing devices safer in the event that any of the smart accessories are hacked. If you are paranoid about your Wi-Fi network being hacked, you can also change the Wi-Fi router's network settings to disable broadcasting the network name entirely, Britton said.

    That would make it difficult for a hacker driving by to detect and compromise your network, though it would also require house guests to manually type in your network name and password when they log on to your Wi-Fi.

    Beef up your wimpy passwords

    The same security principles for websites apply to the so-called IoT. You should set strong, unique passwords for logging into each device you own. If you recycle your passwords and one device is compromised, the others can be, too. A strong password can be a random string of characters or a nonsensical phrase with numbers and special characters.

    If you cannot memorise your passwords, that is a good thing: That means they are hard for hackers to crack. Keep them written down on a piece of paper and stored in a safe place, or store your passwords in a password-managing app like 1Password or LastPass.

    Regularly audit appliances for updates

    While reputable manufacturers of smart home accessories offer software updates to patch security vulnerabilities, it is often up to the consumer to stay on top of updates. Because it lacks a screen, a smart light bulb or an Internet-connected power socket is going to have a tough time informing you that it needs a software update. Britton and Arsene recommend that consumers regularly log into the mobile apps or websites for their smart home accessories to check if they need software updates. If updates are available, install them immediately.

    When in doubt, hit mute

    Among security researchers, putting a piece of tape over a computer webcam has become a tongue-in-cheek recommendation for those who are extra paranoid about their privacy. (Even Mark Zuckerberg, Facebook's chief executive, does it.) With smart speakers like the Amazon Echo and Google Home, there is an equivalent: a mute button to disable the device microphone so it can no longer listen. In the unlikely event that a device is hijacked, muting the microphone could help prevent hackers from listening to your conversations, Britton said. Or you could go the safest route and opt out of having these devices at all.

     

LikeTweet

No comments:

Post a Comment