/*function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}*/

function AllRolloverImages(){
var allRollovers = $('.rollover');
var PreloadImages = new Array();
		for (var i = 0; i < allRollovers.length; i++) {
			var rollover = allRollovers[i];
			if (rollover.className && (' ' + rollover.className + ' ').indexOf(' rollover ') != -1) {
				if (rollover.src !== 'undefined'){
					PreloadImages[i] = new Image();
					PreloadImages[i].src = rollover.src;
					rollover.onmouseover = function(){
						this.src = this.src.replace(/OVER(\.[^.]+)$/, '$1');
						 // reaply the img
						this.src = this.src.replace(/(\.[^.]+)$/, 'OVER$1');
						};//rollover.onmouseover
					rollover.onmouseout = function(){
						this.src = this.src.replace(/OVER(\.[^.]+)$/, '$1');
					};//rollover.onmouseout
				 };//if (rollover.src !== 'undefined')
			};//if (rollover.className && (' ' + rollover.className + ' ').indexOf(' rollover ') != -1)
		};	//for (var i = 0; i < allRollovers.length; i++) {
			
	};//End Function
	
function secureRedirect(){
	if (document.location.protocol != "https:")
	{
		var current_page = String(window.location.pathname);
		var current_querystring = String(window.location.search.substring(1));
		var secure_url = "https://satremix.com" + current_page;
		if( current_querystring.length > 0 )
			secure_url += "?" + current_querystring;
		document.location.href = secure_url;
	}
}
	
jQuery(document).ready(function (){
	//secureRedirect();
	AllRolloverImages();
});
