$(function(){

//read the URL
    var location = parent.document.URL;
    var isWorkstation = location.indexOf("vworkstation");
    var isLocalhost = location.indexOf("localhost");
    var isStaging = location.indexOf("stag");
    var isProductionSite = location.indexOf("store.precept.org");  
	var getInfoFile = "";
	
	//Determine if we are in the admin area or not
	if ( location.indexOf("adminprecept") > -1 )
	{
		//need to set proper path to root file since we are in admin
		getInfoFile = "../getInformation_2384JDufu.aspx";
	}
	else
	{
		getInfoFile = "getInformation_2384JDufu.aspx";
	}
	
	//this "get" calls our getInfo File
	//The GetInfoFile - reads the DB Connection string
	$.get(getInfoFile, function(data){
	
		if((isWorkstation > -1) || (isLocalhost > -1)){
			set_div("Local Host Version");
		} else if(isStaging > -1){
			set_div("STAGING Version | DB: " + data.substring(0, 14)); //we parse out most of the db conn info...
		} else{
			//set_notice("Welcome to the new <span style=\"color:red\">BETA</span> Precept Ministries store! Several new features will be rolled out over the next few weeks. Click <a href=\"http://www.fromhisheart.org/About-Contact-us.aspx?a=Website%Feedback\">here</a> to report a problem or provide feedback.");
		}
		
	 });	

    
});

function set_div(text){
    $('.location_status').html('<div class="alert" style="text-align:center;margin-top:0px;background:#F5C5C5;padding:10px;border:solid 1px; red;color:red;border-right:none;border-left:none;">' + text + '</div>');
}

function set_notice(text){
    $('.location_status').html('<div style="text-align:center;background:#EEEBDA;padding:10px;color:#7F7B67;border-bottom:#CFC79B solid 2px;">' + text + '</div>');
}
