/* harrian law firm */

// vars
var $j = jQuery;
var IsInDev = 0;

$(document).ready(function () {
	// log console info
	if (IsInDev == 1) {
		console.log("Startup :: IsInDev");
	}
	else {
		console.log("Startup :: !IsNOTInDev");
	}
});

// for loading
function movieLoaded() {

	console.log("Movie is loaded..");
	// hide the loading div
	$j("#loaderContainer").hide();
	$j("body").css("background-color", "#999999");
	// unhide the movie...
	$j("#flashContainer").show();
}

// for print preview
function openWin(screenToPrint) {

	console.log("openWin: " + screenToPrint);
	var winprop = "width=800, height=850, resizable=no, toolbar=no";
	var printContent = getPrintContent(screenToPrint);
	console.log("printContent: " + printContent);
	// open the window with the correct file to print
	openwin = window.open(printContent,'',winprop);

	return printContent;
}

// get the right file to print
function getPrintContent(screenToGet) {
	
	var printFileName = '';
	
	// parse the screen code eg.. main-sub
	var arrayScreen = screenToGet.split('-');

	// if array item = 0 then we are printing a main screen
	if (arrayScreen[1] == "0") {
		switch (arrayScreen[0]) {
			// home
			case "1":
				printFileName = 'home_print.html';
				break;			
			// family law
			case "10":
				printFileName = 'family_home.html';
				break;			
			// estate planning
			case "11":
				printFileName = 'estate_plan_home.html';
				break;			
			// personal injury
			case "12":
				printFileName = 'personal_injury_home.html';
				break;			
			// business formation
			case "13":
				printFileName = 'business_formation_print.html';
				break;			
			// civil litigation
			case "14":
				printFileName = 'civil_litigation_print.html';
				break;			
			// harrian
			case "20":
				printFileName = 'lawyer_harrian.html';
				break;			
			// harms
			case "21":
				printFileName = 'lawyer_harms.html';
				break;			
			// cordrey
			case "22":
				printFileName = 'lawyer_cordrey.html';
				break;			
			default:
				printFileName = 'page_not_found.html';
				break;
		}
	}
	else {
		switch (arrayScreen[1]) {
			// estate - power attorney
			case "E1":
				printFileName = 'estate_plan_power.html';
				break;
			// estate - directives
			case "E2":
				printFileName = 'estate_plan_directive.html';
				break;
			// estate - wills
			case "E3":
				printFileName = 'estate_plan_wills.html';
				break;
			// injury - auto
			case "P1":
				printFileName = 'personal_injury_accidents.html';
				break;
			// injury - slip
			case "P2":
				printFileName = 'personal_injury_slip.html';
				break;
			// injury - wrongful
			case "P3":
				printFileName = 'personal_injury_death.html';
				break;
			// family - divorce
			case "F1":
				printFileName = 'family_divorce.html';
				break;
			// family - grandparents
			case "F2":
				printFileName = 'family_grandparents.html';
				break;
			// family - prenuptial
			case "F3":
				printFileName = 'family_prenuptial.html';
				break;
			// family - paternity
			case "F4":
				printFileName = 'family_paternity.html';
				break;
			// family - modifications
			case "F5":
				printFileName = 'family_modifications.html';
				break;
			// family - custody
			case "F6":
				printFileName = 'family_custody.html';
				break;
			// family - maintenance
			case "F7":
				printFileName = 'family_alimony.html';
				break;
			// family - property
			case "F8":
				printFileName = 'family_property.html';
				break;
			// family - violence
			case "F9":
				printFileName = 'family_violence.html';
				break;
			// family - support
			case "F10":
				printFileName = 'family_support.html';
				break;
			default:
				printFileName = 'page_not_found.html';
				break;
		}
	}
	// return the file we want to print
	return "printable/" + printFileName;
}



