/**
 * 	This is the basic page object needed for the loading bar, the screensaver 
 * 	and other functionality
 * 
 * 	@author Mario Heiderich <mario.heiderich@doccheck.com>
 */
var objPageBasicFunctions = {
	
	showLoadingBar : function() {
	   	var strY = (window.pageYOffset) ? (window.pageYOffset+300) : (document.documentElement.scrollTop+300);
	 	jQuery('#divDCLoadingBar').css('top', strY+'px');
	 	jQuery('#divDCLoadingBar').css('display', 'block');
	},
	
	hideLoadingBar : function() {
		jQuery('#divDCLoadingBar').fadeOut(1000);
	},

	switchTabImage : function(strAffectedImagesClass, strCurrentImageId, strCurrentImageSrc) {
		// set all tab images to inactive and activate the current one
		jQuery(strAffectedImagesClass).attr("src", function() {return this.src.replace('_active', '');} );
		jQuery(strAffectedImagesClass).removeClass("dcActiveTab");
		jQuery(strCurrentImageId).attr("src", strCurrentImageSrc);
		jQuery(strCurrentImageId).addClass("dcActiveTab");
	},
	
	highlightTabImage : function(strCurrentImageId, strCurrentImageSrc) {
		jQuery(strCurrentImageId).attr("src", strCurrentImageSrc);
	},
	
	getCursorPosition : function(objEvent) {
		if (objEvent == undefined){
			objEvent = window.event;
		}
		if (document.getElementById) {
			intCursorX = (objEvent.clientX-5+((window.pageXOffset) ? window.pageXOffset : document.documentElement.scrollLeft));
			intCursorY = (objEvent.clientY-5+((window.pageYOffset) ? window.pageYOffset : document.documentElement.scrollTop));
		} else if (document.all) {
			intCursorX = objEvent.clientX-5+((window.pageYOffset) ? window.pageYOffset : document.documentElement.scrollLeft);
			intCursorY = objEvent.clientY-5+((window.pageYOffset) ? window.pageYOffset : document.documentElement.scrollTop);
		}
	}	
}

jQuery(document).ready( function() {
	// use jQuery together with other libraries
	//jQuery.noConflict();
	jQuery('.divDCNaviLevelOneInactiveContainer').hover(function() {
		jQuery(this).css('backgroundImage', 'url(/skins/doccheckstandard/_img/_sidebar/_navi/dcnavi_level1_bg_active.gif)');
	} , function() {
		jQuery(this).css('backgroundImage', 'url(/skins/doccheckstandard/_img/_sidebar/_navi/dcnavi_level1_bg_inactive.gif)');
	});
	
	document.onmouseover = objPageBasicFunctions.getCursorPosition;
});