

var True = true;
var False = false;
var spacerImageUrl = "/images/spacer.gif";

var modalPopup = null;
var nonModalPopup = null;

// browserIsIE
function browserIsIE() {
	return (navigator.userAgent.indexOf("MSIE") != -1);
}

// validateAndPostBack
function validateAndPostBack(controlName, postBackArgument) {
	var okToSubmit = true;
	if (typeof(VAM_ValOnClick) == 'function') {
		VAM_ValOnClick('', '');
		okToSubmit = VAM_ValOnSubWGrp('*');
	}
	else {
		if (typeof(Page_ClientValidate) == 'function') {
			Page_ClientValidate();
			okToSubmit = okToSubmit && Page_IsValid;
		}
	}
	if (okToSubmit) {
		__doPostBack(controlName, postBackArgument);
		return true;
	}
	else {
		return false;
	}
}

// validatePage
function validatePage() {
	var pageValid = true;
	if (typeof(Page_ClientValidate) == 'function') {
		Page_ClientValidate();
		pageValid = Page_IsValid;
	}
	if (typeof(VAM_ValOnClick) == 'function') {
		VAM_ValOnClick('', '');
		pageValid = VAM_ValOnSubWGrp('*') && pageValid;
	}
	return pageValid;
}

// openPopup
function openPopup(popupUrl, popupName, popupWidth, popupHeight, modal, useScrollBar) {
	// temp fix for popup help link
	popupHeight = popupHeight + 20;
	
	var left = Math.floor((screen.width - popupWidth) / 2);
	var top = Math.floor((screen.height - popupHeight) / 2) - 50;
	var features = "width=" + popupWidth + ",height=" + popupHeight + ",left=" + left + ",top=" + top + ",resizable=yes,status=no,toolbar=no,menubar=no,location=no";
	if (useScrollBar == true) {
		features = features + ",scrollbars=yes";
	}
	if (modal == true) {
		modalPopup = window.open(popupUrl, popupName, features);
		modalPopup.focus();
		return modalPopup;
	}
	else {
		nonModalPopup = window.open(popupUrl, popupName, features);
		nonModalPopup.focus();
		return nonModalPopup;
	}
}

// popupCalendar
function popupCalendar(url) {
	var left = Math.floor((screen.width - 200) / 2);
	var top = Math.floor((screen.height - 180) / 2) - 50;
	features = "width=200,height=180,left=" + left + ",top=" + top + ",resizable=yes,status=no,toolbar=no,menubar=no,location=no";
	modalPopup = window.open(url, "calendar", features);
}

// popupCalendarForTextbox
function popupCalendarForTextbox(textBoxControl) {
	popupCalendar("/controls/calendar.aspx?textbox=" + textBoxControl.id);
}

// popupCalendarForFunction
function popupCalendarForFunction(functionName) {
	popupCalendar("/controls/calendar.aspx?functionName=" + functionName);
}

// bodyOnFocus
function bodyOnFocus() {
	if (modalPopup == null) {
		return;
	}
	
  setTimeout(returnToModalPopup, 50);
 }
 
 // returnToModalPopup
 function returnToModalPopup() {
  if ((modalPopup != null) && (!modalPopup.closed)) {
    modalPopup.focus();
  }
}
var x;
// showPrintablePage
function showPrintablePage(contentContainerName, pageTitle, addTable, tableAttributes, clubThemeFolder, clubName, clubUrl, styleContainer) {
	var contentContainer = document.getElementById(contentContainerName);
	if (contentContainer == null) {
		return;
	}
	var styles = null;
	if (styleContainer) {
		styles = document.getElementById(styleContainer);
	}
	var printWindow = window.open("", "print", "menubar=yes,width=500,height=400,resizable=yes,scrollbars=yes");
	printWindow.document.write("<html><head>");
	printWindow.document.write("<title>" + pageTitle + "</title>");
	printWindow.document.write("<link rel='stylesheet' type='text/css' href='/themes/common_ui.css'>");
	printWindow.document.write("<link rel='stylesheet' type='text/css' href='" + clubThemeFolder + "club.css'>");
	printWindow.document.write("<link rel='stylesheet' type='text/css' href='/themes/printable.css'>");
	if (styles != null) {
		printWindow.document.write("<style>" + styles.innerHTML + "</style>");
	}
	printWindow.document.write("</head><body class='printable-body'>");
	printWindow.document.write("<div style='font-size: larger; font-weight: bold; border-bottom: 1px solid black; padding-bottom: 4px; margin-bottom: 4px;'>" + clubName + "<br>" + clubUrl + "<br>" + pageTitle + "</div>");
	
	if (addTable == true) {
		printWindow.document.write("<table " + tableAttributes + ">");
	}
	
	var text = contentContainer.innerHTML;
	var regex;
	
	// hide print link
	
	regex = new RegExp("<span class=[\"']?print-link.*<\/span>");
	text = text.replace(regex, "");

	// remove all scripts
	regex = new RegExp("<script(.|\\s)*?</script>", "ig");
	text = text.replace(regex, "");
	
	// hide style buttons
	regex = new RegExp("class=[\"']?style-button-table[\"']?.* id", "g");
	text = text.replace(regex, "class='style-button-table' style='display:none;visibility:hidden;' id");

	// kill onclick and onchange handlers
	regex = new RegExp("onclick=([\"']).*?\\1", "ig");
	text = text.replace(regex, "");

	regex = new RegExp("onchange=([\"']).*?\\1", "ig");
	text = text.replace(regex, "");

	// remove image maps
	regex = new RegExp("<map(.|\s)*?<\/map>", "ig");
	text = text.replace(regex, "");
	
	// kill links
	regex = new RegExp("href=([\"']).*?\\1", "ig");
	text = text.replace(regex, "");
	
	printWindow.document.write(text);
	if (addTable == true) {
		printWindow.document.write("</table>");
	}
	printWindow.document.write("</body></html>");
	printWindow.document.write("<script>function killEvent(e) { e.target.disabled = true; e.preventDefault(); return false; } document.addEventListener('mousedown', killEvent, true);document.addEventListener('click', killEvent, true);document.addEventListener('mouseup', killEvent, true);document.addEventListener('keypress', killEvent, true);</script>");
	if (window.print) {
		printWindow.document.write("<script>window.print();</script>");
	}
	else {
		printWindow.document.write("<script>alert('Press Ctrl-P (or Apple-P), or select File->Print from the menu to print this page');</script>");
	}
	printWindow.document.close();

}

// image management stuff

var fileInputControl = null;
var imagePreviewControl = null;
var testImage = null;
var resizeRequired = false;
var maxImageWidth;
var maxImageHeight;
var imageSuccessFunction;
var imageErrorFunction;
var showResizeMessage;

// browserCanShowPreview
function browserCanShowPreview() {
	return (window.navigator.appName == "Microsoft Internet Explorer");
}

// getPreviewFileName
function getPreviewFileName(fullFileName) {
	var startPosition = fullFileName.lastIndexOf("\\");
	return fullFileName.substring(startPosition + 1);
}

// previewImage
function previewImage(fileInputControlName, imagePreviewControlName, maxWidth, maxHeight, successFunction, errorFunction, resizeMessageRequired) {
	fileInputControl = document.getElementById(fileInputControlName);
	previewImageWithFileName(fileInputControl.value, imagePreviewControlName, maxWidth, maxHeight, successFunction, errorFunction, resizeMessageRequired);
}

// previewImageWithFileName
function previewImageWithFileName(fileName, imagePreviewControlName, maxWidth, maxHeight, successFunction, errorFunction, resizeMessageRequired) {
	imagePreviewControl = document.getElementById(imagePreviewControlName);
	maxImageWidth = maxWidth;
	maxImageHeight = maxHeight;

	if (successFunction) {
		imageSuccessFunction = successFunction;
	}
	if (errorFunction) {
		imageErrorFunction = errorFunction;
	}
	if (resizeMessageRequired == true) {
		showResizeMessage = true;
	}
	else {
		showResizeMessage = false;
	}
	
	imagePreviewControl.style.visibility = "hidden";
	testImage = new Image();
	testImage.onload = resizePreview;
	if (imageErrorFunction) {
		testImage.onerror = imageErrorFunction;
	}
//	fileName = "file:///" + fileName.replace(/\\/g, "/");
	testImage.src = fileName;
}

// resizePreview
function resizePreview() {
	testImage.onload = null;
	testImage.onerror = null;
	var originalWidth = testImage.width;
	var widthRatio = 1;
	if (originalWidth > maxImageWidth) {
		testImage.width = maxImageWidth;
		widthRatio = originalWidth / maxImageWidth;
		testImage.height = testImage.height / widthRatio;
		resizeRequired = true;
	}
	
	if (testImage.height > maxImageHeight) {
		var heightRatio = testImage.height / maxImageHeight;
		testImage.height = testImage.height / heightRatio;
		testImage.width = testImage.width / heightRatio;
		resizeRequired = true;
	}

	imagePreviewControl.onload = showImage;
	if (imageErrorFunction) {
		imagePreviewControl.onerror = imageErrorFunction;
	}

	imagePreviewControl.width = testImage.width;
	imagePreviewControl.height = testImage.height;
	imagePreviewControl.src = testImage.src;
	if ((resizeRequired == true) && (showResizeMessage))  {
		alert("The image will be resized as shown to fit the available space");
	}
	resizeRequired = false;
}

// showImage
function showImage() {
	imagePreviewControl.onload = null;
	imagePreviewControl.onerror = null;
	if (testImage == null) {
		return;
	}
	imagePreviewControl.width = testImage.width;
	imagePreviewControl.height = testImage.height;
	imagePreviewControl.style.visibility = "visible";
	testImage = null;
	if (imageSuccessFunction) {
		imageSuccessFunction();
	}
}

// refreshPage
function refreshPage() {
	var submitButton = document.getElementById(submitButtonName);
	if (submitButton == null) {
		var currentUrl = window.location.href;
		if (currentUrl.indexOf("action=") == -1) {
			window.location.reload();
		}
		else {
			var regex = new RegExp("action=[^&]*&?");
			newUrl = currentUrl.replace(regex, "");
			window.location.href = newUrl;
		}
	}
	else {
		submitButton.onclick();
		//__doPostBack(submitButtonName, "");
	}
}

// formatNumber
function formatNumber(number, decimalPlaces, dollarSign, scaleFactor) {
	return formatNumber2(number, decimalPlaces, dollarSign, scaleFactor, true);
}

// formatNumber2
function formatNumber2(number, decimalPlaces, dollarSign, scaleFactor, commas) {
	if (isNaN(parseFloat(number))) {
		return "NaN";
	}
	if (isNaN(parseInt(decimalPlaces, 10))) {
		decimalPlaces = 2;
	}
	
	if (decimalPlaces == 0) {
		if (commas == true) {
			return addCommas(Math.round(number).toString());
		}
		else {
			return Math.round(number).toString();
		}
	}
	
	if (isNaN(parseInt(scaleFactor))) {
		scaleFactor = 0;
	}
	var numberString = "" + Math.round(number * Math.pow(10, (decimalPlaces - scaleFactor)));
	while (numberString.length <= decimalPlaces) {
		numberString = "0" + numberString;
	}
	var decimalPosition = numberString.length - decimalPlaces;
	
	if (dollarSign == true) {
		dollarSign = "$ ";
	}
	else {
		dollarSign = "";
	}
	if (commas) {
		return dollarSign + addCommas(numberString.substring(0, decimalPosition) + "." + numberString.substring(decimalPosition, numberString.length));
	}
	else {
		return numberString.substring(0, decimalPosition) + "." + numberString.substring(decimalPosition, numberString.length);
	}
}

function addCommas(nStr) {
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

// roundFloat
function roundFloat(number, decimalPlaces) {
	if (isNaN(parseFloat(number))) {
		return "NaN";
	}
	if (isNaN(parseInt(decimalPlaces, 10))) {
		decimalPlaces = 2;
	}

	return parseFloat(number.toFixed(decimalPlaces));
}

// getAjaxObject
function getAjaxObject() {
	if (window.ActiveXObject){ // IE 
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else {
		if (window.XMLHttpRequest) { // Non-IE browsers
			return new XMLHttpRequest(); 
		}
		else {
			return null;
		}
	}
}

// trimString
function trimString(input) {
	var regex = new RegExp("^\\s+");
	var output = input.replace(regex, "");

	regex = new RegExp("\\s+$");
	output = output.replace(regex, "");

	return output;
}

// resizeFileInput
function resizeFileInput(newSize) {
	for (var counter = 0; counter < document.forms[0].elements.length; counter ++) {
		var element = document.forms[0].elements[counter];
		if (element.type == "file") {
			element.size = newSize;
			break;
		}
	}
}

// keyDownHandler
function keyDownHandler(e) {
	var keyNumber = 0;
	var source;
	if (e) {
		// netscape/mozilla code
		keyNumber = e.which;
		source = e.target;
	}
	else {
		// ie code
		keyNumber = window.event.keyCode;
		source = window.event.srcElement;
	}
	
	// let alpha, numeric, and standard punctuation keys go
	if ((keyNumber >= 32) && (keyNumber <= 97)) {
		return true;
	}
	
	// escape
	if (keyNumber == 27) {
		var cancelButton = document.getElementById(cancelButtonName);
		if (cancelButton == null) {
			doCancel();
		}
		else {
			window.setTimeout(cancelButton.onclick, 20);
		}
		return false;
	}
	
	// F1
	if (keyNumber == 112) {
		var helpControl = document.getElementById("help_link");
		if (helpControl != null) {
			helpControl.onclick();
			return false;
		}
		return true;
	}
	
	// enter (return)
	if (keyNumber == 13) {
		if (source.type == "textarea") {
			return true;
		}
		else {
			var submitButton = document.getElementById(submitButtonName);
			if (submitButton != null) {
				submitButton.onclick();
			}
			return false;  // return false for enter keys so that there are no accidental form submits
		}
	}
	
	// default
	return true;
}   // keyDownHandler

// connect keyHandler function to key down event
document.onkeydown = keyDownHandler;


// inspect - for debugging
function inspect(obj, maxLevels, level, includeFunctions) {
	var str = '', type, msg;
	// Start Input Validations
	// Don't touch, we start iterating at level zero
	if(level == null) {
		level = 0;
	}

	// At least you want to show the first level
	if (maxLevels == null) {
		maxLevels = 1;
	}
	if (maxLevels < 1) {   
		return 'Error: Levels number must be > 0';
	}

	// We start with a non null object
	if (obj == null) {
		return 'Error: Object NULL';
	}
	// End Input Validations
	
	for (var i = 0; i < level; i++) {
		str += '...';
	}

	str += "Inspecting " + Object.prototype.toString.apply(obj) + ' (' + obj.toString() + ')\n';
	str += 'Value: ' + obj.toString() + '\n';
	var propertiesFound = false;
	
	// Start iterations for all objects in obj
	for (property in obj) {
		propertiesFound = true;
		try {
			// Show "property" and "type property"
			type = typeof(obj[property]);
			
			if ((type == 'function') && (!includeFunctions)) {
				continue;
			}
			
			if (property == 'textContent') {
				continue;
			}
			if (property == 'innerHTML') {
				continue;
			}
			str += '(' + type + ') ' + property + ': '
			if (obj[property] == null) {
				str += '(null)';
			}
			else {
				if (obj[property] == '') {
					str += '(blank)';
				}
				else {
					str += obj[property];
				}
			}
			str += '\n';
			
			// We keep iterating if this property is an Object, non null
			// and we are inside the required number of levels
			if ((type == 'object') && (obj[property] != null) && (level+1 < maxLevels)) {
				str += inspect(obj[property], maxLevels, level+1) + '\n';
			}
		}
		catch(err) {
			// Is there some properties in obj we can't access? Print it red.
			if(typeof(err) == 'string')
				{ msg = err;
			}
			else if (err.message) {
				msg = err.message;
			}
			else if (err.description) {
				msg = err.description;
			}
			else {
				msg = 'Unknown';
			}

			str += '(Error) ' + property + ': ' + msg +'';
		}
	}  // for
	if (!propertiesFound) {
		str += 'No properties found';
	}
	return str;
}

// inspectHtml - for debugging
function inspectHtml(obj, maxLevels, level) {
	var str = '', type, msg;

	// Start Input Validations
	// Don't touch, we start iterating at level zero
	if(level == null) {
		level = 0;
	}

	// At least you want to show the first level
	if (maxLevels == null) {
		maxLevels = 1;
	}
	if(maxLevels < 1) {   
		return '<font color="red">Error: Levels number must be > 0</font>';
	}

	// We start with a non null object
	if (obj == null) {
		return "<font color='red'>Error: Object <b>NULL</b></font>";
	}
	// End Input Validations
	str += obj.toString();
	// Each Iteration must be indented
	str += '<ul>';

	// Start iterations for all objects in obj
	for (property in obj) {
		try {
			// Show "property" and "type property"
			type =  typeof(obj[property]);
			str += '<li>(' + type + ') ' + property + 
						 ( (obj[property]==null)?(': <b>null</b>'):('')) + '</li>';

			// We keep iterating if this property is an Object, non null
			// and we are inside the required number of levels
			if ((type == 'object') && (obj[property] != null) && (level+1 < maxLevels)) {
				str += inspect(obj[property], maxLevels, level+1);
			}
		}
		catch(err) {
			// Is there some properties in obj we can't access? Print it red.
			if(typeof(err) == 'string')
				{ msg = err;
			}
			else if (err.message) {
				msg = err.message;
			}
			else if (err.description) {
				msg = err.description;
			}
			else {
				msg = 'Unknown';
			}

			str += '<li><font color="red">(Error) ' + property + ': ' + msg +'</font></li>';
		}
	}  // for

		// Close indent
		str += '</ul>';

	return str;
}
//** Smooth Navigational Menu- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Menu created: Nov 12, 2008

//** Dec 12th, 08" (v1.01): Fixed Shadow issue when multiple LIs within the same UL (level) contain sub menus: http://www.dynamicdrive.com/forums/showthread.php?t=39177&highlight=smooth

//** Feb 11th, 09" (v1.02): The currently active main menu item (LI A) now gets a CSS class of ".selected", including sub menu items.

//** May 1st, 09" (v1.3):
//** 1) Now supports vertical (side bar) menu mode- set "orientation" to 'v'
//** 2) In IE6, shadows are now always disabled


var ddsmoothmenu={

//Specify full URL to down and right arrow images (23 is padding-right added to top level LIs with drop downs):
arrowimages: {down:['downarrowclass', '/images/menu_down.gif', 23], right:['rightarrowclass', '/images/menu_right.gif', 20]},

transition: {overtime:100, outtime:100}, //duration of slide in/ out animation, in milliseconds
shadow: {enabled:false, offsetx:0, offsety:0},

///////Stop configuring beyond here///////////////////////////

detectwebkit: navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1, //detect WebKit browsers (Safari, Chrome etc)
detectie6: document.all && !window.XMLHttpRequest,

getajaxmenu:function($, setting){ //function to fetch external page containing the panel DIVs
	var $menucontainer=$('#'+setting.contentsource[0]) //reference empty div on page that will hold menu
	$menucontainer.html("Loading Menu...")
	$.ajax({
		url: setting.contentsource[1], //path to external menu file
		async: true,
		error:function(ajaxrequest){
			$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
		},
		success:function(content){
			$menucontainer.html(content)
			ddsmoothmenu.buildmenu($, setting)
		}
	})
},


buildmenu:function($, setting){
	var smoothmenu=ddsmoothmenu
	var $mainmenu=$("#"+setting.mainmenuid+">ul") //reference main menu UL
	$mainmenu.parent().get(0).className=setting.classname || "ddsmoothmenu"
	var $headers=$mainmenu.find("ul").parent()
	$headers.hover(
		function(e){
			$(this).children('a:eq(0)').addClass('selected')
		},
		function(e){
			$(this).children('a:eq(0)').removeClass('selected')
		}
	)
	$headers.each(function(i){ //loop through each LI header
		var $curobj=$(this).css({zIndex: 100-i}) //reference current LI header
		var $subul=$(this).find('ul:eq(0)').css({display:'block'})
		this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
		this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
		$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
		$curobj.children("a:eq(0),span:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append( //add arrow images
			'<img src="'+ (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[1] : smoothmenu.arrowimages.right[1])
			+'" class="' + (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[0] : smoothmenu.arrowimages.right[0])
			+ '" style="border:0;" />'
		)
		if (smoothmenu.shadow.enabled){
			this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
			if (this.istopheader)
				$parentshadow=$(document.body)
			else{
				var $parentLi=$curobj.parents("li:eq(0)")
				$parentshadow=$parentLi.get(0).$shadow
			}
			this.$shadow=$('<div class="ddshadow'+(this.istopheader? ' toplevelshadow' : '')+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'})  //insert shadow DIV and set it to parent node for the next shadow div
		}
		$curobj.hover(
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				this._offsets={left:$(this).offset().left, top:$(this).offset().top}
				var menuleft=this.istopheader && setting.orientation!='v'? 0 : this._dimensions.w
				menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader && setting.orientation!='v'? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent
				if ($targetul.queue().length<=1){ //if 1 or less queued animations
					$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
					if (smoothmenu.shadow.enabled){
						var shadowleft=this.istopheader? $targetul.offset().left+ddsmoothmenu.shadow.offsetx : menuleft
						var shadowtop=this.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : this._shadowoffset.y
						if (!this.istopheader && ddsmoothmenu.detectwebkit){ //in WebKit browsers, restore shadow's opacity to full
							this.$shadow.css({opacity:1})
						}
						this.$shadow.css({overflow:'', width:this._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:this._dimensions.subulh+'px'}, ddsmoothmenu.transition.overtime)
					}
				}
			},
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				$targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
				if (smoothmenu.shadow.enabled){
					if (ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them
						this.$shadow.children('div:eq(0)').css({opacity:0})
					}
					this.$shadow.css({overflow:'hidden'}).animate({height:0}, ddsmoothmenu.transition.outtime)
				}
			}
		) //end hover
	}) //end $headers.each()
	$mainmenu.find("ul").css({display:'none', visibility:'visible'})
},

init:function(setting){

	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
		var mainmenuid='#'+setting.mainmenuid
		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
//		document.write('<style type="text/css">\n'
//			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
//			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
//		+'</style>')
	}
	this.shadow.enabled=false;//(document.all && !window.XMLHttpRequest)? false : true //in IE6, always disable shadow
	$(document).ready(function($){ //ajax menu?
		if (typeof setting.contentsource=="object"){ //if external ajax menu
			ddsmoothmenu.getajaxmenu($, setting)
		}
		else{ //else if markup menu
			ddsmoothmenu.buildmenu($, setting)
		}
	})
}

} //end ddsmoothmenu variable
