﻿$(document).ready(function () {
	window.onload = bustFrame;
	$('#search input[type=text].text').simpleWaterMark('watermark');
	$('.xrm-weblink').removeAttr("title");
	// Remove tooltips from inputs and labels in a CrmEntityFormView
	$('td.cell').find('input, select, textarea, img, label').removeAttr("title");
	// Dynamically set the height of the iframe that loads the web resource content in a CrmEntityFormView
	$('td.web-resource-cell div.control iframe', top.document).css({ height: 0 });
	var height = $('td.web-resource-cell div.control iframe', top.document).contents().find('body').attr('scrollHeight');
	$('td.web-resource-cell div.control iframe', top.document).css({ height: height });

	// Navigation dropdown
	$("ul.subnav");
	$("ul.topnav li").click(function () {
		$(this).find("ul.subnav").slideDown('fast').show();
		$(this).hover(function () {
		}, function () {
			$(this).find("ul.subnav").slideUp('slow');
		});
	}).hover(function () {
		$(this).addClass("subhover");
	}, function () {
		$(this).removeClass("subhover");
	});

});

function bustFrame() {
	if (top != self) {
		top.location.replace(self.location.href);
	}
}

