//'+ ''+ ''+ ''+ '
'+ '' + '' + obj.name.substr(0,this.li_name_size) + ': '+ obj.description.substr(0,this.li_description_size) + '
'+ ''; alink = document.createElement("a"); alink.href="#"; alink.className="em"; alink.onclick = function(){widgetSilkfairStore270_4119.widgetShowItem(idx);return false;} alink.innerHTML = strOut; return alink; } this.widgetDrawItems = function(){ if(this.Items.length <= this.itemsToShow) { i = 0; to = this.Items.length; } else { i = this.currentItem; if ((this.currentItem + this.itemsToShow) <= this.Items.length){ to = this.currentItem + this.itemsToShow; }else{ to = this.Items.length; } } document.getElementById(this.el_items_list).innerHTML = ""; for (i;i<=to;i++){ obj = this.Items[i]; strOut = this.widgetDrawItem(i); document.getElementById(this.el_items_list).appendChild(strOut); } } this.widgetShowItem = function(idx){ this.thumbHighlight(idx); container = document.getElementById(this.el_image_preview); str_image = ""; container.innerHTML = str_image; document.getElementById(this.el_widget_item_name).innerHTML = this.Items[idx].name.substr(0, this.item_name_size); document.getElementById(this.el_widget_item_description).innerHTML = this.Items[idx].description.substr(0, this.item_description_size); document.getElementById(this.el_item_price).innerHTML = this.Items[idx].price; document.getElementById(this.el_item_link).href = this.storeDomain + "/" + this.Items[idx].id; } this.widgetShowNullItem = function(){ container = document.getElementById(this.el_image_preview); str_image = ""; container.innerHTML = str_image; document.getElementById(this.el_widget_item_name).innerHTML = "Astrida Naturals".substr(0, this.store_name_size); document.getElementById(this.el_items_list).innerHTML = "Astrida Naturals brings you high quality body and skin care products that are designed to pamper and improve the quality of your skin and hair. I specialize in products made with unrefined shea butter. All of my shea butter products are made with 100% raw unrefined, fair trade, shea butter imported from Ghana, Africa. Unrefined shea butter has a multitude of healing and moisturizing benefits fo...".substr(0, this.store_description_size); } this.thumbHighlight = function(idx){ if(this.Items.length <= this.itemsToShow) { i = 0; to = this.Items.length; } else { i = this.currentItem; to = this.currentItem + this.itemsToShow; } for (i;i<=to;i++){ obj = this.Items[i] if ( document.getElementById(this.el_thumb_prefix + i) ){ document.getElementById(this.el_thumb_prefix + i).className = "wg_thumb"; } } document.getElementById(this.el_thumb_prefix + idx).className = "wg_thumb_high"; } this.cc_ids = [101,102,104,4039]; /* Prototype functions */ this.addClassName = function(element, className) { if (!this.hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; } this.removeClassName = function(element, className) { element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ');//.strip() return element; } this.toggleClassName = function(element, className) { //if (!(element = document.getElementById(element))) return; return this[this.hasClassName(element, className) ? 'removeClassName' : 'addClassName'](element, className); } this.hasClassName = function(element, className) { //if (!(element = document.getElementById(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); } this.hide = function(elem){ elem.style.display = "none"; } this.toggle = function(elem){ if ( elem.style.display != "none"){ elem.style.display = "none"; }else{ elem.style.display = "list-item"; } } this.roll = function(el){ var menu_element = document.getElementById('menu_cc_'+el); if (!menu_element) return ; var left = menu_element.getAttribute('lft') * 1; var right = menu_element.getAttribute('rgt') * 1; if(left + 1 == right) return ; this.toggleClassName(menu_element,'has_child'); var closed = this.hasClassName(menu_element,'has_child'); if(closed) { for (var i = 0; i <= this.cc_ids.length-1; i++){ var node = document.getElementById('menu_cc_'+this.cc_ids[i]); var node_left = node.getAttribute('lft') * 1; if((node_left > left) && (node_left < right)){ this.hide(node); var node_right = node.getAttribute('rgt') * 1; if(node_left + 1 < node_right )this.addClassName(node, 'has_child'); } } } else { for (var i = 0; i <= this.cc_ids.length-1; i++){ node = document.getElementById('menu_cc_'+this.cc_ids[i]); if( this.hasClassName(node,'parent_id_'+el) ){ this.toggle(node); } } } } // Custom Category Tree this.widgetDrawCustomCategoryTree = function(){ var boxCCId = "custom_category_tree"; var element = document.getElementById(boxCCId); var strOut = ""; if (element != undefined){ strOut += ''; element.innerHTML = strOut; } } // Default html : version = 1 this.widgetDrawHtml = function(){ strOut = '
' + '' + '' + '' + '' + '' + '' + '
avatarAstrida Naturals
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '
' + '' + '' + '' + '
Click for details
' + '
' + '
' + '' + '' + '' + '' + '
'; if ( document.getElementById("widget_preview") ){ document.getElementById("widget_preview").innerHTML = strOut; }else{ document.write(strOut); } } this.drawCssLink = function(){ var objCss=document.createElement('link'); objCss.rel='stylesheet'; objCss.type='text/css'; objCss.href='http://silkfair.com/widget/style2.css'; //objCss.href='http://silkfair.com/widget/style.css'; objCss.media='all'; document.lastChild.firstChild.appendChild(objCss); } this.widgetDrawWidget = function(){ this.setupElements(); if (document.getElementById(this.el_container)!= undefined){ return false; } this.drawCssLink(); this.widgetDrawHtml(); this.widgetDrawItems(); if(this.Items.length >= 0){ this.widgetShowItem(this.currentItem); }else{ this.widgetShowNullItem(); } this.widgetDrawCustomCategoryTree(); } }//widgetSilkfairStore Class var widgetSilkfairStore270_4119 = new widgetSilkfairStore(); widgetSilkfairStore270_4119.suffix = "270_4119"; widgetSilkfairStore270_4119.item_name_size = 28; widgetSilkfairStore270_4119.item_description_size = 110; widgetSilkfairStore270_4119.li_name_size = 20; widgetSilkfairStore270_4119.li_description_size = 30; widgetSilkfairStore270_4119.store_description_size = 400; widgetSilkfairStore270_4119.widgetDrawHtml = function(){ strOut = '
' + '' + '' + '' + '' + '' + '
' + ' ' + ' ' + ' ' + '
avatarAstrida Naturals
' + '
' + ' ' + '
' + '
' + '
' + '
' + '
' + '
' + ' ' + ' ' + ' ' + '
Click for details
' + '
' + '
' + '
' + '
' + ' ' + ' ' + ' ' + ' ' + '
' + '
'; if ( document.getElementById("widget_preview") ){ document.getElementById("widget_preview").innerHTML = strOut; }else{ document.write(strOut); } }//widgetDrawHtml widgetSilkfairStore270_4119.widgetDrawWidget(); // google-analytics var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); gaTracker = function(){ if (typeof(_gat) == "object"){ var pageTracker = _gat._getTracker("UA-3580677-1"); pageTracker._initData(); pageTracker._trackPageview(); } } gaTracker(); //]]>