if (window.addEvent) {
	window.addEvent('domready', function(){
		if (typeof sIFR == "function") {
			sIFR.replaceElement("#subhead h2", named({
				sFlashSrc: "images/KlavikaBold.swf",
				sColor: "#ffffff",
				sWmode: "transparent"
			}));
			sIFR.replaceElement(".pp_price", named({
				sFlashSrc: "images/KlavikaBold.swf",
				sColor: "#3d4242",
				sWmode: "transparent",
				sFlashVars: "textalign=center"
			}));
		};
			});
}

function hide(theid) {
    if( $(theid) != null ) {
	    $(theid).style.display = 'none';
	}
};
function show(theid) {
    if( $(theid) != null ) {
	    $(theid).style.display = 'block';
	}
};

function trackEvent(sVar1, sVar2, sVar3, sVar4) {
	try {
		if (typeof(pageTracker) != 'undefined') {
			pageTracker._trackEvent(sVar1, sVar2, sVar3, sVar4);
		}
	} catch (ex) {}
}

function trackAndGo(sURL, sVar1, sVar2, sVar3, sVar4) {

	trackEvent(sVar1, sVar2, sVar3, sVar4);
	
	if (sURL != null && typeof(sURL) != 'undefined') {
		window.location.href = sURL;
	}
}

//onclick="trackAndGo('/home', '1', '2', '3', '4');"
// ie dosn't have this
String.prototype.trim = function () {
    if (this.length <= 0) {
        return this;
    }
    return this.replace(/^\s*|\s*$/g, '');
};

var ca = {};

ca.isArrayEmpty = function(a) {
	if (typeof a == 'array')
		return a.length==0;
		
	for (var i in a) {
		return false;
	}	
	return true;
}
ca.arrayLength = function(a) {
	if (a.length)
		return a.length;
	var len = 0;
	for (var i in a) {
		len++;
	}	
	return len;
}

