// **** PMG CONFIGURATION **** //
// **** PMG CONFIGURATION **** //
// **** PMG CONFIGURATION **** //

var gProps = {};
gProps.app = {};
gProps.app.folder = null;
gProps.app.title = "Solutions for Wellness";

var gDebug = {};
gDebug.tools = (location.host == "localhost" || (location.host.indexOf("sklink") != -1))? true : false; // turn on the debug tools? //
//gDebug.tools = false;
gDebug.code = "68696685717978"; // debugon //
gDebug.keyboard = false; // turn on number keys //
//gDebug.title = "HCP";
gDebug.colors = {};
gDebug.colors.bgcolor = "#FBAF16";
gDebug.colors.background = false;
gDebug.colors.elements = {div:"red",p:"aqua",span:"lime",h1:"orange",h2:"pink",table:"black"};

var gCookie = {};
gCookie.props = {};
gCookie.props.cookie = "ME";
gCookie.props.path = "/";
gCookie.props.domain = false;
gCookie.props.secure = false;
gCookie.props.constant = true;
gCookie.props.days = 365;

// init globals //
gProps.qs = {}
// Check the Query String //
if(location.search){
	var qs = location.search.split("?")[1].split("&");
	if(qs.length){
		for(var x in qs){
			var i = qs[x].split("=");
			// Force all properties to uppercase //
			gProps.qs[i[0].toUpperCase()] = i[1];	
		}
	}
}

gProps.page = unescape(location.href).split('?')[0].split("/").pop();
gProps.cookie = {};
var lCookie = cookie_read(gCookie.props);
if(lCookie){
	var lCookie = lCookie.split("~");
	for(var x = 0; x<lCookie.length; x++){
		var v = lCookie[x].split("=");
		if(v.length == 2){
			gProps.cookie[v[0]] = v[1];
		}
	}
}

gProps.cookie_net = {};
var lCookie = unescape(document.cookie);
if(lCookie.indexOf(";") != -1){
	var lCookie = lCookie.split(";");
	if(lCookie.length){
		for(var x = 0; x<lCookie.length; x++){
			var v = lCookie[x].split("=");
			if(v.length == 2){
				v[0] = v[0].replace(/^\s*/, ""); // strip whitespace from front //
				gProps.cookie_net[v[0]] = v[1];
			}else{
				//alert(lCookie[x])
			}
		}
	}
	// set a boolean for child //
	var lChild = false;
	if(gProps.cookie_net.FLASH){
		lChild = (gProps.cookie_net.FLASH.indexOf("8") != -1) || (gProps.cookie_net.FLASH.indexOf("9") != -1);
	}else{
		gProps.cookie_net.FLASH = "1,2,3,4,5,6,7";
	}
	
	gProps.cookie_net.p_child = lChild;
	
}

gProps.language = "en";
gProps.section = null; // initialize to null //

var gPaths = {};
gPaths.base = (gProps.app.folder)? unescape(location.href).split(gProps.app.folder)[0] : "/";
gPaths.common = gPaths.base + "common/";
gPaths.debug = gPaths.base + "debug/";
gPaths.app = gPaths.base + ((gProps.app.folder)? gProps.app.folder + "/" : "")
gPaths.css = gPaths.app + 'css/';
gPaths.js = gPaths.app + 'js/';
gPaths.html = gPaths.app + 'html/';
gPaths.media = gPaths.app + 'media/';
gPaths.audio = gPaths.media + 'audio/';
gPaths.images = gPaths.media + 'images/';
gPaths.xml = gPaths.media + 'xml/';
gPaths.flash = gPaths.media + 'flash/';
//gPaths.video = gPaths.media + 'video/';
gPaths.video = "http://pmg.vo.llnwd.net/o37/lilly/sfw/en/media/video/";
gPaths.pdf = gPaths.media + 'pdf/';
if(gProps.app.title){
	document.title = gProps.app.title;
}

var gBrowser = {};
gBrowser.supported = false;
gBrowser.support_png = true;
gBrowser.browsers = ["Opera","Netscape","Chrome","Safari","Flock","Firefox"];

// FLASH REQUIREMENTS //
gProps.flash = swfobject;
gProps.flash.version = gProps.flash.getFlashPlayerVersion();
gProps.flash.use_flash = true;
gProps.flash.available = (gProps.flash.version.major >= 8);

// Init the panels //
var gPanels = {};
gPanels.signup_hcc = {};
gPanels.signup_hcc.panel = 'signup_hcc';
gPanels.signup_hcc.immobilize = true;
gPanels.signup_hcc.dragable = false;
gPanels.signup_hcc.width = 500;
//gPanels.signup_hcc.top = 100;
gPanels.signup_hcc.clearForms = true;
gPanels.signup_hcc.script = function(){
	if(gPanel.signup_hcc.error_age){
		gPanel.signup_hcc.error_age.style.display = "none";
		gPanel.signup_hcc.error_number.style.display = "none";
	}
}

/* SIGN UP HCP */
gPanels.signup_hcp = {};
gPanels.signup_hcp.panel = 'signup_hcp';
gPanels.signup_hcp.immobilize = true;
gPanels.signup_hcp.dragable = false;
gPanels.signup_hcp.width = 500;
gPanels.signup_hcp.clearForms = true;
gPanels.signup_hcp.script = function(){
	document.getElementById('errorText').style.display = 'none';
	document.getElementById('not_us').style.display = 'none';
}

gPanels.calorie_level = {};
gPanels.calorie_level.panel = 'calorie_level';
gPanels.calorie_level.immobilize = true;
gPanels.calorie_level.dragable = false;
gPanels.calorie_level.width = 600;
gPanels.calorie_level.clearForms = true;

/* PRACTICE ADDRESS */
gPanels.practice_address = {};
gPanels.practice_address.panel = 'practice_address';
gPanels.practice_address.immobilize = true;
gPanels.practice_address.dragable = false;
gPanels.practice_address.width = 500;
gPanels.practice_address.clearForms = true;
gPanels.practice_address.script = function(){
	var lP = document.getElementById("add_adress_error");
	if(lP){
		lP.style.display = "none";
	}
}

gPanels.confirm_leaving = {};
gPanels.confirm_leaving.panel = 'confirm_leaving';
gPanels.confirm_leaving.immobilize = true;
gPanels.confirm_leaving.dragable = false;
gPanels.confirm_leaving.width = 550;

var gLightBox = {};
gLightBox.props = {};

/* HCP PROFILE ADDRESSES */
gHCPAddress = {};
gHCPAddress.id = 0;
//gHCPAddress.field_names = new Array();
//gHCPAddress.span_names = new Array();
//gHCPAddress.func = '';
    
/* ENLARGE IMAGES */
gPanels.enrollment_materials = {};
gPanels.enrollment_materials.panel = 'enrollment_materials';
gPanels.enrollment_materials.immobilize = true;
gPanels.enrollment_materials.dragable = false;
gPanels.enrollment_materials.width = 550;

gPanels.enrollment_brochure = {};
gPanels.enrollment_brochure.panel = 'enrollment_brochure';
gPanels.enrollment_brochure.immobilize = true;
gPanels.enrollment_brochure.dragable = false;
gPanels.enrollment_brochure.width = 550;

gPanels.enrollment_pads = {};
gPanels.enrollment_pads.panel = 'enrollment_pads';
gPanels.enrollment_pads.immobilize = true;
gPanels.enrollment_pads.dragable = false;
gPanels.enrollment_pads.width = 550;

/* INIT CSS PRINT BUTTON */
gPrint = {};
gPrint.enabled = true;
gPrint.divs = [];

/* ACTIVITY LIGHTBOXES */
gPanels.flexibility_ap = {};
gPanels.flexibility_ap.panel = 'flexibility_ap';
gPanels.flexibility_ap.immobilize = true;
gPanels.flexibility_ap.dragable = false;
gPanels.flexibility_ap.width = 925;

gPanels.strength_ap = {};
gPanels.strength_ap.panel = 'strength_ap';
gPanels.strength_ap.immobilize = true;
gPanels.strength_ap.dragable = false;
gPanels.strength_ap.width = 925;

gPanels.aerobic_ap = {};
gPanels.aerobic_ap.panel = 'aerobic_ap';
gPanels.aerobic_ap.immobilize = true;
gPanels.aerobic_ap.dragable = false;
gPanels.aerobic_ap.width = 925;

