//--- FORM CREATOR
function addOption(formElement, optiontext, optionValue) {
  var optionName = new Option(optiontext, optionValue, false, false)
  var length = formElement.length;
  formElement.options[length] = optionName;
}

function removeElement(array, itemNo) {
  size = array.length;
  validNo = (itemNo != "NaN");
  inRange = ( (itemNo >= 0) && (itemNo <= array.length) );
  if (validNo && inRange) {
    for (var i=0; i<=size; i++)
      array[i] = ((i == itemNo) ? "delete" : array[i]);
      for (var j=itemNo; j<size-1; j++)
      if (j != size) array[j] = array[j+1];
      array.length = size-1;
    return array
  }
  return array
}

var formelementIDs = '1|*|2|*|3|*|4|*|5|*|6|*|7|*|8|*|9|*|10|*|11'.split('|*|');
var formelementDescriptions = 'Simple single line text field|*|A large multiple line text area suitable for large amounts of text|*|A text field that validates the users input as an email address|*|A text field that validates the users input as numeric|*|Displays a group of radio buttons, enter your options into the value field separated by || (Two vertical bars)|*|Displays a group of checkboxes, enter your options into the value field separated by || (Two vertical bars)|*|A pull down menu, enter your options into the value field separated by || (Two vertical bars)|*|Fields for selecting a date|*|A field for selecting a time|*|Button that returns the user to their previous page|*|Button that submits the form'.split('|*|');
var formelementTags = '<input type="text" name="TAGNAME" value="TAGVALUE">|*|<textarea name="TAGNAME">TAGVALUE</textarea>|*|<input type="text" name="TAGNAME" value="TAGVALUE">|*|<input type="text" name="TAGNAME" value="TAGVALUE">|*|<input type="radio" name="TAGNAME" value="TAGVALUE">|*|<input type="checkbox" name="TAGNAME" value="TAGVALUE">|*|<select name="TAGNAME">**MENU**</select>|*|DATE|*|TIME|*|<input type="button" name="TAGNAME" value="TAGVALUE" onClick="Javascript:document.location.href=\'**RETURNPAGE**\'">|*|<input type="submit" name="TAGNAME" value="TAGVALUE">'.split('|*|');
var formElementValueRequired = 'false|*|false|*|false|*|false|*|true|*|true|*|true|*|false|*|false|*|true|*|true'.split('|*|');


var selectedelementNames = new Array();
var selectedElementValues = new Array();
var selectedElementTypes = new Array();
var selectedElementRequired = new Array();
var selectedelementIDs = new Array();

var mode = 'NA';


function checkSubmit() {
  var myForm = document.fForm;
  
  
  if (myForm.formName.value == '') {
    alert('Please enter a form name.');
    myForm.formName.focus();
    return false;
  }
  

  if (myForm.formThankYou.value == '') {
    alert('Please enter a thank you message.');
    myForm.formThankYou.focus();
    return false;
  }
  if (myForm.formErrorText.value == '') {
    alert('Please enter an error message (Text fields).');
    myForm.formErrorText.focus();
    return false;
  }
  if (myForm.formErrorOther.value == '') {
    alert('Please enter an error message (Menu, radio buttons).');
    myForm.formErrorOther.focus();
    return false;
  }

  if (myForm.fElems.length == 0) {
    alert('Please add at least one field to the form.')
    return false;
  }
  var tmp = '';var tmp2 = '';var tmp3 = '';var tmp4 = '';var tmp5 = '';
  // All ok set variables
  for (i = 0;i < selectedelementNames.length;i++) {
    tmp += selectedelementNames[i] + "|*|"
    tmp2 += selectedElementValues[i] + "|*|"
    tmp3 += selectedElementTypes[i] + "|*|"
    tmp4 += selectedElementRequired[i] + "|*|"
    tmp5 += selectedelementIDs[i] + "|*|"
  }
  
  tmp = tmp.substring(0, tmp.length-3);
  tmp2 = tmp2.substring(0, tmp2.length-3);
  tmp3 = tmp3.substring(0, tmp3.length-3);
  tmp4 = tmp4.substring(0, tmp4.length-3);
  tmp5 = tmp5.substring(0, tmp5.length-3);
  
  myForm.selectedelementNames.value = tmp;
  myForm.selectedElementValues.value = tmp2;
  myForm.selectedElementTypes.value = tmp3;
  myForm.selectedElementRequired.value = tmp4;
  myForm.selectedelementIDs.value = tmp5;
  

  return true;
}


function debugPrint() {

}


function htmlEncode(streng) {
  var result = '';
  for (i = 0; i < streng.length; i++) {
    result = result + '&#' + streng.charCodeAt(i) + ';';
  }
  return result;
}



function addElem() {
  var myForm = document.fForm;
  var selected = myForm.fElems.selectedIndex;
  // Check required values selected/entered
  
  if (myForm.fldType.selectedIndex == 0) {
    alert('Please select an element type.');
    myForm.fldType.focus();
    return;
  }
  
  if (myForm.fldName.value == '') {
    alert('Please enter a field name.');
    myForm.fldName.focus();
    return;
  }
  
  
    fldTypeLoc = returnForArrPos(myForm.fldType[myForm.fldType.selectedIndex].value)
  
  if (myForm.fldValue.value == '' && formElementValueRequired[fldTypeLoc]  == 'true') {
    alert('Please enter a field value.');
    myForm.fldValue.focus();
    return;
  }
  
  
  var arrLen = selectedelementNames.length;
  
  // Check item is unique
  if (arrLen > 0 && mode == 'add') {
    for (i = 0;i < arrLen;i++) {
      if (myForm.fldName.value == selectedelementNames[i]) {
        alert('An existing item exists with that field name,\nplease enter a new field name.');
        return;
      }
    }
  }
  
  
  if (mode == 'edit') {
     // Update existing item
    selectedelementNames[selected] = myForm.fldName.value;
    selectedElementValues[selected] = myForm.fldValue.value;
    
    selectedElementTypes[selected] = myForm.fldType[myForm.fldType.selectedIndex].value;
    if (myForm.fldReq.checked == true) {
      selectedElementRequired[selected] = true;
    } else {
      selectedElementRequired[selected] = false;
    }
    
  
    rebuildMenu()
    myForm.fElems.selectedIndex = selected;
    elemSelected();
  
  } else {
    // Add item to menu
    addOption(myForm.fElems, myForm.fldName.value, myForm.fldName.value);
  
    // Update JS vars holding info
    selectedelementNames[arrLen] = myForm.fldName.value;
    selectedElementValues[arrLen] = myForm.fldValue.value;
    selectedElementTypes[arrLen] = myForm.fldType[myForm.fldType.selectedIndex].value;
    if (myForm.fldReq.checked == true) {
      selectedElementRequired[arrLen] = true;
    } else {
      selectedElementRequired[arrLen] = false;
    }
    selectedelementIDs[arrLen] = -1;
    
    myForm.fElems.selectedIndex = myForm.fElems.length-1;
    myForm.fElems.focus();
    elemSelected();
  }
  
  // update preview
  updatePreview();
  
  debugPrint();
  
}


function replaceAll (str, str_search, str_replace) {
  if (str_search.length == 0 || str == '' || str == null) { return str; }
  var str_out = str;
  var sPos = str_out.indexOf(str_search);
  
  while (sPos >= 0) {
    str_out = str_out.substring(0, sPos) + str_replace + str_out.substring(sPos+str_search.length);
    sPos = str_out.indexOf(str_search);
  }
  return str_out;
}


function nthField(source, separator, fieldNumber) {
  var nf_array, nf_fn;
  nf_fn = fieldNumber - 1;
  if (source == '' || nf_fn < 0) {
    return '';
  } else {
    nf_array = source.split(separator);
    
    if (nf_fn <= nf_array.length) {
      return nf_array[nf_fn];
    } else {
      return '';
    }
  }
}

function countFields(source, separator) {
  var cfStartPos, cfCount, cfTemp;
  cfStartPos = 1;
  cfCount = 1;
  if (source != '') {
    do {
      cfTemp = source.indexOf(separator, cfStartPos);
      if (cfTemp > 0) { cfCount ++; }
      cfStartPos = cfTemp + 1;
    } while (source.indexOf(separator, cfStartPos) > 0);
    
  } else {
    cfCount = 0;
  }
  return cfCount;
}


function returnForArrPos(ID) {
  for (j = 0;j < formelementIDs.length;j++) {
    if (ID == formelementIDs[j]) {
      return j;
    }
  }
  return -1;
}

function addNewItem() {
  var myForm = document.fForm;

  myForm.fldType.disabled = false;
  myForm.fldName.disabled = false;
  myForm.fldValue.disabled = false;
  myForm.fldReq.disabled = false;
  myForm.btnAdd.disabled = false;
  myForm.btnAdd.value = 'Add Item';

  myForm.fElems.selectedIndex = -1;
  myForm.fldType.selectedIndex = 0;
  myForm.fldName.value = '';
  myForm.fldValue.value = '';
  myForm.fldReq.checked = false;
  
  
  mode = 'add';
  
  updatePreview();

}

function editSetup() {
  var myForm = document.fForm;
  
  if (selectedelementNames.length > 0) {
    rebuildMenu();
    updatePreview();
    debugPrint();
  }
}


function arraySwap(arr, oldPos, newPos) {
  if (oldPos < newPos) {
    sPos = oldPos;
    pos1 = newPos;
    pos2 = oldPos;
  } else {
    sPos = newPos;
    pos1 = oldPos;
    pos2 = newPos;
  }
  
  arr.splice(sPos, 2, arr[pos1], arr[pos2]);

  debugPrint();

}



function elemSelected() {
  var myForm = document.fForm;
  var selected = myForm.fElems.selectedIndex;
  var elemCount = myForm.fElems.length;
  
  
  // Enable items
  if (selected > -1) {
    myForm.fldType.disabled = false;
    myForm.btnRemove.disabled = false;
    myForm.fldReq.disabled = false;
    myForm.btnAdd.disabled = false;
    myForm.btnAdd.value = 'Update Item';
    myForm.fldName.disabled = false;
    myForm.fldValue.disabled = false;
    
  } else {
    // Selected nothing
    myForm.fldType.disabled = true;
    myForm.btnRemove.disabled = true;
    myForm.btnUp.disabled = true;
    myForm.btnDown.disabled = true;
    myForm.fldType.selectedIndex = '';
    myForm.btnAdd.disabled = true;
    myForm.fldName.disabled = true;
    myForm.fldValue.disabled = true;
    myForm.fldReq.disabled = true;
    myForm.fldName.value = '';
    myForm.fldValue.value = '';
    myForm.fldReq.checked = false;
    mode = 'NA';
    updatePreview();
    return;
  }
  
  
  // Up down buttons
  if (selected < 0 || elemCount < 2) {
    myForm.btnUp.disabled = true;
    myForm.btnDown.disabled = true;
  } else if (selected == 0) {
    myForm.btnUp.disabled = true;
    myForm.btnDown.disabled = false;
  } else if (selected == elemCount-1) {
    myForm.btnUp.disabled = false;
    myForm.btnDown.disabled = true;
  } else if (selected < elemCount) {
    myForm.btnUp.disabled = false;
    myForm.btnDown.disabled = false;
  } else {
    myForm.btnUp.disabled = true;
    myForm.btnDown.disabled = true;
  }
  
  
  // Fill in values
  
  myForm.fldType.selectedIndex = selectedElementTypes[selected];
  if (selectedElementRequired[selected] == true) {
    myForm.fldReq.checked = true;
  } else {
    myForm.fldReq.checked = false;
  }
  myForm.fldReq.checked = selectedElementRequired[selected];
  
  myForm.fldName.value = selectedelementNames[selected];
  myForm.fldValue.value = selectedElementValues[selected];
  
  mode = 'edit';
  
  updatePreview();
}


function updateDesc() {
  
  var myForm = document.fForm;
  var x = document.getElementById('elemDesc');
  x.innerHTML = '<i>' + formelementDescriptions[returnForArrPos(myForm.fldType[myForm.fldType.selectedIndex].value)] + '\</i>';
  
}


function removeItem() {
  var myForm = document.fForm;
  var selected = myForm.fElems.selectedIndex;
  
  selectedelementNames = removeElement(selectedelementNames, selected);
  selectedElementValues = removeElement(selectedElementValues, selected);
  selectedElementTypes = removeElement(selectedElementTypes, selected);
  selectedElementRequired = removeElement(selectedElementRequired, selected);
  
  if (selectedelementIDs[selected] != -1) { myForm.deletedFormElements.value += ',' + selectedelementIDs[selected]; }
  
  selectedelementIDs = removeElement(selectedelementIDs, selected);

  rebuildMenu()
  elemSelected();

  updatePreview();
  debugPrint();
}

function moveOptionUp() {
  var myForm = document.fForm;
  var selected = myForm.fElems.selectedIndex;
  
  if (selected > 0) {
    arraySwap(selectedelementNames, selected, selected-1);
    arraySwap(selectedElementValues, selected, selected-1);
    arraySwap(selectedElementTypes, selected, selected-1);
    arraySwap(selectedElementRequired, selected, selected-1);
    arraySwap(selectedelementIDs, selected, selected-1);
    
    rebuildMenu()
    
    myForm.fElems.selectedIndex = selected-1;
    elemSelected();
    
    updatePreview();
  }
}

function moveOptionDown() {
  var myForm = document.fForm;
  var selected = myForm.fElems.selectedIndex;
  
  if (selected < myForm.fElems.length) {
    arraySwap(selectedelementNames, selected, selected+1);
    arraySwap(selectedElementValues, selected, selected+1);
    arraySwap(selectedElementTypes, selected, selected+1);
    arraySwap(selectedElementRequired, selected, selected+1);
    arraySwap(selectedelementIDs, selected, selected+1);

    rebuildMenu(selected, selected+1);
    
    myForm.fElems.selectedIndex = selected+1;
    elemSelected();
    
    updatePreview();
  }
}


function rebuildMenu() {

  var myForm = document.fForm;
  
  myForm.fElems.options.length = 0;
  
  for (i = 0;i < selectedelementNames.length;i++) {
    addOption(myForm.fElems, selectedelementNames[i], selectedelementNames[i]);
  }
}


function updatePreview() {
  var myForm = document.fForm;
  var oHTML = '';
  var tmpHTML = '';
  var tmpHTML2 = '';
  var closeRow = false;
  
  if (myForm.formDescription.value != '') {
    oHTML += '<tr><td colspan="2" align="left">' + myForm.formDescription.value + '</td></tr>';
  }
  
  for (i = 0;i < selectedelementNames.length;i++) {
  
    if (selectedElementTypes[i] == '10' || selectedElementTypes[i] == '11') {
      if (closeRow == false) { oHTML += '<tr><td colspan="2" align="right">'; }
  
    } else {
      if (closeRow == true) {
        oHTML += '</td></tr>';
        closeRow = false;
      }
       if (myForm.fElems.selectedIndex == i) {
          oHTML += '<tr style="background-color: #FFCCCC;">';
        } else {
          oHTML += '<tr>';
        }
        oHTML += '<td><strong>' + selectedelementNames[i] + '</strong></td><td>'
   }
    
    
    
    // Match typeID to find html
    tmpHTML = formelementTags[returnForArrPos(selectedElementTypes[i])];
    tmpHTML2 = '';tmpHTML3 = '';
    
    // Clean up tag
    if (selectedElementTypes[i] == '12') {
      if (selectedElementValues[i] !== '') {
        tmpHTML = replaceAll(tmpHTML, '<legend>TAGVALUE</legend>', '');
      } else {
        tmpHTML = replaceAll(tmpHTML, 'TAGVALUE', selectedElementValues[i]);
      }
    
    } else if (selectedElementTypes[i] == '5' || selectedElementTypes[i] == '6') {
      // Loop thru values adding radio button/checkbox items
      for (j = 1;j <= countFields(selectedElementValues[i], '||'); j++) {
        tmpHTML2 = replaceAll(tmpHTML, 'TAGNAME', selectedelementNames[i]);
        tmpHTML2 = replaceAll(tmpHTML2, 'TAGVALUE', nthField(selectedElementValues[i], '||', j));
        tmpHTML3 += tmpHTML2 + nthField(selectedElementValues[i], '||', j) + ' &nbsp; ';
      }
      tmpHTML = tmpHTML3;
      
    } else if (selectedElementTypes[i] == '7') {
      // Loop thru values adding select menu items
      for (j = 1;j <= countFields(selectedElementValues[i], '||'); j++) {
        tmpHTML2 = replaceAll('<option value="TAGVALUE">TAGVALUE</option>', 'TAGVALUE', nthField(selectedElementValues[i], '||', j));
        tmpHTML3 += tmpHTML2;
      }
      tmpHTML = replaceAll(tmpHTML, '**MENU**', tmpHTML3);
    
     } else if (selectedElementTypes[i] == '10' || selectedElementTypes[i] == '11') {
       tmpHTML = replaceAll(tmpHTML, 'TAGVALUE', selectedElementValues[i]);
       // fix submit/cancel with button so form can't be submitted
       tmpHTML = replaceAll(tmpHTML, 'type="submit"', 'type="button"');
       tmpHTML = replaceAll(tmpHTML, 'onClick', 'oc');
       closeRow = true;
    
    } else {
      tmpHTML = replaceAll(tmpHTML, 'TAGVALUE', selectedElementValues[i]);
    }
    
    if (selectedElementRequired[i] == true) { tmpHTML += '<font color=red>*</font>'; }
    
    
    oHTML += tmpHTML
    if (closeRow != true) { oHTML += '\</td>\</tr>'; }
  }

  var x = document.getElementById('fPrev');
  x.innerHTML = '<table cellpadding="5">' + oHTML + '\</table>';

}


function fWiz(a1, a2, a3, a4, a5, fn, pt, ph, fd) {
  var myForm = document.fForm;
  selectedelementNames = a1.split(",");
  selectedElementValues = a2.split(",");
  selectedElementTypes = a3.split(",");
  selectedElementRequired = a4.split(",");
  selectedelementIDs = a5.split(",");
  
  myForm.formName.value = fn;
  myForm.pageTitle.value = myForm.pageTitle.value + pt;
  myForm.pageHeading.value = ph;
  myForm.formDescription.value = fd;
}

//-->







//TAB PANE
function hasSupport() {

	if (typeof hasSupport.support != "undefined")
		return hasSupport.support;
	
	var ie55 = /msie 5\.[56789]/i.test( navigator.userAgent );
	
	hasSupport.support = ( typeof document.implementation != "undefined" &&
			document.implementation.hasFeature( "html", "1.0" ) || ie55 )
			
	// IE55 has a serious DOM1 bug... Patch it!
	if ( ie55 ) {
		document._getElementsByTagName = document.getElementsByTagName;
		document.getElementsByTagName = function ( sTagName ) {
			if ( sTagName == "*" )
				return document.all;
			else
				return document._getElementsByTagName( sTagName );
		};
	}

	return hasSupport.support;
}

///////////////////////////////////////////////////////////////////////////////////
// The constructor for tab panes
//
// el : HTMLElement		The html element used to represent the tab pane
// bUseCookie : Boolean	Optional. Default is true. Used to determine whether to us
//						persistance using cookies or not
//
function WebFXTabPane( el, bUseCookie ) {
	if ( !hasSupport() || el == null ) return;
	
	this.element = el;
	this.element.tabPane = this;
	this.pages = [];
	this.selectedIndex = null;
	this.useCookie = bUseCookie != null ? bUseCookie : null;
	
	// add class name tag to class name
	this.element.className = this.classNameTag + " " + this.element.className;
	
	// add tab row
	this.tabRow = document.createElement( "div" );
	this.tabRow.className = "tab-row";
	el.insertBefore( this.tabRow, el.firstChild );

	var tabIndex = 0;
	if ( this.useCookie ) {
		tabIndex = Number( WebFXTabPane.getCookie( "webfxtab_" + this.element.id ) );
		if ( isNaN( tabIndex ) )
			tabIndex = 0;
	}
	this.selectedIndex = tabIndex;
	
	// loop through child nodes and add them
	var cs = el.childNodes;
	var n;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].nodeType == 1 && cs[i].className == "tab-page") {
			this.addTabPage( cs[i] );
		}
	}
}

WebFXTabPane.prototype.classNameTag = "dynamic-tab-pane-control";

WebFXTabPane.prototype.setSelectedIndex = function ( n ) {
	if (this.selectedIndex != n) {
		if (this.selectedIndex != null && this.pages[ this.selectedIndex ] != null )
			this.pages[ this.selectedIndex ].hide();
		this.selectedIndex = n;
		this.pages[ this.selectedIndex ].show();
		
		if ( this.useCookie )
			WebFXTabPane.setCookie( "webfxtab_" + this.element.id, n );	// session cookie
	}
};
	
WebFXTabPane.prototype.getSelectedIndex = function () {
	return this.selectedIndex;
};
	
WebFXTabPane.prototype.addTabPage = function ( oElement ) {
	if ( !hasSupport() ) return;
	
	if ( oElement.tabPage == this )	// already added
		return oElement.tabPage;

	var n = this.pages.length;
	var tp = this.pages[n] = new WebFXTabPage( oElement, this, n );
	tp.tabPane = this;
	
	// move the tab out of the box
	this.tabRow.appendChild( tp.tab );
			
	if ( n == this.selectedIndex )
		tp.show();
	else
		tp.hide();
		
	return tp;
};
	
WebFXTabPane.prototype.dispose = function () {
	this.element.tabPane = null;
	this.element = null;		
	this.tabRow = null;
	
	for (var i = 0; i < this.pages.length; i++) {
		this.pages[i].dispose();
		this.pages[i] = null;
	}
	this.pages = null;
};



// Cookie handling
WebFXTabPane.setCookie = function ( sName, sValue, nDays ) {
	var expires = "";
	if ( nDays ) {
		var d = new Date();
		d.setTime( d.getTime() + nDays * 24 * 60 * 60 * 1000 );
		expires = "; expires=" + d.toGMTString();
	}

	document.cookie = sName + "=" + sValue + expires + "; path=/";
};

WebFXTabPane.getCookie = function (sName) {
	var re = new RegExp( "(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)" );
	var res = re.exec( document.cookie );
	return res != null ? res[3] : null;
};

WebFXTabPane.removeCookie = function ( name ) {
	setCookie( name, "", -1 );
};








///////////////////////////////////////////////////////////////////////////////////
// The constructor for tab pages. This one should not be used.
// Use WebFXTabPage.addTabPage instead
//
// el : HTMLElement			The html element used to represent the tab pane
// tabPane : WebFXTabPane	The parent tab pane
// nindex :	Number			The index of the page in the parent pane page array
//
function WebFXTabPage( el, tabPane, nIndex ) {
	if ( !hasSupport() || el == null ) return;
	
	this.element = el;
	this.element.tabPage = this;
	this.index = nIndex;
	
	var cs = el.childNodes;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].nodeType == 1 && cs[i].className == "tab") {
			this.tab = cs[i];
			break;
		}
	}
	
	// insert a tag around content to support keyboard navigation
	
	
	var a = document.createElement( "A" );
	this.aElement = a;
	a.href = "#";
	a.onclick = function () { return false; };
	while ( this.tab.hasChildNodes() )
		a.appendChild( this.tab.firstChild );
	this.tab.appendChild( a );

	
	// hook up events, using DOM0
	var oThis = this;
	this.tab.onclick = function () { oThis.select(); };
	this.tab.onmouseover = function () { WebFXTabPage.tabOver( oThis ); };
	this.tab.onmouseout = function () { WebFXTabPage.tabOut( oThis ); };
}

WebFXTabPage.prototype.show = function () {
	var el = this.tab;
	var s = el.className + " selected";
	s = s.replace(/ +/g, " ");
	el.className = s;
	
	this.element.style.display = "block";
};

WebFXTabPage.prototype.hide = function () {
	var el = this.tab;
	var s = el.className;
	s = s.replace(/ selected/g, "");
	el.className = s;

	this.element.style.display = "none";
};
	
WebFXTabPage.prototype.select = function () {
	this.tabPane.setSelectedIndex( this.index );
};
	
WebFXTabPage.prototype.dispose = function () {
	this.aElement.onclick = null;
	this.aElement = null;
	this.element.tabPage = null;
	this.tab.onclick = null;
	this.tab.onmouseover = null;
	this.tab.onmouseout = null;
	this.tab = null;
	this.tabPane = null;
	this.element = null;
};

WebFXTabPage.tabOver = function ( tabpage ) {
	var el = tabpage.tab;
	var s = el.className + " hover";
	s = s.replace(/ +/g, " ");
	el.className = s;
};

WebFXTabPage.tabOut = function ( tabpage ) {
	var el = tabpage.tab;
	var s = el.className;
	s = s.replace(/ hover/g, "");
	el.className = s;
};


// This function initializes all uninitialized tab panes and tab pages
function setupAllTabs() {
	if ( !hasSupport() ) return;

	var all = document.getElementsByTagName( "*" );
	var l = all.length;
	var tabPaneRe = /tab\-pane/;
	var tabPageRe = /tab\-page/;
	var cn, el;
	var parentTabPane;
	
	for ( var i = 0; i < l; i++ ) {
		el = all[i]
		cn = el.className;

		// no className
		if ( cn == "" ) continue;
		
		// uninitiated tab pane
		if ( tabPaneRe.test( cn ) && !el.tabPane )
			new WebFXTabPane( el );
	
		// unitiated tab page wit a valid tab pane parent
		else if ( tabPageRe.test( cn ) && !el.tabPage &&
					tabPaneRe.test( el.parentNode.className ) ) {
			el.parentNode.tabPane.addTabPage( el );			
		}
	}
}

function disposeAllTabs() {
	if ( !hasSupport() ) return;
	
	var all = document.getElementsByTagName( "*" );
	var l = all.length;
	var tabPaneRe = /tab\-pane/;
	var cn, el;
	var tabPanes = [];
	
	for ( var i = 0; i < l; i++ ) {
		el = all[i]
		cn = el.className;

		// no className
		if ( cn == "" ) continue;
		
		// tab pane
		if ( tabPaneRe.test( cn ) && el.tabPane )
			tabPanes[tabPanes.length] = el.tabPane;
	}
	
	for (var i = tabPanes.length - 1; i >= 0; i--) {
		tabPanes[i].dispose();
		tabPanes[i] = null;
	}
}


// initialization hook up

// DOM2
if ( typeof window.addEventListener != "undefined" )
	window.addEventListener( "load", setupAllTabs, false );

// IE 
else if ( typeof window.attachEvent != "undefined" ) {
	window.attachEvent( "onload", setupAllTabs );
	window.attachEvent( "onunload", disposeAllTabs );
}

else {
	if ( window.onload != null ) {
		var oldOnload = window.onload;
		window.onload = function ( e ) {
			oldOnload( e );
			setupAllTabs();
		};
	}
	else 
		window.onload = setupAllTabs;
}
// ------------------
// ------------------
// ------------------ TAB OVER
// ------------------
// ------------------




// ------------------
// ------------------
// ------------------ DHTML MENU START
// ------------------
// ------------------
function DropMenu(oName)
	{
	this.oName=oName;
	this.arrMenus=[];	
	this.showMenu=showMenu;
	this.showMenu2=showMenu2;
	this.hideMenuAll=hideMenuAll;
	this.renderType;
	this.renderHorizontal=renderHorizontal;
	this.renderVertical=renderVertical;
	this.mouseOut=mouseOut;
	this.mouseOver=mouseOver;
	}
	
function renderHorizontal()
	{
	this.renderType="horizontal";
	document.write("<table align='"+this.align+"' cellpadding=0 cellspacing=0 style='border-collapse:collapse;'><tr>");
	for(var i=0;i<this.arrMenus.length;i++)
		{
		//render top menu
		if(this.arrMenus[i][1]=="0")
			{
			document.write("<td style='border:"+this.styleBorder+";'>");
			
			var linkId="sc_link_"+this.oName+this.arrMenus[i][0];
			document.write("<table height='"+this.height+"' width='"+this.width+"' border=0 cellpadding=0 cellspacing=0><tr><td id=\"divLabel"+this.oName+this.arrMenus[i][0]+"\" style='background:"+this.styleBg+";cursor:pointer;padding-left:"+this.stylePaddingLeft+";padding-right:"+this.stylePaddingRight+";padding-top:"+this.stylePaddingTop+";padding-bottom:"+this.stylePaddingBottom+";font-family:"+this.styleFontFamily+";font-weight:"+this.styleFontWeight+";font-size:"+this.styleFontSize+";color:"+this.styleColor+";' onclick=\"openLink('"+linkId+"')\" onmouseout=\""+this.oName+".mouseOut(this.id,'no');\" onmouseover=\""+this.oName+".mouseOver(this.id,'no');this.style.backgroundImage='url("+this.styleBgImgOver+")';return !"+this.oName+".showMenu(this,'divMenu"+this.oName+this.arrMenus[i][0]+"',event)\" nowrap>");
			document.write(this.arrMenus[i][2]);			
			document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[i][3]+"\"></a>")
			document.write("</td></tr></table>");
			
			//~~~~~~~~~~~~~~
			var nParent=this.arrMenus[i][0];
			
			document.write("<span id='divMenu"+this.oName+nParent+"' style='visibility:hidden;position:absolute;' onmouseover='event.cancelBubble=true;'>");
			document.write("<table height='"+this.Subheight+"' width='"+this.Subwidth+"' cellpadding=0 cellspacing=0>");
			var nmCount=0;
			for(var j=0;j<this.arrMenus.length;j++)
				{				
				if(this.arrMenus[j][1]==nParent)
					{
					var sAlign="";if(this.Subalign=="right")sAlign="align=right";
					var sTopBorder="";if(nmCount>0)sTopBorder="border-top:none;";nmCount++;
					var linkId="sc_link_"+this.oName+this.arrMenus[j][0];
					document.write("<tr><td "+sAlign+" nowrap id=\"divLabel"+this.oName+this.arrMenus[j][0]+"\" style='background:"+this.SubstyleBg+";border:"+this.SubstyleBorder+";"+sTopBorder+"cursor:pointer;padding-left:"+this.SubstylePaddingLeft+";padding-right:"+this.SubstylePaddingRight+";padding-top:"+this.SubstylePaddingTop+";padding-bottom:"+this.SubstylePaddingBottom+";font-family:"+this.SubstyleFontFamily+";font-weight:"+this.SubstyleFontWeight+";font-size:"+this.SubstyleFontSize+";color:"+this.SubstyleColor+";' onclick=\"openLink('"+linkId+"')\" onmouseout=\""+this.oName+".mouseOut(this.id,'yes');\" onmouseover=\""+this.oName+".mouseOver(this.id,'yes');this.style.backgroundImage='url("+this.SubstyleBgImgOver+")';return !"+this.oName+".showMenu2('divMenu"+this.oName+nParent+"',this,'divMenu"+this.oName+this.arrMenus[j][0]+"',event)\">");				
					document.write(this.arrMenus[j][2]);					
					document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[j][3]+"\"></a>")

					
					//~~~~~~~~~~~~~~
					var nParent2=this.arrMenus[j][0];
					
					document.write("<span id='divMenu"+this.oName+nParent2+"' style='visibility:hidden;position:absolute;' onmouseover='event.cancelBubble=true;'>");
					document.write("<table cellpadding=0 cellspacing=0>");
					for(var k=0;k<this.arrMenus.length;k++)
						{
						if(this.arrMenus[k][1]==nParent2)
							{
							var sAlign="";
							if(this.align=="right")sAlign="align=right";
							var linkId="sc_link_"+this.oName+this.arrMenus[k][0];
							document.write("<tr><td "+sAlign+" nowrap id=\"divLabel"+this.oName+this.arrMenus[k][0]+"\" style='background:"+this.SubstyleBg+";border:"+this.SubstyleBorder+";cursor:pointer;padding-left:"+this.SubstylePaddingLeft+";padding-right:"+this.SubstylePaddingRight+";padding-top:"+this.SubstylePaddingTop+";padding-bottom:"+this.SubstylePaddingBottom+";font-family:"+this.SubstyleFontFamily+";font-weight:"+this.SubstyleFontWeight+";font-size:"+this.SubstyleFontSize+";color:"+this.SubstyleColor+";' onclick=\"openLink('"+linkId+"');event.cancelBubble=true;\" onmouseout=\""+this.oName+".mouseOut(this.id,'yes');\" onmouseover=\""+this.oName+".mouseOver(this.id,'yes');\" >");
							document.write(this.arrMenus[k][2]);							
							document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[k][3]+"\"></a>")
							document.write("</td></tr>");
							}			
						}
					document.write("</table>")
					document.write("</span>");
					//~~~~~~~~~~~~~~					
					
					document.write("</td></tr>");		
					}			
				}
			document.write("</table>");				
			document.write("</span>");
			//~~~~~~~~~~~~~~
				
			document.write("</td>");
			}
		}
	document.write("</tr></table>");
	}

function renderVertical()
	{
	this.renderType="vertical";
	document.write("<table align='"+this.align+"' cellpadding=0 cellspacing=0 style='border-collapse:collapse;'>");
	for(var i=0;i<this.arrMenus.length;i++)
		{
		//render top menu
		if(this.arrMenus[i][1]=="0")
			{
			document.write("<tr><td style='border:"+this.styleBorder+";'>");
			
			var linkId="sc_link_"+this.oName+this.arrMenus[i][0];
			document.write("<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td id=\"divLabel"+this.oName+this.arrMenus[i][0]+"\" style='background:"+this.styleBg+";cursor:pointer;padding-left:"+this.stylePaddingLeft+";padding-right:"+this.stylePaddingRight+";padding-top:"+this.stylePaddingTop+";padding-bottom:"+this.stylePaddingBottom+";font-family:"+this.styleFontFamily+";font-weight:"+this.styleFontWeight+";font-size:"+this.styleFontSize+";color:"+this.styleColor+";' onclick=\"openLink('"+linkId+"')\" onmouseout=\""+this.oName+".mouseOut(this.id);\" onmouseover=\""+this.oName+".mouseOver(this.id);return !"+this.oName+".showMenu(this,'divMenu"+this.oName+this.arrMenus[i][0]+"',event)\" nowrap>");
			document.write(this.arrMenus[i][2]);
			document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[i][3]+"\"></a>")
			document.write("</td></tr></table>");
			
			//~~~~~~~~~~~~~~
			var nParent=this.arrMenus[i][0];
			
			document.write("<span id='divMenu"+this.oName+nParent+"' style='visibility:hidden;position:absolute;' onmouseover='event.cancelBubble=true;'>");
			document.write("<table cellpadding=0 cellspacing=0><tr><td></td></tr>");
			var nmCount=0;
			for(var j=0;j<this.arrMenus.length;j++)
				{				
				if(this.arrMenus[j][1]==nParent)
					{
					var sAlign="";if(this.align=="right")sAlign="align=right";
					var sTopBorder="";if(nmCount>0)sTopBorder="border-top:none;";nmCount++;
					var linkId="sc_link_"+this.oName+this.arrMenus[j][0];
					document.write("<tr><td "+sAlign+" nowrap id=\"divLabel"+this.oName+this.arrMenus[j][0]+"\" style='background:"+this.styleBg+";border:"+this.styleBorder+";"+sTopBorder+"cursor:pointer;padding-left:"+this.stylePaddingLeft+";padding-right:"+this.stylePaddingRight+";padding-top:"+this.stylePaddingTop+";padding-bottom:"+this.stylePaddingBottom+";font-family:"+this.styleFontFamily+";font-weight:"+this.styleFontWeight+";font-size:"+this.styleFontSize+";color:"+this.styleColor+";' onmouseout=\""+this.oName+".mouseOut(this.id);\" onclick=\"openLink('"+linkId+"')\" onmouseover=\""+this.oName+".mouseOver(this.id);return !"+this.oName+".showMenu2('divMenu"+this.oName+nParent+"',this,'divMenu"+this.oName+this.arrMenus[j][0]+"',event)\">");				
					document.write(this.arrMenus[j][2]);					
					document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[j][3]+"\"></a>")

					
					//~~~~~~~~~~~~~~
					var nParent2=this.arrMenus[j][0];
					
					document.write("<span id='divMenu"+this.oName+nParent2+"' style='visibility:hidden;position:absolute;' onmouseover='event.cancelBubble=true;'>");
					document.write("<table cellpadding=0 cellspacing=0><tr><td></td></tr>");
					var bTop=true;
					for(var k=0;k<this.arrMenus.length;k++)
						{
						if(this.arrMenus[k][1]==nParent2)
							{
							if(bTop)
								{
								bTop=false;
								
								var sAlign="";
								if(this.align=="right")sAlign="align=right";
								var linkId="sc_link_"+this.oName+this.arrMenus[k][0];
								document.write("<tr><td "+sAlign+" nowrap id=\"divLabel"+this.oName+this.arrMenus[k][0]+"\" style='background:"+this.styleBg+";border:"+this.styleBorder+";cursor:pointer;padding-left:"+this.stylePaddingLeft+";padding-right:"+this.stylePaddingRight+";padding-top:"+this.stylePaddingTop+";padding-bottom:"+this.stylePaddingBottom+";font-family:"+this.styleFontFamily+";font-weight:"+this.styleFontWeight+";font-size:"+this.styleFontSize+";color:"+this.styleColor+";' onclick=\"openLink('"+linkId+"');event.cancelBubble=true;\" onmouseout=\""+this.oName+".mouseOut(this.id);\" onmouseover=\""+this.oName+".mouseOver(this.id);\" >");
								document.write(this.arrMenus[k][2]);							
								document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[k][3]+"\"></a>")
								document.write("</td></tr>");
								}
							else
								{//border-top:none
								var sAlign="";
								if(this.align=="right")sAlign="align=right";
								var linkId="sc_link_"+this.oName+this.arrMenus[k][0];
								document.write("<tr><td "+sAlign+" nowrap id=\"divLabel"+this.oName+this.arrMenus[k][0]+"\" style='background:"+this.styleBg+";border:"+this.styleBorder+";border-top:none;cursor:pointer;padding-left:"+this.stylePaddingLeft+";padding-right:"+this.stylePaddingRight+";padding-top:"+this.stylePaddingTop+";padding-bottom:"+this.stylePaddingBottom+";font-family:"+this.styleFontFamily+";font-weight:"+this.styleFontWeight+";font-size:"+this.styleFontSize+";color:"+this.styleColor+";' onclick=\"openLink('"+linkId+"');event.cancelBubble=true;\" onmouseout=\""+this.oName+".mouseOut(this.id);\" onmouseover=\""+this.oName+".mouseOver(this.id);\" >");
								document.write(this.arrMenus[k][2]);							
								document.write("<a id=\""+linkId+"\" href=\""+this.arrMenus[k][3]+"\"></a>")
								document.write("</td></tr>");
								}
							}			
						}
					document.write("</table>")
					document.write("</span>");
					//~~~~~~~~~~~~~~					
					
					document.write("</td></tr>");		
					}			
				}
			document.write("</table>");				
			document.write("</span>");
			//~~~~~~~~~~~~~~
				
			document.write("</td></tr>");
			}
		}
	document.write("</table>");
	}

function objStyle(idName)
	{
	if(document.getElementById && document.getElementById(idName))
		return document.getElementById(idName).style;
	else if(document.all && document.all(idName))
		return document(idName).style;
	else if(document.layers && document.layers(idName))//not used
		return document.layers(idName);
	else return false;
	}

function showMenu(oEl,idMenu,evt)
	{
	document.onmouseover=new Function(this.oName+".hideMenuAll()");
	
	var oMenuStyle=objStyle(idMenu);
	if(this.renderType=="horizontal")
		{
		oMenuStyle.top = getTop(oEl.id)+oEl.offsetHeight;
		if(this.align=="left") oMenuStyle.left = getLeft(oEl.id);
		else oMenuStyle.left = getLeft(oEl.id)+getWidth(oEl.id)-getWidth(idMenu)+2;//+2 => adjustment
		}
	else
		{//vertical
		oMenuStyle.top = getTop(oEl.id)+4;//+4 => adjustment
		if(this.align=="left")oMenuStyle.left=getLeft(oEl.id)+getWidth(oEl.id);
		else oMenuStyle.left=getLeft(oEl.id)-getWidth(idMenu)+4;//+4 => adjustment
		}
	this.hideMenuAll();
	evt.cancelBubble=true;
	var oMenuStyle=objStyle(idMenu);
	if(oMenuStyle) 
		{
		oMenuStyle.visibility="visible";
		return true;
		}
	else return false;
	}
	
var sActiveSubMenu=null;
function showMenu2(oElParent,oEl,idMenu,evt)
	{
	document.onmouseover=new Function(this.oName+".hideMenuAll()");
	
	var oMenuStyle=objStyle(idMenu);
	oMenuStyle.top = getTop(oEl.id)-getTop(oElParent)+4;//+4 => adjustment
	if(this.align=="left") oMenuStyle.left=getWidth(oElParent)-4;//+4 => adjustment
	else
		{
		oMenuStyle.left=-getWidth(idMenu)+4;//+4 => adjustment
		oMenuStyle.left=-getWidth(idMenu)+4;//+4 => adjustment
		}
	
	if(sActiveSubMenu!=idMenu)
		{
		if(sActiveSubMenu)
			{
			var oMenuStyle=objStyle(sActiveSubMenu)
			oMenuStyle.visibility="hidden";
			}
		sActiveSubMenu=idMenu
		}

	evt.cancelBubble=true;
	var oMenuStyle=objStyle(idMenu)
	if(oMenuStyle) 
		{
		oMenuStyle.visibility="visible";
		return true;
		}
	else return false;
	}

function hideMenuAll()
	{
	for(var i=0;i<this.arrMenus.length;i++)
		{
		var id=this.arrMenus[i][0]
		var oMenuStyle=objStyle("divMenu"+this.oName+id)
		if(oMenuStyle) oMenuStyle.visibility="hidden";
		}
	}
function getWidth(idEl)
	{
	if(document.all && document.all(idEl))
		return document.all(idEl).offsetWidth;
	else if(document.getElementById && document.getElementById(idEl))
		return  document.getElementById(idEl).offsetWidth;
	else return false;
	}
function getLeft(idEl) 
	{
	if(document.all && document.all(idEl))
		{//IE
		var oEl=document.all(idEl);
		var oElTmp=oEl;
		var nLeft=0;
		while(oElTmp!=null)
			{
			nLeft+=oElTmp["offsetLeft"]
			oElTmp=oElTmp.offsetParent
			}
		return nLeft;
		}
	else if(document.getElementById && document.getElementById(idEl))
		{//Nets & IE
		var oElTmp = document.getElementById(idEl);
		var nLeft=0;
		while(oElTmp!=null)
			{
			nLeft+=oElTmp["offsetLeft"]
			oElTmp=oElTmp.offsetParent
			}
		return nLeft-1;// -1 => adjustment
		}
	else if(document.layers && document.layers(idEl)) return document.layers(idEl).pageX;//not used
	else return false;
	}

function getTop(idEl) 
	{
	if(document.all && document.all(idEl))
		{
		var oEl=document.all(idEl);
		var oElTmp=oEl;
		var nTop=0;
		while(oElTmp!=null)
			{
			nTop+=oElTmp["offsetTop"]
			oElTmp=oElTmp.offsetParent
			}
		return nTop+1;// +1 => adjustment
		}
	else if(document.getElementById && document.getElementById(idEl))
		{
		var oElTmp = document.getElementById(idEl);
		var nTop=0;
		while(oElTmp!=null)
			{
			nTop+=oElTmp["offsetTop"]
			oElTmp=oElTmp.offsetParent
			}
		return nTop;
		}	 
	else if(document.layers && document.layers(idEl)) return document.layers(idEl).pageY;//not used
	else return false;
	}

function mouseOver(idEl,var1)
	{
	var oElStyle=objStyle(idEl); 
		switch(var1){
		case 'no':
//	oElStyle.backgroundImage=this.styleBgImgOver;
	oElStyle.background=this.styleBgOver;
	oElStyle.color=this.styleColorOver;
		break
		case 'yes':
//	oElStyle.backgroundImage=this.SubstyleBgImgOver;
	oElStyle.background=this.SubstyleBgOver;
	oElStyle.color=this.SubstyleColorOver;
		break
		}
	}
function mouseOut(idEl,var1)
	{
	var oElStyle=objStyle(idEl); 
		switch(var1){
		case 'no':
//	oElStyle.backgroundImage=this.styleBgImg;
	oElStyle.background=this.styleBg;
	oElStyle.color=this.styleColor;
		break
		case 'yes':
//	oElStyle.backgroundImage=this.SubstyleBgImg;
	oElStyle.background=this.SubstyleBg;
	oElStyle.color=this.SubstyleColor;
		break
		}
	}
function openLink(id)
	{
	if(document.all && document.all(id))
		oEl=document.all(id);
	else if(document.getElementById && document.getElementById(id))
		oEl=document.getElementById(id);
	else oEl=null;
	if(oEl) 
		{
		window.location.href=oEl.href;
		}
	}
// ------------------
// ------------------
// ------------------ DHTML MENU OVER
// ------------------
// ------------------




// ------------------
// ------------------
// ------------------ HELP - SOUL TYPE
// ------------------
// ------------------
var divname="soultip";
var divInnername="soultipinner";
var fixed=false;
var soultip="<div id='soultip'><div id='soultipinner'></div></div><link href='/soultip.css' rel='stylesheet' type='text/css' />"
var CoordLeft=10;
var CoordRight=-15;
var hiddenTags = new Array();
function fm_MXY(XorY){ // Mouse Coords
	var coord = 0;
	XorY=="x"?coord = event.clientX + document.body.scrollLeft:coord = event.clientY + document.body.scrollTop;
	if(coord<0)coord=0;
	return coord;
}
function fm_help(){ // Show-Hide 
	var NewCoordLeft=0,NewCoordRight=0; 
	var d=document;
	var thisObj = d.getElementById(divname); // findObj
	var browserwidth=document.body.clientWidth; // Browser sizes - Positions
	var browserheight=document.body.clientHeight+document.body.scrollTop+25;
	var soulwidth=thisObj.offfsetWidth+10, soulheight=thisObj.offfsetHeight+10; // Soultip sizes

	var activeObj=window.event.srcElement; // Active Object
	var desc=activeObj.help; //help tag
	
	if(desc!=null){	//If object help tag exist
		var x = fm_MXY("x"), y = fm_MXY("y");
		if(document.alldesc==desc){	//If fixed
			NewCoordLeft=activeObj.offfsetLeft+activeObj.offfsetWidth-x;
			NewCoordRight=activeObj.offfsetTop-y;
		}

		NewCoordLeft+=(x+soulwidth>browserwidth)?-soulwidth:CoordLeft; //idea by Yusuf Uğur Soysal - hayalet
		NewCoordRight+=(y+soulheight>browserheight)?-soulheight:CoordRight;

		thisObj.style.left=x+NewCoordLeft+"px"; //Move X 
		thisObj.style.top=y+NewCoordRight+"px"; //Move Y

		fm_writehelp(desc); //print output
		hy_collusion(thisObj); //Hide SelectBoxes by hayalet
		
		if(fixed)document.alldesc=desc; //cache for fixed
	
	}else{
		hy_collusionRecover(); //Recover Selects by hayalet
		thisObj.style.display="none";
	}
}
function fm_writehelp(val){ // Write Tip
	var d=document;
	var thisObj = d.getElementById(divname);
	var innerObj = d.getElementById(divInnername);
	innerObj.innerHTML=val;
	thisObj.style.display="block";	
}
function hy_collusion(obj){ // Hide Selectboxes by Yusuf Uğur Soysal - hayalet
	var offfsetLeft   = obj.offfsetLeft;
	var offfsetTop    = obj.offfsetTop;
	var offfsetWidth  = obj.offfsetWidth;
	var offfsetHeight = obj.offfsetHeight;
	
	var topLeftX     = offfsetLeft;
	var topLeftY     = offfsetTop;
	var bottomRightX = offfsetLeft + offfsetWidth;
	var bottomRightY = offfsetTop  + offfsetHeight;
	var hyl = 0;
	
	if(document.getElementsByTagName){
		var selectTags = document.getElementsByTagName("select");
		
		for( ; hyl < selectTags.length; hyl++){
			var tag = selectTags[hyl];											
			var x1 = tag.offfsetLeft;
			var y1 = tag.offfsetTop;
			var x2 = x1 + tag.offfsetWidth;
			var y2 = y1 + tag.offfsetHeight;
			
			if( ((topLeftX < x1 && x1 < bottomRightX) || (topLeftX < x2 && x2 < bottomRightX)) &&
				((topLeftY < y1 && y1 < bottomRightY) || (topLeftY < y2 && y2 < bottomRightY)) ) {
			
				tag.style.visibility = "hidden";
				hiddenTags[ hiddenTags.length ] = tag;			
			}	
			else
				tag.style.visibility = "visible";
		}		
	}
}
function hy_collusionRecover(){// Hide Selectboxes by Yusuf Uğur Soysal - hayalet
	var hyl = 0;
	
	for( ; hyl<hiddenTags.length; hyl++)
		hiddenTags[hyl].style.visibility = "visible";
}
if(document.all){ //Hide from other browsers
	document.write(soultip);
	document.onmousemove=fm_help;
}
// ------------------
// ------------------
// ------------------ HELP - SOUL TYPE OVER
// ------------------
// ------------------



//Linke Yonlendirme
function ds(var1,var2,var3,var4) {
  document.all.ds_left_title.innerText = var1;
  document.all.ds_right_title.innerText = var2;
  ds_left.location.href = var3;
  ds_right.location.href = var4;
}

function ds0(var1) {
  document.all.ds_right_title.innerText = var1;
}


function ds2(var1,var2) {
  document.all.ds_right_title.innerText = var1;
  ds_right.location.href = var2;
}


//Linke Yonlendirme
function ds3(var1,var2) {
	switch(var2){
	case '1':
	  window.parent.document.all.ds_right_title.innerText = 'Anket Bilgilerini Göster';
	  window.location.href = 'poll-form.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '2':
	  window.parent.document.all.ds_right_title.innerText = 'Duyuru Bilgilerini Göster';
	  window.location.href = 'news-form.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '3':
	  window.parent.document.all.ds_right_title.innerText = 'Yollanmış Maili Göster';
	  window.location.href = 'newsletter-form.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '4':
	  window.parent.document.all.ds_right_title.innerText = 'Abone Bilgilerini Göster';
	  window.location.href = 'newsletter-form-user.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '5':
	  window.parent.document.all.ds_right_title.innerText = 'Galeri Kategorisinin Bilgilerini Göster';
	  window.location.href = 'gallery-form-file.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '6':
	  window.parent.document.all.ds_right_title.innerText = 'Dosya Bilgilerini Göster';
	  window.location.href = 'gallery-form-cat.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '7':
	  window.parent.document.all.ds_right_title.innerText = 'Form Bilgilerini Göster';
	  window.location.href = 'form-form.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '7':
	  window.parent.document.all.ds_right_title.innerText = 'Link Bilgilerini Göster';
	  window.location.href = 'director-form.asp?p=form&sp=guncelle&id=' + var1;
	break
	case '7':
	  window.parent.document.all.ds_right_title.innerText = 'Link Kategorisinin Göster';
	  window.location.href = 'director-form-cat.asp?p=form&sp=guncelle&id=' + var1;
	break
	}
}

// ROLLOVER RESIM ISLEMI
function imgover(imgname, loadwhat){
imgname.src = loadwhat
}
function imgout(imgname, loadwhat){
imgname.src = loadwhat
}

//POPUP PENCERE ACAR
// Centered Pop-Up Window (v1.0)
// (C) 2002-2003 www.smileycat.com
// Free for all users, but leave in this header

var win = null;
function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  wint = wint - 33;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

//DIALOG KUTUSU ACALIM
function MM_openMDialog(theURL,args,features) { //v2.0
  var returnedValue = window.showModalDialog(theURL,args,features);
  eval (returnedValue);
}
