﻿// clear default field values on focus
function clearDefaultFieldValue(obj, defVal){
	if (obj.value == defVal)
		obj.value = "";
}


// set default field value on blur (if nothing entered)
function setDefaultFieldValue(obj, defVal){
	if (obj.value == "")
		obj.value = defVal;
}


// resize transparent shadows left and right of content (height)
$(function(){
	if ($.browser.msie && (jQuery.browser.version).substring(0,1)=="6"){
		$('.dvShaddow_left, .dvShaddow_right').css({display : 'none'});
		return;
	}
	var pageHeight = $('.dvPage').height();
	$('.dvShaddow_left, .dvShaddow_right').height( $('.dvPage').height()  );
});


function blindUpDown() {
	$('.dvNaviDropup .open').toggle();
}


// Search-Page; make label bold / not bold if radiobox is checked
// id_label = "lb_" + id_field
// not used any more ?
function chkRBstatus(){};


function toggleGenericButton(sender)
{
    var imagePath = sender.src;
    var fs = $('fieldset.fsSearchInResults');
    if (fs.css('display') == 'block'){
		$(fs).hide();
		sender.src = imagePath.replace("btnFieldsetHide","btnFieldsetShow");
	} else {
		fs.show();
		sender.src = imagePath.replace("btnFieldsetShow","btnFieldsetHide");
	}    
}

function btnToggleSearchinresults(obj) {
     toggleGenericButton(obj);
}


function writePrintLink(text){
	if (text) {
		document.write("<a href=\"#\" onclick=\"printIt();return false;\"><span>&gt;</span>&nbsp;" + text + "</a>");
	}
}


function printIt(){
	if (window.print) {
		window.print();
	} else {
		var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=\"0\" HEIGHT=\"0\" CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"><\/OBJECT>";
		document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
		WebBrowser1.ExecWB(6, 2);	//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
	}
}

