<!--
/*
Author: Mehmet TAS (0555-3197976)

onKeyPress=\"alert(event.keyCode);\"
window.location.protocol : http
window.location.pathname : /v1/...
window.location.hostname : pie.iplikonline.net
window.location.port : 8080
document.readyState

On IE4+ use:
			document.body.clientHeight
			document.body.clientWidth
for Netscape:
			window.innerHeight
			window.innerWidth
	
	document.body.scrollHeight

	No Scroll BAR
	if (document.all && document.body.scrollHeight > document.body.clientHeight)
	document.body.style.overflow = 'hidden';
	document.body.style.overflow = ''; Scroll Bar visible
*/
var scrW = screen.width, scrH = screen.height;
var rMsg = '', aLine="____________________________________________";
//----	Function to open pop up window.		----//
function openWin(theURL,winName,features) {
  	win_id = window.open(theURL,winName,features);
	win_id.focus();
}
//----	Function to jump to another forum.	----//
function ForumJump(URL) {
	if (URL.options[URL.selectedIndex].value != "") self.location.href = URL.options[URL.selectedIndex].value;	
	return true;
}
//----	Function to open Page Comment.		----//
function pageCmnt(URL) {
	openWin(URL,'YORUM','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=640,height=480');
}
//----	Function to open Tip Detay.		----//
function tDty(URI,wName,W,H)
{
	var tip;
	now = new Date; nw = now.getTime();
	if (isNaN(wName)) nw = wName;
	else tip = wName;
	openWin("",nw,"toolbar=0,location=0,menubar=1,status=0,scrollbars=1,width="+((W)?W:"625")+",height="+((H)?H:"480")+",resizable=1");
	win_id.location = ((URI)?URI:path+"/yardim/tip_yardim_popup.php")+((tip)?"#"+tip:"");
}

//---------------------------------------------------------//
//---	RTE Function to open preview post window	 	---//
//---------------------------------------------------------//
function openDty(targetPage, frm, param, W, H)
{
	now = new Date; nw = now.getTime();
	if (!W) W = (4/5)*scrW;
	if (!H) H = (4/5)*scrH;
	openWin("",nw,"toolbar=0,location=0,menubar=1,status=0,scrollbars=1,width="+W+",height="+H+",resizable=1");
	win_id.moveTo((1/10)*scrW,10);
	if (param) win_id.location = targetPage + "?"+param+"&nw=" + nw;
	else
	{
		//	Now submit form to the new window
 	  	frm.action = targetPage + "?"+param+"&nw=" + nw;
		frm.target = nw;
		frm.submit();
	}
}

//--------------------------------------------------------------------------//
//---- Kullanım şekli : this.value = upperCaseALL(frmObj)				----//
//---- frmObj ifade butun harfleri büyük hale getiriyor.				----//
//--------------------------------------------------------------------------//
function upperCaseALL(frmObj) 
{
	var index;
	var tmpStrLwr, tmpStr;
	var tmpCharLwr = "", tmpChar = "";
	var preString = "";
	var postString = "";
	var strlen;
	tmpStr = frmObj.value; 
	tmpStrLwr = frmObj.value;
	strLen = tmpStr.length;
	if (strLen > 0)  
	{
		// tmpStr convert to toUpperCase (ı to I) sensitive
		for (index = 0; index < strLen; index++)
		{
			switch (tmpStr.substring(index,index+1))
			{
				case "ı": tmpChar = tmpStr.substring(index,index+1).replace("ı","I");
				break;
				case "i": tmpChar = tmpStr.substring(index,index+1).replace("i","İ");
				break;
				case "I": tmpChar = tmpStr.substring(index,index+1);
				break;
				case "'": tmpChar = tmpStr.substring(index,index+1).replace("'","`");
				break;
				default: tmpChar = tmpStr.substring(index,index+1).toUpperCase();
				break;
			}
			postString += tmpChar;
		}
		tmpStr = xTrim(postString);
		postString = "";
		// tmpStr convert to toLowerCase (I to i) sensitive
		for (index = 0; index < strLen; index++)
		{
			switch (tmpStr.substring(index,index+1))
			{
				case "Ç": tmpCharLwr = tmpStr.substring(index,index+1).replace('Ç','c');
				break;
				case "Ğ": tmpCharLwr = tmpStr.substring(index,index+1).replace('Ğ','g');
				break;
				case "I": tmpCharLwr = tmpStr.substring(index,index+1).replace('I','i');
				break;
				case "İ": tmpCharLwr = tmpStr.substring(index,index+1).replace('İ','i');
				break;
				case "Ş": tmpCharLwr = tmpStr.substring(index,index+1).replace('Ş','s');
				break;
				case "Ö": tmpCharLwr = tmpStr.substring(index,index+1).replace('Ö','o');
				break;
				case "Ü": tmpCharLwr = tmpStr.substring(index,index+1).replace('Ü','u');
				break;
				default: tmpCharLwr = tmpStr.substring(index,index+1).toLowerCase();
				break;
			}
			postString += tmpCharLwr;
		}
		tmpStrLwr = xTrim(postString);
	}
	switch (frmObj.type) // <input Type=" ?? ">
	{
		case "checkbox":
		break;
		case "hidden":
			if (frmObj.name.indexOf("btn_") != -1) frmObj.value = tmpStr;
			if (frmObj.name.indexOf("no_brm") != -1) frmObj.value = frmObj.value;
		break;
		case "radio":
		break;
		case "button":
		break;
		case "submit":
		break;
		case "password":
			if ( frmObj.name.indexOf("sifre") != -1 ) frmObj.value = frmObj.value;
			else frmObj.value = tmpStr;
		break;
		case "text":
			if ( frmObj.name.indexOf("email") != -1 || frmObj.name.indexOf("web") != -1 ) frmObj.value = tmpStrLwr;
			else if ( frmObj.name.indexOf("kullanici_adi") != -1 || frmObj.name.indexOf("sifre") != -1 ) frmObj.value = frmObj.value;
			else frmObj.value = tmpStr;
		break;
		case "textarea":
			if (frmObj.name.indexOf("kombine_numara") != -1) frmObj.value = frmObj.value;
			else frmObj.value = tmpStr;
		break;
		case "select-one":
			if (frmObj.name.indexOf("no_brm") != -1) frmObj.value = frmObj.value;
			else frmObj.options[frmObj.selectedIndex].value = tmpStr;
			//	frmObj.options[frmObj.selectedIndex].text = tmpStr;
		break;
		default :
			//alert(frmObj.type + " => " + frmObj.name + " : " + tmpStr);
			frmObj.value = tmpStr;
	}
}
//--------------------------------------------------------------------------//


//--------------------------------------------------------------------------//
//---- Kullanım şekli : this.value = upperCaseFirst(frmObj)				----//
//---- frmObj ifade ilk harf büyük digerleri kücuk hale getiriyor.		----//
//--------------------------------------------------------------------------//
function upperCaseFirst(frmObj) 
{
	var index;
	var tmpStr;
	var tmpChar = "";
	var preString = "";
	var postString = "";
	var strlen;
	tmpStr = frmObj.value;
	strLen = tmpStr.length;
	if (strLen > 0)  
	{
		// tmpStr convert to LowerCase (I to ı) sensitive
		for (index = 0; index < strLen; index++)
		{
			switch (tmpStr.substring(index,index+1))
			{
				case "I": tmpChar = tmpStr.substring(index,index+1).replace('I','ı');
				break;
				case "ı": tmpChar = tmpStr.substring(index,index+1);
				break;
				default: tmpChar = tmpStr.substring(index,index+1).toLowerCase();
				break;
			}
			postString += tmpChar;
		}
		tmpStr = postString;
		// tmpStr convert to UpperCase (i to İ) sensitive
		for (index = 0; index < strLen; index++)  
		{
			if (index == 0)  
			{
				switch (tmpStr.substring(0,1))
				{
					case "i": tmpChar = tmpStr.substring(0,1).replace('i','İ');
					break;
					default: tmpChar = tmpStr.substring(0,1).toUpperCase();
					break;
				}
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			}
			else
			{
				tmpChar = tmpStr.substring(index, index+1);
				if ( (tmpChar == " " || tmpChar == "(" || tmpChar == "@")  && index < (strLen-1))
				{
					switch ( tmpStr.substring(index+1, index+2) )
					{
						case "i":tmpChar = tmpStr.substring(index+1,index+2).replace('i','İ');
						break;
						default:tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
						break;
					}
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
		         }
      		}
		}
	}
	switch (frmObj.type) // <input Type=" ?? ">
	{
		case "text" :
			if ( frmObj.name.indexOf("email")==0 || frmObj.name.indexOf("web")==0 )	frmObj.value = tmpStr.toLowerCase();
			else if ( frmObj.name.indexOf("kullanici_adi")==0 || frmObj.name.indexOf("sifre")==0 ) frmObj.value = frmObj.value;
			else frmObj.value = tmpStr;
		break;
		case "textarea" :
			frmObj.value = tmpStr;
		break;
		case "button" :
		break;
		case "submit" :
		break;
		case "select-one" :
			frmObj.options[frmObj.selectedIndex].value = tmpStr;
			//frmObj.options[frmObj.selectedIndex].text = tmpStr;
		break;
		default :
			//alert(frmObj.type + " => " + frmObj.name + " : " + tmpStr);
			frmObj.value = tmpStr;
	}
}
//--------------------------------------------------------------------------//
function convert(srcFld) {
	tmpStr = new String(srcFld.value);
	strLen = tmpStr.length;
	postString = ""
	// tmpStr convert to toUpperCase (ı to I) sensitive
	for (var i=0; i<strLen; i++)
	{
		switch (tmpStr.substring(i,i+1))
		{
			case "Ç": tmpChar = tmpStr.substring(i,i+1).replace('Ç','C');
			break;
			case "Ğ": tmpChar = tmpStr.substring(i,i+1).replace('Ğ','G');
			break;
			case "İ": tmpChar = tmpStr.substring(i,i+1).replace('İ','I');
			break;
			case "Ş": tmpChar = tmpStr.substring(i,i+1).replace('Ş','S');
			break;
			case "Ö": tmpChar = tmpStr.substring(i,i+1).replace('Ö','O');
			break;
			case "Ü": tmpChar = tmpStr.substring(i,i+1).replace('Ü','U');
			break;
			default: tmpChar = tmpStr.substring(i,i+1).toUpperCase();
			break;
		}
		postString += tmpChar;
	}
	return postString;
}
//------------------------------------------------------------------//
//----	Kullanım şekli : this.value = round(number,X)			----//
//----	rounds number to X decimal places, defaults to 2		----//
//------------------------------------------------------------------//
function round(number,X) {
	number = number.toString().replace(/\$|\,/g,'');
	X = (!X ? 2 : X);
	return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

//-------------------------------------------------------------------------------------//
//----	Kullanım şekli : this.value = FormatXXX(this)			----//
//-------------------------------------------------------------------------------------//
function FormatDigit(num) {
	num = num.toString().replace(/\$|\,/g,'');
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3));
		return (num);
}
function FormatTel(num) {
	if (num) {
		num = num.toString().replace(/\$|\,/g,'');
		num = num.substring(0,3) + ' ' + num.substring(3,5) + ' ' + num.substring(5,7) + ' ' + num.substring(7,num.length) ;	
		return (num);
	}
	else return '';
}
function FormatDate(frmElm) {
	if (!frmElm.value) return false;
	// "Space","/","," gorunce bunu "."  ile degistir.
	var num = frmElm.value.toString().replace(/\$|(\,)|(\040)|(\/)/g,'.');
	if ((num.substring(2,3) != "." && num.substring(5,6) != ".") || isNaN(num.substring(0,2)) || isNaN(num.substring(3,5)) || isNaN(num.substring(6)) )
	{
		num = "";
		alert("LÜTFEN DİKKAT! \n" + aLine + "\n\n" + " .: Bu alana tarihi GÜN/AY/YIL (01.01.20xx) girmelisiniz.\n" + aLine);
		frmElm.focus();
	}
	frmElm.value = num;
}
function FormatCurrency(frmElm,cinsi) {
	num = xTrim(frmElm.value.toString()).replace(/\$|\,/g,'');
	// sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if (cents<10) cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	//	num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3));
	num = num.substring(0,num.length-(4*i+3)) + num.substring(num.length-(4*i+3));
	//return (((sign)?'':'-') +  num + '.' + cents);
	num += '.' + cents;
	if (isNaN(num) || num=='0.00') num = "";
	frmElm.value = num;
}
//-------------------------------------------------------------------------------------//

//------------------------------------------------------------------//
//---	Run this when openRK function unload					 ---//
//---	ret[0] -> Frm Name ret[1] -> Return Value				 ---//
//------------------------------------------------------------------//
function setRK(ret0,ret1,uMsg) {
	var rkObj = new getObj(ret0);
	rkObj.obj.value = ret1;
	if (uMsg)
	{
		var msgObj = new getObj("uMsg_"+ret0);
		msgObj.obj.innerHTML = uMsg;
	}
}

function openRK(file,frm,W,H,WinPos){
	ShowWindow(file,frm,W,H,WinPos);
}

//---------------------------------------------------------------------------------------------//
//--- Kullanım şekli : 	---//
//--- Fiziksel K.D. && Bobinaj A.D. detayı giriliyor [ IUL -> 1:insert; 2:update; 3;List; 4:from DB ]	---//
//---------------------------------------------------------------------------------------------//
function subWin(targetPage, frm, fld, param, W, H, isBAD, bobinaj, ambalaj) {
	var xPos = "", yPos = "";
	if ( ((scrW-W)/2)>0 ) xPos = ((scrW-W)/2);
	if ( ((scrH-H)/2)>0 ) yPos = ((scrH-H)/2);
	now = new Date; nw = now.getTime();
	if (!W) W = (4/5)*scrW;
	if (!H) H = (4/5)*scrH;
	fldObj = eval("frm." + fld); // Girilen degeri ifade eder.
	if (isBAD) // Bobinaj ve ambalaj detayı
	{
		bObj = eval("frm." + bobinaj);
		aObj = eval("frm." + ambalaj);
		if (bObj.value && aObj.value) {
			if (aObj.value=="ÇİLE TORBASI") targetPage += "?" + bObj.name + "=" + bObj.value + "&" + aObj.name + "=&" + param + "&" + fldObj.name + "=" + fldObj.value + "&nw=" + nw;
			else targetPage += "?" + bObj.name + "=" + bObj.value + "&" + aObj.name + "=" + aObj.value + "&" + param + "&" + fldObj.name + "=" + fldObj.value + "&nw=" + nw;
		}
		else {
			alert("LÜTFEN DİKKAT!\n" + aLine +"\n\n" + "Öncelikle \" "+bObj.name+" \" ve \" "+aObj.name+" \" seçiminizi\nyapmalısınız.\n" + aLine );
			targetPage = "";
		}
	}
	else { // Fiziksel ve Kalite Degerleri
		targetPage += "?" + param + "&" + fldObj.name + "=" + fldObj.value + "&nw=" + nw;
	}
	if (targetPage) {
		openWin("",nw,"toolbar=0,location=0,menubar=1,status=0,scrollbars=1,width="+W+",height="+H+",resizable=1,left="+xPos+"px,top="+yPos+"px");
		win_id.location = targetPage;
	} 
}

//------------------------------------------------------------------//
//---		bla bla bla		---//
//------------------------------------------------------------------//
function onChangeReset (frm, fld) {
	fldObj = eval("frm."+fld);
	fldObj.value = "";
}

//------------------------------------------------------------------//
//---		bla bla bla		---//
//------------------------------------------------------------------//
function onChangeSubmit (frm, fld, action, method) {
	if (action) frm.action = action;
	if (method) frm.method = method;
	frm.submit();
}

//------------------------------------------------------------------//
//---	iplik.php ve iplik Listelemede sıralama ve sayfalama	 ---//
//------------------------------------------------------------------//
function sortBY(Frm, oName, oType) {
	Frm.action = "";
	Frm.target = "";
	Frm.order_name.value = oName;
	Frm.order_type.value = oType;
	Frm.submit();
}

function pageBY(Frm, PTR, PP) {
	if (PP) {
	  Frm.per_page.value = PP;
	  Frm.page_ptr.value = '';
	}
	else Frm.page_ptr.value = PTR;
	Frm.method = "GET";
	Frm.action = "";
	Frm.target = "";
	Frm.submit();
}

//---------------------------------------------------------------------//
//---- Kullanım şekli : isNumber(num,min,max) 					   ----//
//---- NUM eğerin numerik olma durumu ve aralığı kontrol ediliyor. ----//
//---------------------------------------------------------------------//
function isNumber(frmElm,min,max) {
	if (!frmElm.value) return false;
	// "Space" veya "," gorunce bunu "."  ile degistir.
	var num = frmElm.value.toString().replace(/\$|(\,)|(\040)/g,'.'), rMsg = '';
	if (!isNaN(num)) {
		if ( (min && max) && (num < min || num > max) )
		{
			num = '';
			rMsg = " .: Bu alana "+min+"-"+max+" arasında rakam girmelisiniz.\n";
		}
	}
	else {
		num = '';
		rMsg = " .: Bu alana rakam girmelisiniz.\n";
	}
	if (rMsg) {
		alert("LÜTFEN DİKKAT! \n" + aLine + "\n\n" + rMsg + aLine);
		frmElm.focus();
	}
	frmElm.value = num;
}
//-------------------------------------------------------------------------------------//

//-------------------------------------------------------------------------//
//---- Kullanım şekli : isChar(str) 								   ----//
//-------------------------------------------------------------------------//
function isChar(str)
{
  if(!isNaN(str.value))
  {
	alert("LÜTFEN DİKKAT! \n" + aLine + "\n\n" + "Bu alana rakam girmemelisiniz.\n" + aLine);
	return str.value='';
  }
  else
  {
	//	if ( (/[^a-z.,]/.exec(str.value)) ) alert();
	return str.value;
  }
}
//-------------------------------------------------------------------------//


//-------------------------------------------------------------------------------------//
//---- Kullanım şekli : isItInRange(num,min,max) 								   ----//
//---- num ile gönderilen değerin numerik olma durumu ve aralığı kontrol ediliyor. ----//
//-------------------------------------------------------------------------------------//
function isItInRange(num,min,max){
   if(!isNaN(num)){
        if(num > min && num < max) return true;
        else return false;
   }
   else return false;
}
//-------------------------------------------------------------------------------------//


//-------------------------------------------------------------------------------------//
//---- Kullanım şekli : toggleLY(Label,FormElement) 							   ----//
//---- toggleLY ile gönderilen FormElement'e "Listede Yok" yerine değer atanıyor.  ----//
//-------------------------------------------------------------------------------------//
function enableField(frm, frmField) {
	ComboLength = frmField.options.length;
	if (frmField.options[ComboLength-1].selected) {
		anyObj("LY_"+frmField.name).value = "";
		anyObj("LY_"+frmField.name).className = "W";
		anyObj("LY_"+frmField.name).style.visibility = "visible";
		anyObj("LY_"+frmField.name).disabled = false;
		anyObj("LY_"+frmField.name).focus();
	}
	else {
		anyObj("LY_"+frmField.name).value = "";
		anyObj("LY_"+frmField.name).className = "L";
		anyObj("LY_"+frmField.name).disabled = true;
		anyObj("LY_"+frmField.name).style.visibility = "hidden";
	}
}

function toggleLY(file, schCriteria, lbl, frmField, W, H) {
	ComboLength = frmField.options.length;
	if (frmField.options[ComboLength-1].selected) {
		//	ShowWindow(file,schCriteria+"~"+lbl+"~"+frmField.name+"~"+unescape(frmField.value),W,H);
		document.getElementById("LY_icon_"+frmField.name).style.visibility = "visible";
	}
	else {
	   	document.getElementById('LY_icon_'+frmField.name).style.visibility="hidden";
	}
}

function _toggleLY(file, schCriteria, tLabel, tField, tFrm) {
	ComboLength = tField.options.length;
	if (tField.options[ComboLength-1].selected) {
		buttonMouseover(event, 'divLy', tLabel, tField, tFrm);
		//ShowWindow(file, schCriteria+"~"+lbl+"~"+frmField.name+"~"+unescape(frmField.value),W,H);
		anyObj("LY_icon_"+tField.name).style.visibility = "visible";
	}
	else {
		anyObj('divLy').style.visibility = 'hidden';
	   	anyObj('LY_icon_'+tField.name).style.visibility="hidden";
	}
}

function setLY(ret0, ret1) {
	var frmObj = anyObj(ret0.name);
	var index = frmObj.options.selectedIndex;
	//	alert(index + ": " + ret0.name + "=> " + ret0.value);	
	if (ret1) {
		frmObj.options[index] = new Option(ret0);
		frmObj.options[index].className = "Z";
		frmObj.options[index].value = ret0.value;
		frmObj.options[index].text = ret0.value;
		frmObj.options[index].selected = true;
	}
	else {
		frmObj.options[index] = new Option(ret0);
		frmObj.options[index].className = "Z";
		frmObj.options[index].value = "";
		frmObj.options[index].text = "LİSTEDE YOK";
		frmObj.options[index].selected = true;
	}
}
//-------------------------------------------------------------------------------------//


//-------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------//
function getObj (name) {
  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
     this.obj = document.all[name];
     this.style = document.all[name].style;
  }
  else if (document.layers)
  {
     this.obj = document.layers[name];
     this.style = document.layers[name];
  }
}

function anyObj (name) {
  if (document.getElementById) theObj = document.getElementById(name);
  else if (document.all) theObj = document.all[name];
  else if (document.layers) theObj = document.layers[name];
  return theObj;
}

function showHelpDiv(URL, xPos, yPos) {
	var helpObj = new getObj("helpDiv");
	helpObj.style.visibility = "visible";
	top.helpFrame.location = URL;
	set_pos(helpObj);
	if (xPos) helpObj.style.left = xPos;
	if (yPos) helpObj.style.top = yPos;
	//	top.helpFrame.document.write("Merhaba");
}
function hideHelpDiv() {
	var helpObj = new getObj("helpDiv");
	if (!helpObj) { return false }
	helpObj.style.top = -1000;
	helpObj.style.visibility="hidden";
	return true;
}
function set_pos(posObjTo) {
	posObjTo.style.left = xPos;
	posObjTo.style.top = yPos;
}

function showRTEmenu(URL, command, itemIndex, Fld) {
	var rteObj = new getObj("rteDiv");
	rteObj.style.left = offsetLeft(Fld) + "px";
	rteObj.style.top = offsetTop(Fld) + Fld.height + 5 + "px";
	rteObj.style.visibility = "visible";
	var content = "<table cellPadding='0' cellSpacing='0'>";
	for (i = 0; i < fontArray[itemIndex].length; i++) 
	{
		// itemIndex :0 Font Family, itemIndex :1 Font Size
		if (!itemIndex) content += "<tr><td nowrap style='BORDER:0px;' class='PPU' onMouseOver=\"this.className='PPO'\" onMouseOut=\"this.className='PPU'\" id='"+fontArray[itemIndex][i][0]+"' onClick=\"setFont('"+command+"', this.id);hideRTEmenu();\" ><a href='javascript:;'><font face='"+fontArray[itemIndex][i][0]+"'>" + fontArray[itemIndex][i][1] + "</font></a></td></tr>";
		else content += "<tr><td nowrap style='BORDER:0px;' class='PPU' onMouseOver=\"this.className='PPO'\" onMouseOut=\"this.className='PPU'\" id='"+fontArray[itemIndex][i][0]+"' onClick=\"setFont('"+command+"', this.id);hideRTEmenu();\" ><a href='javascript:;'>" + fontArray[itemIndex][i][1] + "</a></td></tr>";
	}
	content += "</table>";
	document.getElementById("rteDiv").innerHTML = content;
	//top.rteFrame.document.write(content);
}
function hideRTEmenu() {
	var rteObj = new getObj("rteDiv");
	if (!rteObj) { return false }
	rteObj.style.visibility = "hidden";
	return true;
}

//-------------------------------------------------------------------------------------//


//-------------------------------------------------------------------------------------//
//---	adjustIFrameSize parameter -> onLoad = "adjustIFrameSize(window)" 			---//
//-------------------------------------------------------------------------------------//
function adjustIFrameSize (iframeWindow,W,H)
{
	if (iframeWindow.document.height)
	{
		var iframeElement = parent.document.getElementById(iframeWindow.name);
		iframeElement.style.height = (H)?H:scrH - 200 + 'px';
		iframeElement.style.width = (W)?W:iframeWindow.document.body.scrollWidth + 25 + 'px';
	}
	else if (document.all)
	{
		var iframeElement = parent.document.all[iframeWindow.name];
		if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') 
		{
			iframeElement.style.height = (H)?H:scrH - 200 + 'px';
			iframeElement.style.width = (W)?W:iframeWindow.document.documentElement.scrollWidth + 25 + 'px';
		}
		else
		{
			iframeElement.style.height = (H)?H:scrH - 200 + 'px';
			iframeElement.style.width = (W)?W:iframeWindow.document.body.scrollWidth + 25 + 'px';
		}
	}
}

//-------------------------------------------------------------------------------------//
//---	resetIFrameSize parameter -> onUnLoad = "resetIFrameSize(window,800,600)" 	---//
//-------------------------------------------------------------------------------------//
function resetIFrameSize (iframeWindow,W,H)
{
	if (iframeWindow.document.height)
	{
		var iframeElement = parent.document.getElementById(iframeWindow.name);
		iframeElement.style.width = W + 'px';
	}
	else if (document.all)
	{
		var iframeElement = parent.document.all[iframeWindow.name];
		iframeElement.style.width = W + 25 + 'px';
	}
}


//---------------------------------------------------------//
//---	eID : inner Element ID, tMsg : inner Mesaj  	---//
//---------------------------------------------------------//
function setMenuTitle(eID,tMsg) {
	anyObj(eID).innerHTML = tMsg;
}
function clearMenuTitle(eID) {
	anyObj(eID).innerHTML = '&nbsp;';
}

//--------------------------------------------------------------------------------------//
//---- Kullanım şekli: X.value = xTrim(str), str deki WHITE SPACE temizleniyor.	----//
//--------------------------------------------------------------------------------------//
function xTrim(str) {
	return str.replace(/^\s*|\s*$/g,"");
}

//--------------------------------------------------------------------------------------//
//---- Kullanım şekli: X.value = semiExchange(str), str deki ' &#39 temizleniyor.	----//
//--------------------------------------------------------------------------------------//
function semiExchange(str) {
	return str.replace(/\$|\'/g,"&#39");
}

//---------------------------------------------------------//
//---	RTE Function to open preview post window	 	---//
//---------------------------------------------------------//
function OpenPreviewWindow(targetPage, formName)
{
	now = new Date  
	//Open the window first 	
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   	//Now submit form to the new window
   	formName.action = targetPage + "?ID=" + now.getTime();	
	formName.target = "preview";
	formName.submit();
}

function TrDecode(frm,preFix,ie) {
	if (ie)
	{
		for (var i = 0; i < frm.elements.length; i++)	
		{
			var e = frm.elements[i],tmpStr='';
			if (e.name.indexOf(preFix)==0) e.value = unescape(e.value) ;
		}
	}
}

function winCls(F,R) {
	if (F) self.opener.focus();
	if (R) self.opener.location.reload();
	self.close();
}

//---------------------------------------------------------//
//---	Resize window in order to fit IMG to visible 	---//
//---	Event handler "body onLoad='resize()' calisir 	---//
//---------------------------------------------------------//
function resize() {
    windowWidth = document.ModelImage.width + 176;
    windowHeight =  document.ModelImage.height + 130;
    if ( windowWidth < 400 ) windowWidth = 400;
    if ( windowHeight < 200 ) windowHeight = 200;
        resizeTo( windowWidth, windowHeight );
}

//---------------------------------------------------------//
//---	Offset LEFT and TOP, Mac IE offset fix 			---//
//---------------------------------------------------------//
function offsetLeft(o) {
    var i = 0;
    while (o.offsetParent!=null) {
        i += o.offsetLeft;
        o = o.offsetParent;
    }
    return i + o.offsetLeft;
}
function offsetTop(o){
    var i = 0;
    while (o.offsetParent!=null) {
        i += o.offsetTop;
        o = o.offsetParent;
    }
    return i + o.offsetTop;
}

function goTo(url) {
    document.location.href = url;
}
-->
