	String.prototype.replaceAll=function(old, rep ){
		foundat = 0;
		ret = this;
		do {
			foundat = ret.indexOf(old, foundat);
			if (foundat!=-1) {
				ret = ret.substring(0,foundat)+rep+ret.substr(foundat+1);
				foundat += rep.length;
			}
		} while (foundat!=-1);
		return ret;
	}
	
	function indexfGetIFrameDocument(id) {   
	  	var obj = indexfGetElem(id);
		var doc = obj.contentDocument;
		if (doc == undefined) // Internet Explorer
		doc = obj.contentWindow.document;
		return doc;
	}

	function indexfGetTime() {
		var current_timestamp = new Date();
		return current_timestamp.getTime();		
	}
	
	function indexfDiffTime(timestamp) {
		var current_timestamp = new Date();
		return (current_timestamp.getTime()-timestamp);	
	}
	
	function indexfIsNumeric(sText) {
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		for (i = 0; i < sText.length && IsNumber == true; i++) {
			Char = sText.charAt(i);
			if (ValidChars.indexOf(Char) == -1) {
				IsNumber = false;
			}
		}
		return IsNumber;
	}
	
	function indexfAllowNum(e){
		//if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;
		//if (event.keyCode < 45 || event.keyCode > 57) return false;
		var keynum;
		var keychar;
		var numcheck;
		
		// IE
		if(window.event) keynum = e.keyCode;
		// Netscape/Firefox/Opera
		else if(e.which) keynum = e.which;
		
		keychar = String.fromCharCode(keynum);
		numcheck = /\d/
		return numcheck.test(keychar);
	}

	function indexfGetElem(id) {
		//return document.all ? document.all[id] :
		return document.getElementById(id);
	}
	
	function indexfGeneratePassword(length) {
		var keylist="abcdefghijklmnopqrstuvwxyz123456789";
		var temp='';
		for (i=0; i<length; i++) temp += keylist.charAt(Math.floor(Math.random()*keylist.length));
		return temp;
	}
	
	function indexfSetTopWindow() {
		if (window != top) top.location.href = location.href;
	}
	
	function indexfBlockError() {
		window.onerror = function () { return true; };
	}
	
	//verilen objectin şəffavlığını təyin edir 0-100 arası
	function indexfChangeOpacity(object, opacity) {
		object = object.style;
    	object.opacity = (opacity / 100);
    	object.MozOpacity = (opacity / 100);
    	object.KhtmlOpacity = (opacity / 100);
    	object.filter = "alpha(opacity=" + opacity + ")";
	}
	
	function indexfFindChilds(obj, conditionsArray) {
		var temp = [];
		var node;
		var indexfQuote;
		
		if(obj.childNodes && obj.childNodes.length) {
			for(var i=0;i<obj.childNodes.length; i++) {
				var allpassed = true;
				node =  obj.childNodes[i];
				for(var j=0; j<conditionsArray.length; j++) { //openDOMBrowser(nodes[i])
					indexfQuote = "'";
					if(typeof(conditionsArray[j][1]) == 'boolean') indexfQuote = "";
					if( !eval("node."+conditionsArray[j][0]+" == "+indexfQuote+conditionsArray[j][1]+indexfQuote ) ) {
						allpassed = false;
						break;
					}
				}
				if(allpassed) {temp[temp.length] = node; }
				if(node.childNodes && node.childNodes.length) {
					indexfFindChilds(node,conditionsArray);
				}
			}		
		}//endif
		//alert(temp.length)
		return temp;
	}
	
	/** TABBED PAGES
			<ol id="tabcontrol">
				<li class="current"><a onclick="setCurrentTab(this);" href=""><span>Page1</span></a></li>
				<li><a onclick="setCurrentTab(this);" href=""><span>Page2</span></a></li>
				<li><a onclick="setCurrentTab(this);" href=""><span>Page3</span></a></li>
				<li><a onclick="setCurrentTab(this);" href=""><span>Page4</span></a></li>
			</ol>
	
	*/
	function indexfSetCurrentTab(obj) {
		var objs = indexfFindChilds(indexfGetElem("tabcontrol"), [['tagName', 'LI']]) ;
		for (o in objs) {
			if (objs[o] != obj.parentNode) objs[o].className = "";
			else objs[o].className = "current";
		}
	}

	//////////////////////////////////////////////////////////////////////////////
	//////  AJAX FUNKSIYALARININ ƏVVƏLİ
	//////////////////////////////////////////////////////////////////////////////////
	var xmlHttp;
	var pattern = /<SML><EMBED><DATA>([\D\d]*)<\/DATA><\/EMBED><\/SML>/m;

	///AJAX  N OBJEKT 
	function indexfGetXmlHttpObject()
	{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
			objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp
	}
	
	function indexfGetRequestBody(oForm) {
    	var aParams = new Array();
    	for (var i=0 ; i < oForm.elements.length; i++) {
        	var sParam = encodeURIComponent(oForm.elements[i].name);
        	sParam += "=";
        	sParam += encodeURIComponent(oForm.elements[i].value);
        	aParams.push(sParam);
    	}
    	return aParams.join("&");
	}

	function indexfAjaxGetRequest(url, codeStr) {
		if ( !xmlHttp ) xmlHttp = indexfGetXmlHttpObject();
		else if( xmlHttp.readyState != 0 ) xmlHttp.abort();
		xmlHttp = indexfGetXmlHttpObject();
		if ( codeStr.length > 0 ) {
			xmlHttp.onreadystatechange = function() {
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
					var response = xmlHttp.responseText;
					//alert(xmlHttp.readyState);
					codeStr = codeStr.replace("{response}", "response");
					eval(codeStr);
				}
			}
		}
		url = url + '&sid=' + indexfGeneratePassword(10);
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
	}
	
	function indexfAjaxPostRequest(formName, codeStr) {
		var formObj = document.forms[formName];
		if( !formObj ) {
			alert(formObj + ' adlı formun obyeti yaradıla bilmədi!');
			return false;
		}
		var data = indexfGetRequestBody(formObj);
		if ( !xmlHttp ) xmlHttp = indexfGetXmlHttpObject();
		else if( xmlHttp.readyState != 0 ) xmlHttp.abort();
		xmlHttp = indexfGetXmlHttpObject(); 
		xmlHttp.open("POST", formObj.action, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		if ( codeStr.length > 0 ) {
			xmlHttp.onreadystatechange = function() {
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
					var response = xmlHttp.responseText;
					//alert(xmlHttp.readyState);
					codeStr = codeStr.replace("{response}", "response");
					//alert(codeStr)
					eval(codeStr);
				}
			}
		}
		xmlHttp.send(data);
	}
	
	function indexfGetShamoEmbedPart(responseText) {
		if( !pattern.test(responseText) ) return false;
		var matches = responseText.match(pattern);
		return matches[1] ? matches[1] : false;
	}
	
	//////////////////////////////////////////////////////////////////////////////
	//////  AJAX FUNKSIYALARININ SONU
	//////////////////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////////////
	<!-- Original:  Cyanide_7 (leo7278@hotmail.com) -->
	<!-- Web Site:  http://www7.ewebcity.com/cyanide7 -->

	<!-- This script and many more are available free online at -->
	<!-- The JavaScript Source!! http://javascript.internet.com -->

	<!-- Begin
	var indexfObjects = new Array(), indexfBrowser = null, indexfExpanded = null;

	// begin objects array with the document
	indexfObjects[0] = new Array(indexfGetElem('ajaxInfoLabel'), "_document", false);

	function openDOMBrowser(object){
		// finds index of incoming object by its key
		activeIndex = arrayIndexOf(indexfObjects, "_document", 1);
		// toggles its expanded boolean
		indexfObjects[activeIndex][2] = !indexfObjects[activeIndex][2];
		// opens/reopens the window
		args = "width=500,height=600,left=20,top=20,scrollbars,resizable,top=0,left=0";
		indexfBrowser = window.open('',"DOMBrowser",args);
		indexfBrowser.focus();
		// clears the expanded array (to avoid infinate loops in the DOM)
		indexfExpanded = new Array();
		// document is about to be expanded
		indexfExpanded["_document"] = true;
		// writes HTML to the window
		indexfBrowser.document.open("text/html","replace");
		indexfBrowser.document.writeln("<HTML><HEAD><TITLE>DOM Browser</TITLE></HEAD>");
		indexfBrowser.document.writeln("<BODY BGCOLOR=BBBBBB link=FFFFF vlink=FFFFF>");
		indexfBrowser.document.writeln("<h3>document:</h3><ul>");
		// calls recurrsive property writing function
		getProps(object);
		// finishes writing HTML and closes
		indexfBrowser.document.writeln("</ul></BODY></HTML>");
		indexfBrowser.document.close();
		// returns false for event handlers
		return false;
	}
	// recurrsive function to get properties of objects
	function getProps(obj){
		// for loop to run through properties of incoming object
		for(var prop in obj){
			indexfBrowser.document.writeln("<li>");
			// if the property is an object itself, but not null...
			if(typeof(obj[prop])=="object" && obj[prop]!=null){
				// get index of object in objects array
				valIndex = arrayIndexOf(indexfObjects, obj[prop], 0);
				// if not in index array, add it and create its key
				if(valIndex==-1){
					valIndex = indexfObjects.length;
					key = ((new Date()).getTime()%10000) + "_" + (Math.floor(Math.random()*10000));
					indexfObjects[valIndex] = new Array(obj[prop], key, false);
				}
				// write link for this object to call openDOMBrowser with its key
				indexfBrowser.document.writeln("<b>"+prop+"</b> : <a href=\"javascript:void(0)\" onClick=\"window.opener.openDOMBrowser('"+ indexfObjects[valIndex][1]+"');return false;\">"+(new String(obj[prop])).replace(/</g,"<")+"</a>");
				// determine whether object should be expanded/was already expanded
				if(indexfObjects[valIndex][2] && !indexfExpanded[indexfObjects[valIndex][1]]){
					// if it needs to be expanded, add to expanded array
					indexfExpanded[indexfObjects[valIndex][1]] = true;
					// write nested list tag and recurrsive call to getProps
					indexfBrowser.document.writeln("<ul>");
					getProps(obj[prop]);
					indexfBrowser.document.writeln("</ul>");
				}
			} else
			// if not an object, just write property, value pair
			indexfBrowser.document.writeln("<b>"+prop+"</b> : " + (new String(obj[prop])).replace(/</g,"<"));
			indexfBrowser.document.writeln("</li>");
		}
	}
	
	// function to find object in an array by field value
	function arrayIndexOf(array, value, field){
		var found = false;
		var index = 0;
		while(!found && index < array.length){
			// field may be object reference or key
			if(array[index][field]==value) found = true;
			else index++;
		}
		return (found)?index:-1;
	}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//  End -->//////////////////////////////                 //////////////////////////////////////////////////