1var testsuccess = 0; 2var lnid = new Array(); 3 4 5function categorylist(url) { 6 self.location = url; 7} 8 9var noresults=function(results) { 10 return true; 11} 12 13function roundNumber(num, dec) { 14 var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); 15 return result; 16} 17 18 19var getresults=function(results) { 20 eval(results); 21 if(window.drag_and_drop_cart_updater) { 22 drag_and_drop_cart_updater(); 23 } 24 if(document.getElementById('loadingimage') != null) { 25 document.getElementById('loadingindicator').style.visibility = 'hidden'; 26 } else if(document.getElementById('alt_loadingimage') != null) { 27 document.getElementById('alt_loadingindicator').style.visibility = 'hidden'; 28 } 29 if((document.getElementById('sliding_cart') != null) && (document.getElementById('sliding_cart').style.display == 'none')) { 30 jQuery("#fancy_collapser").attr("src", (WPSC_CORE_IMAGES_URL + "/minus.png")); 31 jQuery("#sliding_cart").show("fast",function(){ 32 ajax.post("index.php",noresults,"ajax=true&set_slider=true&state=1"); 33 }); 34 } 35 if(document.getElementById('fancy_notification') != null) { 36 jQuery('#loading_animation').css("display", 'none'); 37 //jQuery('#fancy_notificationimage').css("display", 'none'); 38 } 39} 40 41function submitform(frm, show_notification) 42{ 43 ajax.post("index.php?ajax=true&user=true",getresults,ajax.serialize(frm)); 44 if(document.getElementById('loadingimage') != null) { 45 document.getElementById('loadingimage').src = WPSC_CORE_IMAGES_URL + '/indicator.gif'; 46 document.getElementById('loadingindicator').style.visibility = 'visible'; 47 }else if(document.getElementById('alt_loadingimage') != null){ 48 document.getElementById('alt_loadingimage').src = WPSC_CORE_IMAGES_URL + '/indicator.gif'; 49 document.getElementById('alt_loadingindicator').style.visibility = 'visible'; 50 } 51 52 return false; 53} 54 55 56function prodgroupswitch(state) 57{ 58 if(state == 'brands'){ 59 jQuery('.categorydisplay').css("display", 'none'); 60 jQuery('.branddisplay').css("display", 'block'); 61 }else if(state == 'categories'){ 62 jQuery('.categorydisplay').css("display", 'block'); 63 jQuery('.branddisplay').css("display", 'none'); 64 } 65 return false; 66} 67 68var previous_rating; 69function ie_rating_rollover(id,state) 70{ 71 target_element = document.getElementById(id); 72 switch(state) 73 { 74 case 1: 75 previous_rating = target_element.style.background; 76 target_element.style.background = "url(" + WPSC_CORE_IMAGES_URL + "/blue-star.gif)"; 77 break; 78 79 default: 80 if(target_element.style.background != "url(" + WPSC_CORE_IMAGES_URL + "/gold-star.png)") 81 { 82 target_element.style.background = previous_rating; 83 } 84 break; 85 } 86} 87 88var apply_rating=function(results) 89{ 90 outarr = results.split(","); 91 //alert(results); 92 for(i=1;i<=outarr[1];i++) 93 { 94 id = "star"+outarr[0]+"and"+i+"_link"; 95 document.getElementById(id).style.background = "url(" + WPSC_CORE_IMAGES_URL + "/gold-star.png)"; 96 } 97 98 for(i=5;i>outarr[1];i--) 99 { 100 id = "star"+outarr[0]+"and"+i+"_link"; 101 document.getElementById(id).style.background = "#c4c4b8"; 102 } 103 lnid[outarr[0]] = 1; 104 105 rating_id = 'rating_'+outarr[0]+'_text'; 106 //alert(rating_id); 107 if(document.getElementById(rating_id).innerHTML != "Your Rating:") 108 { 109 document.getElementById(rating_id).innerHTML = "Your Rating:"; 110 } 111 112 saved_id = 'saved_'+outarr[0]+'_text'; 113 document.getElementById(saved_id).style.display = "inline"; 114 update_vote_count(outarr[0]); 115} 116 117function hide_save_indicator(id) 118{ 119 document.getElementById(id).style.display = "none"; 120} 121 122function rate_item(prodid,rating) 123{ 124 ajax.post("index.php",apply_rating,"ajax=true&rate_item=true&product_id="+prodid+"&rating="+rating); 125} 126 127function update_vote_count(prodid) 128{ 129 var update_vote_count=function(results) 130 { 131 outarr = results.split(","); 132 vote_count = outarr[0]; 133 prodid = outarr[1]; 134 vote_count_id = 'vote_total_'+prodid; 135 document.getElementById(vote_count_id).innerHTML = vote_count; 136 } 137 ajax.post("index.php",update_vote_count,"ajax=true&get_rating_count=true&product_id="+prodid); 138} 139 140 141function update_preview_url(prodid) 142{ 143 image_height = document.getElementById("image_height").value; 144 image_width = document.getElementById("image_width").value; 145 if(((image_height > 0) && (image_height <= 1024)) && ((image_width > 0) && (image_width <= 1024))) 146 { 147 new_url = "index.php?productid="+prodid+"&height="+image_height+"&width="+image_width+""; 148 document.getElementById("preview_link").setAttribute('href',new_url); 149 } 150 else 151 { 152 new_url = "index.php?productid="+prodid+""; 153 document.getElementById("preview_link").setAttribute('href',new_url); 154 } 155 return false;
156} 157 158function change_variation(product_id, variation_ids, special) { 159 value_ids = ''; 160 special_prefix = ""; 161 if(special == true) { 162 form_id = "specials_"+product_id; 163 } else { 164 form_id = "product_"+product_id; 165 } 166 for(var i in variation_ids) { 167 if(!isNaN(parseInt(i))) { 168 variation_name = "variation["+variation_ids[i]+"]"; 169 value_ids += "&variation[]="+document.getElementById(form_id).elements[variation_name].value; 170 } 171 } 172 if(special == true) { 173 var return_price=function(results) { 174 eval(results); 175 if(product_id != null) { 176 target_id = "special_product_price_"+product_id; 177 buynow_id = "BB_BuyButtonForm"+product_id; 178 document.getElementById(target_id).firstChild.innerHTML = price; 179 if (price.substring(27,price.indexOf("&"))!='') 180 document.getElementById(buynow_id).item_price_1.value = price.substring(27,price.indexOf("&")); 181 } 182 } 183 } else { 184 var return_price=function(results) { 185 //alert(results); 186 eval(results); 187 if(product_id != null) { 188 target_id = "product_price_"+product_id; 189 buynow_id = "BB_BuyButtonForm"+product_id; 190 //document.getElementById(target_id).firstChild.innerHTML = price; 191 if(jQuery("input#"+target_id).attr('type') == 'text') { 192 jQuery("input#"+target_id).val(numeric_price); 193 } else { 194 jQuery("#"+target_id+" span.pricedisplay").html(price); 195 } 196 } 197 } 198 } 199 ajax.post("index.php",return_price,"ajax=true&get_updated_price=true&product_id="+product_id+value_ids); 200} 201function show_details_box(id,image_id) { 202 state = document.getElementById(id).style.display; 203 if(state != 'block') { 204 document.getElementById(id).style.display = 'block'; 205 document.getElementById(image_id).src = WPSC_CORE_IMAGES_URL + "/icon_window_collapse.gif"; 206 } else { 207 document.getElementById(id).style.display = 'none'; 208 document.getElementById(image_id).src = WPSC_CORE_IMAGES_URL + "/icon_window_expand.gif"; 209 } 210 return false; 211} 212 213var register_results=function(results) { 214 jQuery("div#TB_ajaxContent").html(results); 215 jQuery('div#checkout_login_box').css("border", '1px solid #339933'); 216 jQuery('div#checkout_login_box').css("background-color", '#e8fcea'); 217} 218 219function submit_register_form(frm) 220{ 221 jQuery('img#register_loading_img').css("display", 'inline'); 222 ajax.post("index.php?ajax=true&action=register",register_results,ajax.serialize(frm)); 223 224 return false; 225} 226 227var fadeInSuggestion = function(suggestionBox, suggestionIframe) { 228 jQuery(suggestionBox).fadeTo(300,1); 229}; 230 231var fadeOutSuggestion = function(suggestionBox, suggestionIframe) { 232 jQuery(suggestionBox).fadeTo(300,0); 233}; 234 235function change_pics(command){ 236 location1 = window.location.href; 237 238 if (command == 1){ 239 document.getElementById('out_view_type').innerHTML = "<input type='hidden' id='view_type' name='view_type' value='default'>"; 240 document.getElementById('out_default_pic').innerHTML ="<img id='default_pic' src='" + WPSC_CORE_IMAGES_URL + "/default-on.gif'>"; 241 document.getElementById('out_grid_pic').innerHTML ="<img id='grid_pic' style='cursor:pointer;' onclick='change_pics(0)' src='" + WPSC_CORE_IMAGES_URL + "/grid-off.gif'>"; 242 if (location1.search(/view_type/)!=-1) { 243 $new_location = location1.replace("grid","default"); 244 } else { 245 if (location1.search(/\?/)!=-1) { 246 $new_location = location1+"&view_type=default"; 247 } else { 248 $new_location = location1+"?view_type=default"; 249 } 250 } 251 window.location = $new_location; 252 } else { 253 document.getElementById('out_view_type').innerHTML = "<input type='hidden' id='view_type' name='view_type' value='grid'>"; 254 document.getElementById('out_default_pic').innerHTML ="<img id='default_pic' style='cursor:pointer;' onclick='change_pics(1)' src='" + WPSC_CORE_IMAGES_URL + "/default-off.gif'>"; 255 document.getElementById('out_grid_pic').innerHTML ="<img id='grid_pic' src='" + WPSC_CORE_IMAGES_URL + "/grid-on.gif'>"; 256 if (location1.search(/view_type/)!=-1) { 257 $new_location = location1.replace("default","grid"); 258 } else { 259 if (location1.search(/\?/)!=-1) { 260 $new_location = location1+"&view_type=grid"; 261 } else { 262 $new_location = location1+"?view_type=grid"; 263 } 264 } 265 266 window.location = $new_location; 267 } 268} 269 270function log_buynow(form){ 271 id = form.product_id.value; 272 price = form.item_price_1.value; 273 ajax.post("index.php",noresults,"ajax=true&buynow=true&product_id="+id+"price="+price); 274} 275 276function gotoexternallink(link, target){ 277 if (target == '') { 278 target = '_self'; 279 } 280 window.open(link, target); 281 return false;
282} 283 284function manage_extras(product_id, extras_id, special) { 285 value_ids = ''; 286 special_prefix = ""; 287 extra_idss=''; 288 document.getElementById('extras_indicator'+product_id+extras_id).style.display='block'; 289 if(special == true) { 290 form_id = "specials_"+product_id; 291 } else { 292 form_id = "product_"+product_id; 293 } 294 295 jQuery(document).ready(function(){ 296 extra_ids=jQuery("input.extras_"+product_id+":checked"); 297 }); 298 299 jQuery.each(extra_ids, function(key, value) { 300 extra_idss += "&extra[]="+extra_ids[key].value; 301 }); 302 pm='stay'; 303 304 if(special == true) { 305 var return_price=function(results) { 306 //alert(results); 307 eval(results); 308 if(product_id != null) { 309 target_id = "special_product_price_"+product_id; 310 buynow_id = "BB_BuyButtonForm"+product_id; 311 document.getElementById(target_id).firstChild.innerHTML = price; 312 if (price.substring(27,price.indexOf("&"))!='') 313 document.getElementById(buynow_id).item_price_1.value = price.substring(27,price.indexOf("&")); 314 } 315 document.getElementById('extras_indicator'+product_id+extras_id).style.display='none'; 316 } 317 } else { 318 var return_price=function(results) { 319 eval(results); 320 if(product_id != null) { 321 target_id = "product_price_"+product_id; 322 buynow_id = "BB_BuyButtonForm"+product_id; 323 document.getElementById(target_id).firstChild.innerHTML = price; 324 if (price.substring(27,price.indexOf("&"))!='') 325 document.getElementById(form_id).item_price_1.value = price.substring(27,price.indexOf("&")); 326 } 327 document.getElementById('extras_indicator'+product_id+extras_id).style.display='none'; 328 } 329 } 330 ajax.post("index.php",return_price,"ajax=true&get_updated_price=true&pm="+pm+"&product_id="+product_id+extra_idss); 331} 332 333function store_list(){ 334 address = document.getElementById('user_address').value; 335 city = document.getElementById('user_city').value; 336 if ((address != '') && (city != '')) { 337 document.getElementById('gloc_loading').style.display='block'; 338 ajax.post("index.php",return_store_list,"ajax=true&store_list=true&addr="+address+"&city="+city); 339 } 340} 341 342var return_store_list=function(results) { 343 document.getElementById('gloc_storelist').innerHTML=results; 344 document.getElementById('gloc_loading').style.display='none'; 345 return true; 346} 347 348function statusTextKeyPress(event){ 349 if(!event){ 350 event=window.event; 351 } 352 if(event.keyCode){ 353 keyPressed=event.keyCode; 354 }else if(event.which){ 355 keyPressed=event.which; 356 } 357 if(keyPressed==9){ 358 return false; 359 } 360 if(keyPressed==13){ 361 newstatus = document.getElementById('status_change_text').value; 362 ajax.post("index.php",submit_user_status,"ajax=true&submitstatus=true&status="+newstatus); 363 return false; 364 } 365 if(keyPressed==27){ 366 document.getElementById('edit_status_select').style.display='none'; 367 return false; 368 } 369 return true; 370} 371 372var usps_method_switch = function (results){ 373 shipping = results.split('---'); 374 shipping1 = shipping[1]; 375 jQuery("#checkout_total").html(shipping[0]); 376 377 jQuery('.total > .pricedisplay').remove(); 378 jQuery('.total > .totalhead').after(shipping[0]); 379 jQuery('.postage > .pricedisplay').remove(); 380 jQuery('.postage > .postagehead').after(shipping1); 381} 382 383function add_meta_box(results){ 384 jQuery(".wpsc_buy_button").before(results); 385 jQuery('.time_requested').datepicker({ 386 dateFormat: 'yy-mm-dd' 387 }); 388} 389 390function submit_purchase(){ 391 document.forms.ideal_form.submit(); 392} 393 394function do_nothing() { 395 return; 396} 397 398jQuery(document).ready( 399 function() { 400 if (jQuery("#openair").val() == 1) { 401 var max_height = 0; 402 var min_offset = 9999; 403 var max_left_offset = 0; 404 var top_offset = 0; 405 jQuery("div.product_grid_item").each( 406 function() { 407 jQuery(this).css('margin','0'); 408 if (jQuery(this).height() > max_height) { 409 max_height = jQuery(this).height(); 410 } 411 var offset = jQuery(this).offset(); 412 if (offset.left <= min_offset) { 413 min_offset = offset.left; 414 } 415 if (offset.top > top_offset) { 416 top_offset = offset.top; 417 } 418 if (offset.left > max_left_offset) { 419 max_left_offset = offset.left; 420 } 421 } 422 ); 423 424 jQuery("div.product_grid_item:last").each( 425 function() { 426 var offset = jQuery(this).offset(); 427 428 if (offset.left != max_left_offset) { 429 jQuery(this).css('border-right','1px solid #ddd'); 430 } 431 } 432 ); 433 434 jQuery("div.product_grid_item").each( 435 function() { 436 437 438 439 var offset = jQuery(this).offset(); 440 if (offset.left == min_offset) { 441 setTimeout('do_nothing', 200); 442 jQuery(this).css('border-left','0px solid #ddd'); 443 } 444
445 if (offset.top == top_offset) { 446 jQuery(this).css('border-bottom','0px solid #ddd'); 447 } 448 jQuery(this).height(max_height+30); 449 } 450 ); 451 } 452 453 454 455 jQuery("div.custom_gateway table").each( 456 function() { 457 if(jQuery(this).css('display') == 'none') { 458 jQuery('input', this).attr( 'disabled', true); 459 } 460 } 461 ); 462 463 function selectCustomGateway() { 464 var parent_div = jQuery(this).parents("div.custom_gateway"); 465 466 jQuery('table input',parent_div).attr( 'disabled', false); 467 jQuery('table',parent_div).show(); 468 jQuery("div.custom_gateway table").not(jQuery('table',parent_div)).hide(); 469 jQuery("div.custom_gateway table input").not(jQuery('table input',parent_div)).attr( 'disabled', true); 470 } 471 472 jQuery("input.custom_gateway").change( 473 function() { 474 if(jQuery(this).is(':checked') == true) { 475 selectCustomGateway.call(this); 476 } 477 } 478 ); 479 480 selectCustomGateway.call(jQuery('input.custom_gateway:checked')); 481 } 482 );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.