/*
 * **** highslide vars
 */
hs.graphicsDir = "fileadmin/media/graphics/";
hs.align = "center";
hs.transitions = ["expand", "crossfade"];
hs.outlineType = "rounded-white";
hs.fadeInOut = true;
hs.dimmingOpacity = 0.55;
hs.blockRightClick = true;
hs.outlineWhileAnimating = true;
hs.showCredits = false;


/*
 * function jsfnGetValue
 *   get the form value either from select or from hidden / text field
 *
 */
function jsfnGetValue( fn_sField ) {
	if( xajax.$(fn_sField) ) {
		if( xajax.$(fn_sField).options ) {
			return xajax.$(fn_sField).options[xajax.$(fn_sField).selectedIndex].value;
		} else {
			return xajax.$(fn_sField).value;
		}
	} else {
		return '';
	}
}

/*
 * function jsfnSetValue
 *   set the form value
 *
 */
function jsfnSetValue( fn_sField, fn_sValue ) {
	if( xajax.$(fn_sField) ) {
		xajax.$(fn_sField).value = fn_sValue;
	}
}

/**
 * Get the searchword and call the corresponding ajax function
 *
 * @param	string       sSearchword: the search word
 *
 * @return	void
 */
function jsfnGetResults( sSearchword, sMode ) {
	if( sSearchword.length > 2 ) {
		showAjaxLoader( 'photocommerce-event-result' );
		pc_xajaxGetEventResult( sSearchword, sMode );
	}
	if( sSearchword == '' ) {
		showAjaxLoader( 'photocommerce-event-result' );
		pc_xajaxGetEventResult( '', sMode );
	}
}

/**
 * Get the searchword and call the corresponding ajax function
 *
 * @param	string       fn_sID: the div in which the loader should be displayed
 *
 * @return	void
 */
function showAjaxLoader( fn_sID ) {
	xajax.$( fn_sID ).innerHTML = '<div class="ajaxloader"><img src="'+fn_sLoadingImage+'" border="0" align="center" alt="'+fn_sLoadingAltText+'" title="'+fn_sLoadingTitleText+'" /></div>';
}


function videoPreview(url) {
	videoPW = window.open(url, "Video", "width=480,height=385,resizable=no");
	videoPW.focus();
	return false;
}

