// HOVERHELP -----------------------------------------------------------------------------------------------------------------------------------------------------------
function HelpHover(){ 
	this._mousePosX = 0; 
	this._mousePosY = 0; 
	this._hoverItem = null; 
	this._hoverContents = null;
}
HelpHover.prototype.init = function(){ 
	var hh = this; 
	var helpItems = document.getElementsByClassName('hasHelp'); 
	for (var i=0; i < helpItems.length; i++){ 
		helpItems[i].onmousemove = function(e){ 
			if (!e) var e = window.event; 
			if (e.pageX || e.pageY){ 
				hh.mousePosX = e.pageX; 
				hh.mousePosY = e.pageY; 
			}else if (e.clientX || e.clientY){ 
				hh.mousePosX = e.clientX + document.documentElement.scrollLeft;
				hh.mousePosY = e.clientY + document.documentElement.scrollTop; 
				//alert(document.documentElement.scrollTop);
			}; 
			hh._hoverItem = this; 
			hh._hoverContents = document.getElementById(this.id+'Help'); 
			hh.move();
		}; 
		helpItems[i].onmouseout = function (e){ hh.out(); } 
		// helpItems[i].onpress = function (e){ hh.out(); } 
	} 
}
HelpHover.prototype.out = function(){ 
	this._hoverContents.style.top = -10000+'px'; 
	this._hoverContents.style.left = -10000+'px';
	this._hoverItem = null; 
	this._hoverContents = null;
	if (document.getElementById("HHiFrameShim")) {
		document.getElementById('HHiFrameShim').style.top = -10000+'px';
		document.getElementById('HHiFrameShim').style.left = -10000+'px';
	}
}
HelpHover.prototype.move = function(){ 
	this._hoverContents.style.top = this.mousePosY+10+'px'; 
	this._hoverContents.style.left = this.mousePosX+10+'px';
	if (navigator.userAgent.indexOf('MSIE') != -1){
		if (!document.getElementById("HHiFrameShim")) {
			try {
				var newNode = document.createElement("iFrame");
				newNode.setAttribute("id", "HHiFrameShim");
				newNode.setAttribute("src", "javascript:false;");
				newNode.setAttribute("scrolling", "no");
				newNode.setAttribute ("frameborder", "0");
				document.body.appendChild(newNode);
			} catch(e) {  }
		}
		try { 		
			HHShim = document.getElementById('HHiFrameShim');
			HHShim.style.position = "absolute";
			HHShim.style.width = this._hoverContents.offsetWidth;
			HHShim.style.height = this._hoverContents.offsetHeight;
			HHShim.style.top = this.mousePosY+10+'px'; 
			HHShim.style.left = this.mousePosX+10+'px';
			HHShim.style.zIndex = 100 - 1;
			HHShim.style.visibility = true;
			HHShim.style.display = 'none';
		} catch(e) {  }
	}
}
addEvent(window, 'load', function(){ var hh = new HelpHover(); hh.init(); });
document.getElementsByClassName = function (needle){ 
	var my_array = document.getElementsByTagName("*"); 
	var retvalue = new Array(); 
	var i; 
	var j; 
	for (i = 0, j = 0; i < my_array.length; i++){ 
		var c = " " + my_array[i].className + " "; 
		if (c.indexOf(" " + needle + " ") != -1){ 
			retvalue[j++] = my_array[i];
		}
	} 
	return retvalue;
}
function addEvent(obj, evType, fn){ 
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, true); 
		return true; 
	}else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	}else{ 
		return false; 
	}
}



// FUNCTION TO HIDE STATUS DISPLAY FOR ALL LINKS -----------------------------------------------------------------------------------------------------------------------
function hidestatus(){ window.status=''; return true }
if (document.layers){ document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT) }
document.onmouseover = hidestatus;
document.onmouseout = hidestatus;

// COMMON FUNCTIONS ----------------------------------------------------------------------------------------------------------------------------------------------------
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function big_photo(which_photo,width,height) {	
	var URL = '../big_photo.cfm?image_link=' + which_photo + '&width=' + width + '&height=' + height;
	max_height = screen.height - 100;
	max_width = screen.width - 20;
	height = height - 0;
	width = width - 0;
	sb = "auto";
	if (max_height < height) {
		height = max_height;
		width = width + 17;
		sb = "yes";
	}
	if (max_width < width) {
		width = max_width;
		sb = "yes";
	}
	var windowName = 'ae_photo'
	var features = 'width=' + width + ',height=' + height + ',location=no,menubar=no' + ',scrollbars=' + sb + ',status=no,toolbar=no,resizable=no,top=10,left=10';
	window.open (URL, windowName, features);
}
function popUp(URL,windowName,width,height) {	
	var features = 'width=' + width + ',height=' + height + ',location=no' + ',menubar=no' + ',scrollbars=yes' + ',status=no' + ',toolbar=no' + ',resizable=yes,top=10,left=10';
	window.open (URL, windowName, features);
}
function confirmIt(message,url) { if (confirm(message)){ self.location = url; } }
function selRow(IDprefix, defClass,addClass){
	cbox = document.getElementById(IDprefix + '_checkbox');
	trow = document.getElementById(IDprefix + '_row');
	if( cbox.checked == true ){ trow.className = 'row01s ' + addClass; }else{ trow.className = defClass; }
}
function selAll(IDprefix, defClass, numRows, allchecked){
	set_val = document.getElementById(IDprefix + 'checkbox_all').checked;
	for(i=1; i<=numRows; i++){
		document.getElementById(IDprefix + i + '_checkbox').checked = set_val;
		IdItemPrefix = IDprefix + i;
		selRow(IdItemPrefix, defClass);
	}
}
function checkAll(prefix, start, end, sel){
	if(sel){ cval = true; }else{ cval = false; }	
	for(i=start; i<=end; i++){
		try{ document.getElementById(prefix + i).checked = cval; }catch(err){}
	}
}
function SetAllCheckBoxes(FormName, FieldName, CheckValue){
	if(!document.forms[FormName]){
		return;
	}
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes){
		return;
	}
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes){
		objCheckBoxes.checked = CheckValue;
	}else{
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++){
			objCheckBoxes[i].checked = CheckValue;
		}
	}
}
function submitForm(form_id){ document.getElementById(form_id).submit(); }
function showHide(this_id){ 
	obj = document.getElementById(this_id);
	if(obj.style.display == 'none'){ obj.style.display = 'block'; }else{ obj.style.display = 'none'; }
}

// DIRECTORY -----------------------------------------------------------------------------------------------------------------------------------------------------------
function serverAction(action,urlvars){ server_action.location = 'server_action.cfm?action=' + action + urlvars;  }
function faqs(a) { 
	faqs_window = window.open('list_sites_faqs.cfm#' + a,'faqs_window','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=500,left=50,top=50')
}

// CREATE/EDIT AD ------------------------------------------------------------------------------------------------------------------------------------------------------
function setAdPage(this_ad_page, num_pages, this_camp_id){
	this_camp_id = document.getElementById('camp_id').value;
	for(i=1; i<=num_pages; i++){
		if( i == this_ad_page ){ this_style = 'block'; }else{ this_style = 'none'; }
		document.getElementById('ads_' + this_camp_id + '_' + i).style.display = this_style; 
		document.getElementById('pagenum_' + this_camp_id + '_' + i).style.color = '#0033CC';
	}
	document.getElementById('this_ad_num_pages').value = num_pages;
	document.getElementById('this_ad_page').value = this_ad_page;
	document.getElementById('pagenum_'  + this_camp_id + '_' + this_ad_page).style.color = '#AAAAAA';
}
function setCampPage(this_camp_page, num_pages){
	if(num_pages > 1){
		for(i=1; i<=num_pages; i++){
			if( i == this_camp_page ){ this_style = 'block'; }else{ this_style = 'none'; }
			document.getElementById('camps_' + i).style.display = this_style;
			document.getElementById('camp_pagenum_' + i).style.color = '#0033CC';
		}
		document.getElementById('camp_pagenum_' + this_camp_page).style.color = '#AAAAAA';
	}
	document.getElementById('this_camp_num_pages').value = num_pages;
	document.getElementById('this_camp_page').value = this_camp_page;
}
html_alert = 0;
function previewAd(section){
	this_target = 'preview_' + section;
	new_content = document.getElementById(section).value;
	if( ((new_content.indexOf('<')>=0) || (new_content.indexOf('>')>=0)) && (html_alert==0) ){ alert('HTML not supported'); html_alert = 1; }
	document.getElementById(this_target).innerHTML = new_content;
}
function deselectAd(){
	current_ad_id = document.getElementById('ad_id').value;
	if( current_ad_id ){
		document.getElementById(current_ad_id).className = 'create_ad_ad_mid';
		document.getElementById(current_ad_id).className = 'create_ad_ad_mid';
		document.getElementById(current_ad_id + '_2').className = 'create_ad_ad_mid';
		document.getElementById(current_ad_id + '_2').className = 'create_ad_ad_mid';
	}
}
function displayToggle(id) {
	var el = document.getElementById(id).style; 
	if(el.display == "none") { el.display = "block"; } else if(el.display == "block") { el.display = "none"; }
}
function resetPreview(){
	document.getElementById('preview_link_name').innerHTML = "Your Ad Headline";
	document.getElementById('preview_description_area').innerHTML = "Your ad description.";
}
function markSelection ( txtObj ) {
	if ( txtObj.createTextRange ) {
		txtObj.caretPos = document.selection.createRange().duplicate();
		isSelected = true;
	}
}
function setCount(item){
	switch (item){									
		case 'desc': fld = 'description_area'; break;
		case 'head': fld = 'link_name'; break;
	}
	var dsp = document.getElementById(item + '_counter_disp');
	dsp.innerHTML = document.getElementById(fld).value.length;
}
function testLink(){
	this_url = document.getElementById('link_url').value;
	if( this_url.indexOf('http://') < 0 ){ this_url = 'http://' + this_url; }
	if( this_url.indexOf('.') > 0 ){
		image_info = window.open(this_url,'video_info','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=700,height=500,left=50,top=50');
	}else{
		alert('Not a valid URL');
	}
}
function selCheckedPeriod(e) {
	var _x; var _y;
	if (!isIE) { _x = e.pageX; _y = e.pageY; }
	if (isIE) { _x = event.clientX + document.body.scrollLeft; _y = event.clientY + document.body.scrollTop; }
	if( _x > apX_s && _x < apX_e && _y > apY_s && _y < apY_e ){
		// inside area
	}else if( selected == 0 ){
		// outside area
		for(j=0; j<periods.length; j++){ 
			if( document.getElementById('f' + periods[j]).checked == true ){ setPricing(periods[j]); break; }				
		}
		selected = 1;
	}
}
function findPosX(obj)	{
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

// DATE PICKER SCRIPTS -------------------------------------------------------------------------------------------------------------------------------------------------
// 	modified from scripts @ http://www.nsftools.com/tips/NotesTips.htm#datepicker
var datePickerDivID = "datepicker";
var iFrameDivID = "datepickeriframez";
var dayArrayShort = new Array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa');
var dayArrayMed = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var dayArrayLong = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
var monthArrayShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
var monthArrayMed = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');
var monthArrayLong = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var defaultDateSeparator = "/";   // common values would be "/" or "."
var defaultDateFormat = "mdy";    // valid values are "mdy", "dmy", and "ymd"
var dateSeparator = defaultDateSeparator;
var dateFormat = defaultDateFormat;
var initiated = 1;
function displayDatePicker(dateFieldName, displayBelowThisObject,dtFormat,dtSep){
	
	var targetDateField = document.getElementById(dateFieldName);
	if (!displayBelowThisObject)
		displayBelowThisObject = targetDateField;
	if (dtSep)
		dateSeparator = dtSep;
	else
		dateSeparator = defaultDateSeparator;
	if (dtFormat)
		dateFormat = dtFormat;
	else
		dateFormat = defaultDateFormat;
	
	var x = displayBelowThisObject.offsetLeft;
	var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight ;
	
	var parent = displayBelowThisObject;
	while (parent.offsetParent) {
		parent = parent.offsetParent;
		x += parent.offsetLeft;
		y += parent.offsetTop ;
	}
	drawDatePicker(targetDateField, x, y);
}
function drawDatePicker(targetDateField, x, y){
	var dt = getFieldDate(targetDateField.value );
	
	if (!document.getElementById(datePickerDivID)) {
		var newNode = document.createElement("div");
		newNode.setAttribute("id", datePickerDivID);
		newNode.setAttribute("class", "dpDiv");
		newNode.setAttribute("style", "visibility: hidden;");
		document.body.appendChild(newNode);
	}
	
	var pickerDiv = document.getElementById(datePickerDivID);
	pickerDiv.style.position = "absolute";
	pickerDiv.style.left = x + "px";
	pickerDiv.style.top = y + "px";
	pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible");
	pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block");
	pickerDiv.style.zIndex = 10000;
	
	refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate());
}
function refreshDatePicker(dateFieldName, year, month, day){
	
	cutMonth = getCutDate(dateFieldName, 'month');
	cutDay = getCutDate(dateFieldName, 'day');
	cutYear = getCutDate(dateFieldName, 'year');
	cutDate = cutMonth + "/" + cutDay + "/" + cutYear;
		
	var thisDay = new Date();
	
	if ((month >= 0) && (year > 0)) {
		thisDay = new Date(year, month, 1);
	} else {
		thisDay = new Date((cutYear), (cutMonth-1), 1);
	}
	
	var crlf = "\r\n";
	var TABLE = "<table cols=7 class='dpTable'>" + crlf;
	var xTABLE = "</table>" + crlf;
	var TR = "<tr class='dpTR'>";
	var TR_title = "<tr class='dpTitleTR'>";
	var TR_days = "<tr class='dpDayTR'>";
	var TR_todaybutton = "<tr class='dpTodayButtonTR'>";
	var xTR = "</tr>" + crlf;
	var TD = "<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' ";
	var TD_title = "<td colspan=5 class='dpTitleTD'>";
	var TD_buttons = "<td class='dpButtonTD'>";
	var TD_todaybutton = "<td colspan=7 class='dpTodayButtonTD'>";
	var TD_days = "<td class='dpDayTD'>";
	var TD_selected = "<td class='dpDayHighlightTD' onMouseOut='this.className=\"dpDayHighlightTD\";' onMouseOver='this.className=\"dpTDHover\";' ";
	var xTD = "</td>" + crlf;
	var DIV_title = "<div class='dpTitleText'>";
	var DIV_selected = "<div class='dpDayHighlight'>";
	var xDIV = "</div>";
	
	var html = TABLE;
	html += TR_title;
	html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, "&lt;") + xTD;
	html += TD_title + DIV_title + monthArrayLong[ thisDay.getMonth()] + " " + thisDay.getFullYear() + xDIV + xTD;
	html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, "&gt;") + xTD;
	html += xTR;
	html += TR_days;// this is the row that indicates which day of the week we're on
	for(i = 0; i < dayArrayShort.length; i++)
		html += TD_days + dayArrayShort[i] + xTD;
	html += xTR;
	html += TR;// now we'll start populating the table with days of the month
	
	// first, the leading blanks
	for (i = 0; i < thisDay.getDay(); i++)
		html += TD + "&nbsp;" + xTD;
		
	// now, the days of the month
	monthNum = thisDay.getMonth();
	yearNum = thisDay.getFullYear();
	
	do {
		dayNum = thisDay.getDate();
		
		if( (monthNum<=(cutMonth-1)) && (dayNum<cutDay) && (yearNum<=cutYear) ){
			TD_onclick = " style=\"color: #FF0000; text-decoration: line-through\">";
		}else{
			TD_onclick = " onclick=\"updateDateField('" + dateFieldName + "', '" + getDateString(thisDay) + "');\">";
		}
		
		if (dayNum == day){
			html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
		}else{
			html += TD + TD_onclick + dayNum + xTD;
		}
		
		if (thisDay.getDay() == 6)// if this is a Saturday, start a new row
			html += xTR + TR;
			
		thisDay.setDate(thisDay.getDate() + 1);// increment the day
	} while (thisDay.getDate() > 1)

	// fill in any trailing blanks
	if (thisDay.getDay() > 0) {
		for (i = 6; i > thisDay.getDay(); i--)
			html += TD + "&nbsp;" + xTD;
	}
	html += xTR;
		
	var today = new Date();// add a button to allow the user to easily return to today, or close the calendar
	var todayString = "Today is " + dayArrayMed[today.getDay()] + ", " + monthArrayMed[ today.getMonth()] + " " + today.getDate();
	html += TR_todaybutton + TD_todaybutton;
	
	show_first_avail = document.getElementById('first_avail').value;

	if( show_first_avail == 1 ){ html += "<button style='width:100px' class='dpTodayButton' onClick='updateDateField(\"" + dateFieldName + "\",\"" + cutDate + "\");'>first available</button> "; }
		
	html += "<button style='width:40px' class='dpTodayButton' onClick='updateDateField(\"" + dateFieldName + "\");'>close</button>";
	html += xTD + xTR;
	
		html += xTABLE;// and finally, close the table
		document.getElementById(datePickerDivID).innerHTML = html;
	adjustiFrame();// add an "iFrame shim" to allow the datepicker to display above selection lists
}
function getButtonCode(dateFieldName, dateVal, adjust, label){

	cutMonth = getCutDate(dateFieldName, 'month');
	cutDay = getCutDate(dateFieldName, 'day');
	cutYear = getCutDate(dateFieldName, 'year');
	
	var newMonth = (dateVal.getMonth () + adjust) % 12;
	var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12);
	if (newMonth < 0) {
		newMonth += 12;
		newYear += -1;
	}
	
	varWA1 = cutYear - 1900;
	varWA2 = dateVal.getYear();
	
	if( adjust == -1 && dateVal.getMonth() == (cutMonth-1) && varWA1 == varWA2 ){
		return "";
	}else{
		return "<button class='dpButton' onClick='refreshDatePicker(\"" + dateFieldName + "\", " + newYear + ", " + newMonth + ", 0);'>" + label + "</button>";
	}
}
function getDateString(dateVal){
	var dayString = "00" + dateVal.getDate();
	var monthString = "00" + (dateVal.getMonth()+1);
	dayString = dayString.substring(dayString.length - 2);
	monthString = monthString.substring(monthString.length - 2);
	
	switch (dateFormat) {
		case "dmy" : return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
		case "ymd" : return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString;
		case "mdy" : 
		default : return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear();
	}
}
function getFieldDate(dateString) {
	var dateVal;
	var dArray;
	var d, m, y;
	try {
		dArray = splitDateString(dateString);
		if (dArray) {
			switch (dateFormat) {
				case "dmy" : d = parseInt(dArray[0], 10); m = parseInt(dArray[1], 10) - 1; y = parseInt(dArray[2], 10); break;
				case "ymd" : d = parseInt(dArray[2], 10); m = parseInt(dArray[1], 10) - 1; y = parseInt(dArray[0], 10); break;
				case "mdy" : default : d = parseInt(dArray[1], 10); m = parseInt(dArray[0], 10) - 1; y = parseInt(dArray[2], 10); break;
			}
			dateVal = new Date(y, m, d);
		} else if (dateString) {
			dateVal = new Date(dateString);
		} else {
			dateVal = new Date();
		}
	} catch(e) { dateVal = new Date(); }
	return dateVal;
}
function splitDateString(dateString){
	var dArray;
	if (dateString.indexOf("/") >= 0)
		dArray = dateString.split("/");
	else if (dateString.indexOf(".") >= 0)
		dArray = dateString.split(".");
	else if (dateString.indexOf("-") >= 0)
		dArray = dateString.split("-");
	else if (dateString.indexOf("\\") >= 0)
		dArray = dateString.split("\\");
	else
		dArray = false;

	return dArray;
}
function updateDateField(dateFieldName, dateString){
	cutMonth = getCutDate(dateFieldName, 'month');
	cutDay = getCutDate(dateFieldName, 'day');
	cutYear = getCutDate(dateFieldName, 'year');
	cutYear = cutYear;
	
	if(dateString){ 
		thisDateString = dateString; 
	}else{ 
		datePickerSelected(dateFieldName);
		thisDateString = op_date; 
	}
	
	dateArray = splitDateString(thisDateString);
	thisMonth = parseFloat(dateArray[0]);
	thisDay = parseFloat(dateArray[1]);
	thisYear = parseFloat(dateArray[2]);
	
	if( (thisYear < parseInt(cutYear)) || (thisMonth < parseInt(cutMonth) && thisYear <= parseInt(cutYear)) || (thisDay < parseInt(cutDay) && thisMonth <= parseInt(cutMonth) && thisYear <= parseInt(cutYear)) ){
		alert('The date you have chosen is not available');
		thisMonth = cutMonth;
		thisDay = cutDay;
		thisYear = cutYear;
		thisDateString = cutMonth + '/' + cutDay + '/' + cutYear;
	}
	
	document.getElementById(dateFieldName + '_month').selectedIndex = thisMonth - 1;
	document.getElementById(dateFieldName + '_day').selectedIndex = thisDay - 1; 
	document.getElementById(dateFieldName + '_year').selectedIndex = thisYear - document.getElementById(dateFieldName + '_year')[0].value;
	
	var targetDateField = document.getElementById(dateFieldName);
	targetDateField.value = thisDateString;
	
	var pickerDiv = document.getElementById(datePickerDivID);
	if(pickerDiv){
		pickerDiv.style.visibility = "hidden";
		pickerDiv.style.display = "none";
	}
	adjustiFrame();	
}
function adjustiFrame(pickerDiv, iFrameDiv){
	if(initiated){
		var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
		if (is_opera)
			return;
		
		try {
			if (!document.getElementById(iFrameDivID)) {
				var newNode = document.createElement("iFrame");
				newNode.setAttribute("id", iFrameDivID);
				newNode.setAttribute("src", "javascript:false;");
				newNode.setAttribute("scrolling", "no");
				newNode.setAttribute ("frameborder", "0");
				//document.body.appendChild(newNode);
			}
		
			if (!pickerDiv)
				pickerDiv = document.getElementById(datePickerDivID);
			if (!iFrameDiv)
				iFrameDiv = document.getElementById(iFrameDivID);
		
			try {
				iFrameDiv.style.position = "absolute";
				iFrameDiv.style.width = pickerDiv.offsetWidth;
				iFrameDiv.style.height = pickerDiv.offsetHeight ;
				iFrameDiv.style.top = pickerDiv.style.top;
				iFrameDiv.style.left = pickerDiv.style.left;
				iFrameDiv.style.zIndex = pickerDiv.style.zIndex - 1;
				iFrameDiv.style.visibility = pickerDiv.style.visibility ;
				iFrameDiv.style.display = pickerDiv.style.display;
			} catch(e) { }
		
		} catch (ee) { }
	}
}
function datePickerSelected(fieldName){
	op_month = document.getElementById(fieldName + '_month').value;
	op_day = document.getElementById(fieldName + '_day').value;
	op_year = document.getElementById(fieldName + '_year').value;
	op_date = op_month + '/' + op_day + '/' + op_year;
	return op_date;
}
function getCutDate(fieldName, datePart){ 
	return_val = document.getElementById(fieldName + '_cut_' + datePart).value;
	return return_val;
}
initiated = 1;