function hideAll() {
$(".loc-desc").each(function() {
$(this).hide();
});
}
function stateHide() {
//state jump box
var testState = $("#select-state :selected").val();
$("#select-state").fadeIn("fast");
$(".loc").each(function() {
$(this).hasClass(testState) ? $(this).show() : $(this).hide("");
});
}
function buildMap() {
$(".loc-info a").click(function() {
//get map id
var grabMapID = $(this).parent().attr("id");
var mapIDSplit = grabMapID.split("-");
var mapID = mapIDSplit[1];
iframeHTML = '';
if(!$(this).hasClass(".mapAdded")) {
$(this).parent().next().prepend
(iframeHTML);
$(this).addClass(".mapAdded");
}
if($(this).parent().next().css("display")=="block") {
$(this).parent().next().hide("fast");
$(this).removeClass("clicked");
} else {
$(this).parent().next().show("fast");
$(this).addClass("clicked");
}
return false;
});
}
function MM_jumpMenu(targ,selObj,restore){
if(selObj.id == "select-type") {
selectType2();
} else if(selObj.id == "select-state") {
if(targ !== "loc") {
segment_prefix = "/find_a_bag/";
eval(targ+".location='"+ segment_prefix + selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
} else {
if(targ !== "loc") {
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
}
}
function checkLocation() {
stateDisplaying = "NSW";
regionDisplaying = "All";
stateDisplaying = $("#select-state :selected").val();
regionDisplaying = $("#select-region :selected").text();
$("#d-state").html(stateDisplaying);
$("#d-region").html(regionDisplaying);
}
function selectType() {
var testState = $("#select-state :selected").val();
var testType = $("#select-type :selected").val();
$(".loc").each(function(i) {
rawClass = $(this).attr("class");
splitRawClass = rawClass.split(" ");
splitFinalClass = splitRawClass[0].split("-");
getClassRight = splitFinalClass[1];
if(getClassRight.charAt(testType) == "1") {
$(this).show();
} else {
$(this).hide();
}
});
}
function selectType2() {
var testState = $("#select-state :selected").val();
var testType = $("#select-type :selected").text();
if(testType !== "All") {
counter = 0;
shownCounter = 0;
$("p.loc-type").each(function(i) {
counter++;
if(testType == $(this).text() && $(this).parent().parent().hasClass(testState)) {
$(this).parent().parent().show("fast");
shownCounter++;
} else {
$(this).parent().parent().hide("fast");
}
});
if(shownCounter == 0) {
noResultsHTML = "There are no results to display.";
$("#no-results").html(noResultsHTML);
}
} else {
$("p.loc-type").each(function(i) {
if( $(this).parent().parent().hasClass(testState)) {
$(this).parent().parent().show("fast");
}
});
}
}
var winid = null;
function puViewer(url, width, height) {
if (winid != null) {
winid.close();
winid = null;
}
if (width === undefined) {
width = 720;
}
if (height === undefined) {
height = 580;
}
winid = window.open(url, 'puViewer', 'resizable=1,scrollbars=1,status=1,toolbar=0,menubar=0,width='+width+',height='+height)
winid.focus();
}
// Copied from the script found on Particle Tree http://www.particletree.com
function getBrowserWidth() {
if (window.innerWidth) {
return window.innerWidth;
} else if (document.documentElement && document.documentElement.clientWidth != 0) {
return document.documentElement.clientWidth;
} else if (document.body) {
return document.body.clientWidth;
}
return 0;
}
//addEvent() by John Resig
function addEvent( obj, type, fn ) {
if (obj.addEventListener){
obj.addEventListener( type, fn, false );
} else if (obj.attachEvent) {
obj["e"+type+fn] = fn;
obj[type+fn] = function(){obj["e"+type+fn](window.event);}
obj.attachEvent("on"+type, obj[type+fn]);
}
}
// Modified from the script found on A List Apart @ http://www.alistapart.com
function determineLayout() {
var obj, title, i;
var browserWidth = getBrowserWidth();
if (browserWidth > 1020) {
title = "wide";
} else {
title = "normal";
}
for (i=0; (obj = document.getElementsByTagName("link")[i]); i++) {
if (obj.getAttribute("rel").indexOf("style") != -1 && obj.getAttribute("title")) {
obj.disabled = true;
if (obj.getAttribute("title") == title) obj.disabled = false;
}
}
}
function externalLinks() {
if (!document.getElementsByTagName) {
return false;
}
var anchors = document.getElementsByTagName("a");
for (var i=0; i