// JavaScript Document var isEmailExist = false; function showhideTab(tabCount, paneId, tabId, contId) { var _tabObj = new Object(); var _contObj = new Object(); for (i = 1; i <= tabCount; i++) { _tabObj[i] = document.getElementById('newtab_' + paneId + '_' + i); _contObj[i] = document.getElementById('newCont_' + paneId + '_' + i); if (_tabObj[i] != undefined && _contObj[i] != undefined) { _tabObj[i].removeAttribute('class'); _contObj[i].setAttribute('class', 'disNone'); } } document.getElementById(tabId).setAttribute('class', 'active'); document.getElementById(contId).removeAttribute('class'); } function showhideButtonTab(tabCount, paneId, tabId, contId) { var _tabObj = new Object(); var _contObj = new Object(); for (i = 1; i <= tabCount; i++) { _tabObj[i] = document.getElementById('newtab_' + paneId + '_' + i); _contObj[i] = document.getElementById('newCont_' + paneId + '_' + i); if (_tabObj[i] != undefined && _contObj[i] != undefined) { _tabObj[i].removeAttribute('class'); _tabObj[i].setAttribute('class', 'btnlitBluUnSel mL5'); _contObj[i].setAttribute('class', 'disNone'); } } document.getElementById(tabId).setAttribute('class', 'btnBlkSel mL5'); document.getElementById(contId).removeAttribute('class'); } function setRssPath(id , path){ if(id!='' && path!=''){ document.getElementById('rss_href_'+id).innerHTML = ''; } } function showhideEmailBox( id , type ){ if(type=='y' && id!='') document.getElementById('emailbox_' + id).style.display = 'block'; else if(type=='n' && id!='') document.getElementById('emailbox_' + id).style.display = 'none'; } function validEmailForm(id){ if(id!=''){ $("#email_form"+id).validationEngine(); $("#email_form"+id).submit(); } } function validateEmail(field) { var regex= /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; // /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; return (regex.test($.trim(field))) ? true : false; } function validateNumberWithBracketHyphen(field) { var regex= /^[0-9 \\\/{}\]\[)(_-]{0,200}$/; return (regex.test($.trim(field))) ? true : false; } function checkMultiEmail(obj) { if(obj.val()!=''){ var result = obj.val().split(/[;,]+/); // split element by , and ; for(var i = 0;i < result.length;i++) if(!validateEmail(result[i])) return '* Invalid email address, please type address separated by commas.'; } } function checkNumberGrNZe(obj){ if( obj.val() < 1 ){ return '* Please insert quantity greater then zero.'; } } function isValidContactNumber(obj){ if(obj.val()!=''){ var contactNumber = obj.val(); if(!validateNumberWithBracketHyphen(contactNumber)) return '* Invalid contact number.'; } } function checkEmailStatus(email){ $("#email_error").html(''); $("#email_error").hide(); if(email!=''){ var userEmail = $.trim(email); $.ajax({ url: "/user/request-handler/is-email-exist", type: 'POST', cache: false, data: { 'userEmail': userEmail}, success: function(data){ var option = eval(data); if(option.isExist){ $("#email_error").show(); isEmailExist = true; $("#email_error").html('
* This email is already exist.
'); $('#email_error').focus(); }else{ isEmailExist = false; //$("#email_error").html('
* This email is available.
'); } } }); } } function isValidEmail(obj){ if(obj.val()!=''){ var email = obj.val(); if(!validateEmail(email)) return '* Invalid email address.'; } } function validRegistrationForm(){ var email = $("#user_email").val(); if(email!='') checkEmailStatus(email); $("#registration_form").validationEngine(); if(!isEmailExist){ $("#registration_form").submit(); } } function validRegistrationForm2(type){ if(type){ $("#registration_form2").submit(); }else{ $("#registration_form2").validationEngine(); $("#registration_form2").submit(); } } function validUpdateProductForm(key){ $("#action_type").val(key); $(".msg").hide(); $("#update_product_form").validationEngine(); $("#update_product_form").submit(); } function validFormFields(form){ $("#"+form).validationEngine('hideAll'); $(".msg").hide(); $("#"+form).validationEngine(); $("#"+form).submit(); } function validLoginForm(){ $("#login_message").hide(); var loginEmail = $("#login_email").val(); var loginPassword = $("#login_password").val(); var rememberMe = '0'; if($('#remember_me').is(":checked")){ rememberMe = '1'; } if(loginEmail == '') { $("#login_message").show(); $("#login_message").html('Please insert email.'); return false; } if(loginEmail != '' && !validateEmail(loginEmail)){ $("#login_message").show(); $("#login_message").html('Please insert valid email.'); return false; } if(loginPassword == '') { $("#login_message").show(); $("#login_message").html('Please insert password.'); return false; } $.ajax({ url: "/user/request-handler/authenticate", type: 'POST', data: { 'loginEmail': loginEmail , 'loginPassword': loginPassword , 'rememberMe': rememberMe }, success: function(data){ var option = eval(data); if(option.res == 0){ $("#login_message").show(); $("#login_message").html(option.msg); return false; }else if(option.res == 1){ top.frames.location.reload(false); return true; } } }); } function validForgetPasswordForm(){ $("#forget_message").hide(); var forgetEmail = $("#forget_email").val(); var flag = true; if(forgetEmail == '') { $("#forget_message").show(); $("#forget_message").html('Please insert email.'); flag = false; } if(forgetEmail != '' && !validateEmail(forgetEmail)){ $("#forget_message").show(); $("#forget_message").html('Please insert valid email.'); flag = false; } if(flag){ var forgetPassData = $("#forget_password_form").serialize(); $(".onkeyupforgetcls").hide(); $("#forget_message").show(); $("#forget_message").html('Processing...'); $("#forget_email").attr('disabled',true); $(".forget_password_captcha_div").css('display','none'); $.ajax({ url: "/user/request-handler/forget-password", type: 'POST', async: false, data: forgetPassData, success: function(data){ var option = eval(data); if(option.res == 0){ $(".forget_password_captcha_div").css('display','block'); $("#forget_message").html(option.msg); $(".onkeyupforgetcls").show(); $("#forget_email").attr('disabled',false); $("#captcha_text").val(''); var _id = 'forget_password_captcha'; $.ajax({ "type" : "POST", "url" : "/request-handler/reload-captcha", "success" : function(data){ if(data!=undefined){ try{ var _res = eval(data); if(_res.err!=undefined && _res.id!=undefined && _res.msg!=undefined){ if(_res.err=='0'){ var captchaId = "#captcha_id_"+_id; var imgCaptchaBox = "#image_captcha_box_"+_id; $(captchaId).val(_res.id); $(imgCaptchaBox).html(_res.msg); }else{ alert(_res.msg); } } }catch(e){} } } }); }else if(option.res == 1){ $(".successMsgShow").html(option.msg); setTimeout('window.location.reload()', 5000); } } }); } } function capitaliseFirstLetter(elemId) { var txt = $.trim($("#" + elemId).val().toLowerCase()); $("#" + elemId).val(txt.replace(/^(.)|\s(.)/g, function($1) { return $1.toUpperCase(); })); } function checkConfirmPassword(obj) { if(obj.val()!=''){ var confirmPassword = obj.val(); var userPassword = $("#user_password").val(); if( userPassword != confirmPassword ) return '* Please enter confirm password same as password.'; } } function checkNewConfirmPassword(obj) { if(obj.val()!=''){ var confirmPassword = obj.val(); var userPassword = $("#user_password").val(); if( userPassword != confirmPassword ) return '* Please enter confirm password same as new password.'; } } function checkPasswordStatus(obj) { if(obj.val()!=''){ var userPassword = obj.val(); if(userPassword.length < 5){ return '* Please enter minimum 6 characters password.'; } /*if(userPassword.length > 5){ var regex = /^(?=.*\d)(?=.*[A-Za-z])[A-Za-z0-9]{1,15}$/; var flag = (regex.test($.trim(userPassword))) ? false : true; if(flag) return '* Given password is weak, please enter 6-15 Alpha Numeric values, no special character.'; }else{ return '* Please enter 6-15 Alpha Numeric values, No special character.'; }*/ } } function checkAtLeastOne(obj) { var checkLen = $('.isChecked').filter(':checked').length; if(checkLen==0){ return '* Please check at least one checkbox.'; } } function setSubsPrice(id , type){ if( id > 0 ){ var subsVal = $("#subscription_"+type+"_"+id).val(); var subsArr = subsVal.split('#@#'); if( subsArr[1] > 0 ){ $("#price_"+type+"_"+id).html('Rs. '+subsArr[1]); } } } /*function showhidemarTab(tabId, contId) { for (i = 1; i <= 2; i++) { document.getElementById('marTab' + i).className = ''; document.getElementById('marCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; }*/ function showhidemar1Tab(tabId, contId) { for (i = 1; i <= 2; i++) { document.getElementById('mar1Tab' + i).className = ''; document.getElementById('mar1Cont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhideIntTab(tabId, contId) { for (i = 1; i <= 3; i++) { document.getElementById('intNatTab' + i).className = ''; document.getElementById('intNatCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidestokeTab(tabId, contId) { for (i = 1; i <= 4; i++) { document.getElementById('stkTab' + i).className = ''; document.getElementById('stkCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidestk1Tab(tabId, contId) { for (i = 1; i <= 6; i++) { document.getElementById('stk1Tab' + i).className = ''; document.getElementById('stk1Cont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhideindustTab(tabId, contId) { for (i = 1; i <= 6; i++) { document.getElementById('industTab' + i).className = ''; document.getElementById('industCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidederivattTab(tabId, contId) { for (i = 1; i <= 6; i++) { document.getElementById('derivatTab' + i).className = ''; document.getElementById('derivatCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidefeaTab(tabId, contId) { for (i = 1; i <= 6; i++) { document.getElementById('feaTab' + i).className = ''; document.getElementById('feaCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidestk2Tab(tabId, contId) { for (i = 1; i <= 2; i++) { document.getElementById('stk2Tab' + i).className = ''; document.getElementById('stk2Cont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidestk3Tab(tabId, contId) { for (i = 1; i <= 3; i++) { document.getElementById('stk3Tab' + i).className = ''; document.getElementById('stk3Cont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhideinstiTab(tabId, contId) { for (i = 1; i <= 3; i++) { document.getElementById('instiTab' + i).className = ''; document.getElementById('instiCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhideallindiTab(tabId, contId) { for (i = 1; i <= 2; i++) { document.getElementById('allindiTab' + i).className = ''; document.getElementById('allindiCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showhidenseTab(tabId, contId) { for (i = 1; i <= 4; i++) { document.getElementById('nseTab' + i).className = ''; document.getElementById('nseCont' + i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function showpop(obj, lyr, e) { var coors = findPos(obj); var x = document.getElementById(lyr); if (lyr == "new_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "mkt_MMLyr") { x.style.top = coors[1] + 21 + 'px'; x.style.left = coors[0] + -131 + 'px'; } if (lyr == "com_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "opn_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "tech_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "tech_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "spc_MMLyr") { x.style.top = coors[1] + 21 + 'px'; x.style.left = coors[0] + -521 + 'px'; } if (lyr == "porfnc_MMLyr") { x.style.top = coors[1] + 8 + 'px'; x.style.left = coors[0] + -20 + 'px'; } if (lyr == "searchLyr") { x.style.top = coors[1] + 62 + 'px'; x.style.left = coors[0] + -180 + 'px'; } if (lyr == "bs_MotorLyr") { x.style.top = coors[1] + 52 + 'px'; x.style.left = coors[0] + -420 + 'px'; } if (lyr == "bs_MotorLyr1") { x.style.top = coors[1] + -435 + 'px'; x.style.left = coors[0] + -462 + 'px'; } x.style.display = "block"; } function hidepop(obj, lyr) { var x = document.getElementById(lyr); x.style.display = "none"; } function showVideo(playerId, flvFile, playerUrl, width, height) { var so = new SWFObject(playerUrl, "swfplayer", width, height, "9", "#000000"); so.addVariable("flv", flvFile); so.addParam("allowFullScreen", "true"); so.addVariable("backcolor", "DADADA"); so.addVariable("frontcolor", "B90800"); so.addParam("autoplay", "true"); so.write(playerId); } function InptContFocus(id,inputValue) { if (document.getElementById(id).value == inputValue) { document.getElementById(id).value = ''; } } function InptContBlur(id, inputValue) { if (document.getElementById(id).value == '') { document.getElementById(id).value = inputValue; } } function toggleMrkTab(id1, id2, imgPath, coCode, coName, exchange) { if (id1 == "smryGraph") { document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'block'; if(exchange == 'bse'){ $("#marTab2").removeClass("active"); $("#marTab1").addClass("active"); document.getElementById('marCont1').style.display = 'block'; document.getElementById('marCont2').style.display = 'none'; } else { $("#marTab1").removeClass("active"); $("#marTab2").addClass("active"); document.getElementById('marCont2').style.display = 'block'; document.getElementById('marCont1').style.display = 'none'; } document.getElementById('toggleGraphText').innerHTML = 'Minus Image Click here for summary graph '; } else { document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'block'; if(exchange == 'bse') { document.getElementById('bseTab').style.display = 'block'; document.getElementById('nseTab').style.display = 'none'; document.getElementById('toggleGraphText').innerHTML = 'Plus Image Click here for interactive graph '; } else { document.getElementById('nseTab').style.display = 'block'; document.getElementById('bseTab').style.display = 'none'; document.getElementById('toggleGraphText').innerHTML = 'Plus Image Click here for interactive graph '; } } } function bsNewToggleMrkTab(id1, id2, imgPath, coCode, coName, exchange) { if (id1 == "smryGraph") { document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'block'; if(exchange == 'bse'){ $("#marTab2").removeClass("selected"); $("#marTab1").addClass("selected"); //document.getElementById('marCont1').style.display = 'block'; //document.getElementById('marCont2').style.display = 'none'; } else { $("#marTab1").removeClass("selected"); $("#marTab2").addClass("selected"); //document.getElementById('marCont2').style.display = 'block'; //document.getElementById('marCont1').style.display = 'none'; } document.getElementById('toggleGraphText').innerHTML = ' Click here for summary graph '; } else { document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'block'; if(exchange == 'bse') { $("#marTab2").removeClass("selected"); $("#marTab1").addClass("selected"); document.getElementById('toggleGraphText').innerHTML = ' Click here for interactive graph '; } else { $("#marTab1").removeClass("selected"); $("#marTab2").addClass("selected"); document.getElementById('toggleGraphText').innerHTML = ' Click here for interactive graph '; } } } // ================================================= slding images // ======================================= function slideimage(tabId, dataId, hideTabs, hideControls) { document.getElementById(tabId).className = 'imgCont_sel'; document.getElementById(dataId).style.display = 'block'; if (hideTabs.length > 0) { for ( var i = 0; i < hideTabs.length; i++) { document.getElementById(hideTabs[i]).className = 'imgCont'; document.getElementById(hideControls[i]).style.display = 'none'; } } } // ================================================= article tab // ======================================= var ids = new Array('cont1', 'cont2', 'cont3', 'cont4', 'cont5', 'cont6', 'cont7', 'cont8', 'cont9', 'cont10'); var tabs = new Array('arttab1', 'arttab2', 'arttab3', 'arttab4', 'arttab5', 'arttab6','arttab7','arttab8','arttab9','arttab10'); function showCont(id, tab) { hidedivids(); showdivs(id, tab); } function hidedivids() { for (i = 0; i < ids.length; i++) { document.getElementById(ids[i]).style.display = 'none'; } for (i = 0; i < tabs.length; i++) { document.getElementById(tabs[i]).className = ''; } } function showdivs(id, tab) { document.getElementById(id).style.display = 'block'; document.getElementById(tab).className = 'sel'; } function setHeight(id1, id2) { ht1 = document.getElementById(id1).clientHeight; ht2 = document.getElementById(id2).clientHeight; if (ht1 > ht2) h = ht1; else h = ht2; if (h == document.getElementById(id1).clientHeight) document.getElementById(id2).style.height = h + "px"; else document.getElementById(id1).style.height = h + "px"; } function showhideSubderiTab(tabId, contId) { for(i=1; i<=2; i++) { document.getElementById('intsubderiTab'+i).className = ''; document.getElementById('intsubderiCont'+ i).style.display = 'none'; } document.getElementById(tabId).className = 'active'; document.getElementById(contId).style.display = 'block'; } function changeProfileContent(categoryBlockMapId,pageCategoryId,itemId,itemDisplayOrder){$("a[id^='profile_li_']").removeClass("active_profile");if(categoryBlockMapId!=""&&pageCategoryId!=""&&itemDisplayOrder!=""){$("#profile_li_"+itemDisplayOrder).addClass("active_profile");$.ajax({type:"POST",url:"/request-handler/get-profile-content",data:{categoryBlockMapId:categoryBlockMapId,pageCategoryId:pageCategoryId,itemId:itemId,itemDisplayOrder:itemDisplayOrder},success:function(data){if(data!=undefined){try{var _res=eval(data);if(_res.err==0){$("#profile_"+categoryBlockMapId).html(_res.msg)}}catch(e){}}}})}}function changeQuotesContent(categoryBlockMapId,pageCategoryId,itemId,itemDisplayOrder){$("a[id^='quotes_li_']").removeClass("active_profile");if(categoryBlockMapId!=""&&pageCategoryId!=""&&itemDisplayOrder!=""){$("#quotes_li_"+itemDisplayOrder).addClass("active_profile");$.ajax({type:"POST",url:"/request-handler/get-quotes-content",data:{categoryBlockMapId:categoryBlockMapId,pageCategoryId:pageCategoryId,itemId:itemId,itemDisplayOrder:itemDisplayOrder},success:function(data){if(data!=undefined){try{var _res=eval(data);if(_res.err==0){$("#quotes_"+categoryBlockMapId).html(_res.msg)}}catch(e){}}}})}} /*function changeProfileContent(categoryBlockMapId, pageCategoryId, itemId, itemDisplayOrder){ $("a[id^='profile_li_']").removeClass('active_profile'); if( categoryBlockMapId != '' && pageCategoryId != '' && itemId != '' && itemDisplayOrder != '' ){ $("#profile_li_"+itemId).addClass('active_profile');; $.ajax({ "type" : "POST", "url" : "/request-handler/get-profile-content", "data" : { 'categoryBlockMapId': categoryBlockMapId , 'pageCategoryId':pageCategoryId , 'itemId':itemId , 'itemDisplayOrder':itemDisplayOrder }, "success" : function(data){ if(data!=undefined){ try{ var _res = eval(data); if(_res.err==0){ $("#profile_"+categoryBlockMapId).html(_res.msg); } }catch(e){} } } }); } } function changeQuotesContent(categoryBlockMapId, pageCategoryId, itemId, itemDisplayOrder){ $("a[id^='quotes_li_']").removeClass('active_profile'); if( categoryBlockMapId != '' && pageCategoryId != '' && itemId != '' && itemDisplayOrder != '' ){ $("#quotes_li_"+itemId).addClass('active_profile'); $.ajax({ "type" : "POST", "url" : "/request-handler/get-quotes-content", "data" : { 'categoryBlockMapId': categoryBlockMapId , 'pageCategoryId':pageCategoryId , 'itemId':itemId , 'itemDisplayOrder':itemDisplayOrder }, "success" : function(data){ if(data!=undefined){ try{ var _res = eval(data); if(_res.err==0){ $("#quotes_"+categoryBlockMapId).html(_res.msg); } }catch(e){} } } }); } } */ /*Subscription JS*/ function setNameContent(fn,ln,uid){ $("#name_div").html(''); $("#name_button_div").html(''); } function updateName(uid){ var firstName = $("#first_name").val(); var lastName = $("#last_name").val(); var p = $("#user_name_error"); var position = p.position(); var posTop = position.top - 40; var posLeft = position.left + 200; if(uid==''){ $("#user_name_error").show(); $("#user_name_error").html('
* User Id not defind , please re-login.
'); return false; } if( firstName == ''){ $("#user_name_error").show(); $("#user_name_error").html('
* First name is required.
'); return false; } if( lastName == ''){ $("#user_name_error").show(); $("#user_name_error").html('
* Last name is required.
'); return false; } $.ajax({ url: "/subscription-cart/request-handler/update-user-name", type: 'POST', cache: false, data: { 'uid': uid, 'firstName':firstName, 'lastName':lastName}, success: function(data){ var option = eval(data); if(option.res == 0){ $("#user_name_error").show(); $("#user_name_error").html('
* User name has been updated successfully.
'); $('#user_name_error').focus(); $("#name_div").html(''); $("#name_button_div").html(''); }else{ $("#user_name_error").show(); $("#user_name_error").html('
* User name update failed.
'); } } }); } function setPasswordContent(uid){ $("#password_div").html(''); $("#password_button_div").html(''); } function updatePassword(uid){ var password = $("#password").val(); var p = $("#password_error"); var position = p.position(); var posTop = position.top - 60; var posLeft = position.left + 200; if(uid==''){ $("#password_error").show(); $("#password_error").html('
* User Id not defind , please re-login.
'); return false; } if( password == ''){ $("#password_error").show(); $("#password_error").html('
* Password is required.
'); return false; } $.ajax({ url: "/subscription-cart/request-handler/update-user-password", type: 'POST', cache: false, data: { 'uid': uid, 'password':password }, success: function(data){ var option = eval(data); if(option.res == 0){ $("#password_error").show(); $("#password_error").html('
* User password has been updated successfully.
'); $('#password_error').focus(); $("#password_div").html(''); $("#password_button_div").html(''); }else{ $("#password_error").show(); $("#password_error").html('
* User password update failed.
'); } } }); } (function($){ $.fn.ticker = function(options) { // Extend our default options with those provided. // Note that the first arg to extend is an empty object - // this is to keep from overriding our "defaults" object. var opts = $.extend({}, $.fn.ticker.defaults, options); // check that the passed element is actually in the DOM if ($(this).length == 0) { if (window.console && window.console.log) { window.console.log('Element does not exist in DOM!'); } else { alert('Element does not exist in DOM!'); } return false; } /* Get the id of the UL to get our news content from */ var newsID = '#' + $(this).attr('id'); /* Get the tag type - we will check this later to makde sure it is a UL tag */ var tagType = $(this).get(0).tagName; return this.each(function() { // get a unique id for this ticker var uniqID = getUniqID(); /* Internal vars */ var settings = { position: 0, time: 0, distance: 0, newsArr: {}, play: true, paused: false, contentLoaded: false, dom: { contentID: '#ticker-content-' + uniqID, titleID: '#ticker-title-' + uniqID, titleElem: '#ticker-title-' + uniqID + ' SPAN', tickerID : '#ticker-' + uniqID, wrapperID: '#ticker-wrapper-' + uniqID, revealID: '#ticker-swipe-' + uniqID, revealElem: '#ticker-swipe-' + uniqID + ' SPAN', controlsID: '#ticker-controls-' + uniqID, prevID: '#prev-' + uniqID, nextID: '#next-' + uniqID, playPauseID: '#play-pause-' + uniqID } }; // if we are not using a UL, display an error message and stop any further execution if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type