﻿// Footer JScript File

String.prototype.count=function(s1) { 
	return (this.length - this.replace(new RegExp(s1,"g"), '').length) / s1.length;
}


function getFooter(){
    var url = '';

	var xyz = window.location.href;
	xyz = window.location.href.split("?")[0];
	xyz = xyz.replace('http://', '');
	//xyz = "";
	for (var c = 0 ; c < xyz.count('/') - 1 ; c++){
		url += '../';
	}
    	url +="Customer/Footer.aspx";//?rnd="+Math.random();
	showProgressSearch();
	invokeServer(url, "WriteFooter")
}
function WriteFooter(){
    hideProgressSearch();
    var output=unescape(arguments[0]);
    try{
        var divFooter=document.getElementById("divFooter")
        if (divFooter!=null){
            divFooter.innerHTML=output;
        }
    }
    catch(err){
        alert(err);
    }
}

function replaceAll(Str, str1, str2){
	if (Str.indexOf(str1) > 0){
		Str = Str.replace(str, str2);
		replaceAll(Str, str1, str2);
	}
	return Str;
}