﻿/// <reference path="D:\_Projects\Clients\FTC\VU.NETsolution\VU.NETweb\CR\JS\JSintellisenseReferences.js" />
String.prototype.trim = function () {
	return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function $(id) {
	return document.getElementById(id);
}

var locationTab;
var sidebarFlag = false;

function Onload() {
	switch (document.location.pathname.split('/')[1]) {
		case "Home":
		case "":
			HomeInit();
			break;
		case "Location":
			LocationInit();
			break;
		case "Search":
			SearchResultInit();
			break;
		case "Action":
			if (document.location.pathname.split('/')[5] == 'Location') {
				LocationInit();
			}

			break;
		default:
			break;
	}
}

function ScrollIntoView(_obj) {
	if (_obj != null) {
		_obj.scrollIntoView();
	} else {
		// Default, scroll view to the beginning of page
		document.body.scrollIntoView();
	}
}

function OpenInNewTab(_path) {
	// generate a new form element
	var _form = document.createElement('FORM');
	_form.method = 'GET';
	_form.action = _path;
	_form.target = '_blank';

	// append newly created form element 
	document.body.appendChild(_form);

	// submit form, thus open in a new tab (target = _blank)
	_form.submit();

	// clear any trace of generated form
	document.body.removeChild(_form);
	_form = null;
	delete _form;
}

// Some Layout fixed e.d.

function tabs($) {
    $('.mainTabs').find('.active').prev('.separator').hide();
}
