var spa = { 
/* debugger; */

init:function() {

$(document.body).addClass("jsOn").addClass("shop");

/* temporary while the price is not known; */
if ($('#pageName h1').text() == "What's Hot") {
$('#contentRight .oneProduct a[name="955"]').parent().hide();
}


if ( $.browser.msie && $.browser.version < 7) {
	$('body').addClass('ie6');
	}
if ( $.browser.msie && $.browser.version >= 7) {
	$('body').addClass('ie');
	}

var $link = $('#servSubMenu a.pagelink');
var pageTitle = $('#pageName h1').html();
$link.each( function() {
 	var $a = $(this);
 	var t = $a.html();
 	var subCount = spa.countSubs(t,':');
 	if (subCount>0) {
		var subPlace = t.lastIndexOf(':')+2;
		$a.addClass('sub'+subCount).html(t.substr(subPlace));
	}
	//console.log(pageTitle.toLowerCase); console.log(t.toLowerCase);
	if (pageTitle.toLowerCase()==t.toLowerCase()) {
		$a.addClass('current').click( function() { return false; });
	}
});

var $title = $('#contentRight p.prodTitle, #contentRight p.SubproductName');

$title.each( function() {
 	$(this).html($(this).html().substr(5));
});


	
},
countSubs: function (mainStr, srchStr) {
    var count = 0;
    var offset = 0;
    do {
        offset = mainStr.indexOf(srchStr, offset);
        count += (offset != -1) ? 1 : 0;
    } while (offset++ != -1)
    return count
},
showFAQ: function(_this,p) {
// if answ exist, delete the old, exit if clicked the existing
if ($('body').attr('id') == 'faq') scroll(0,0);
if ($('#cur').length == 1) {
	var f = false; if (p.is('.cur')) { f = true; }
	$('#faqQ p').removeClass('cur'); $('#cur').remove();
	if (f) {  return; }
	}
// show the answ:
var id = _this.substring(1);
var t = $(document.getElementById(id)); // find corresp div(answ)
$(t).find('h2').remove(); // remove h2 from it
divT = document.createElement( 'div' );// create container for showing answ
$(divT).attr('id','cur').html(t.html()).insertAfter(p).show('slow');//add id and text to it, then insert it after
p.addClass('cur');
}
}
$(document).ready(spa.init);