function showComments(id) {
	$('#replies-'+ id +'-opener').hide();
	$('#replies-'+ id +'-items').slideDown();
	$('#replies-'+ id +'-closer').show();
}

function hideComments(id) {
	$('#replies-'+ id +'-closer').hide()
	$('#replies-'+ id +'-items').slideUp();
	$('#replies-'+ id +'-opener').show();
}

function goto(f, URL) {
	if(f.options[f.selectedIndex].value!='') {
		location.href=URL + f.options[f.selectedIndex].value;
	}
}


/* POPUP */
		function openPopUp(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=0,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp2(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=0,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp3(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp4(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=0,menubar=0,resizable=1,copyhistory=1");
			KopWin.focus();
		}
		function openPopUpRnd(src,w,h,name) {
			RndNumber = Math.random()
			KopWin = window.open(src+'?'+RndNumber,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		
/* ILAN ATRAKSIYON */
		function ilanover(a) {
			a.style.background='#ffffff';
			a.style.border='1px solid #CCCCCC';
		}
		
		function ilanout(b) {
			b.style.background='transparent';
			b.style.border='1px solid #f7f7f7';
		}
		
		
		
<!--hide this script from non-javascript-enabled browsers
// Checks date
function CheckDateValue (DayValue,MonthValue,YearValue)
{
	var objDate
	objDate = new Date(YearValue,MonthValue-1,DayValue);
	if (objDate.getYear() != YearValue ||
		objDate.getMonth () + 1 != MonthValue ||
		objDate.getDate ()!= DayValue )
		return false;

	return true;
}

//opens window
function OpenWindow(URL,WIDTH,HEIGHT)
{
	var left=200;
	var top =0;
	window.open(URL,Math.floor(Math.random()*(100)),'left='+left+',top='+top+',width='+WIDTH+',height='+HEIGHT+',resizable=yes');
}

//opens window
function OpenPhotoWindow(URL)
{
	var left=100;
	var top =0;
	window.open(URL,Math.floor(Math.random()*(1000)),'left='+left+',top='+top+',scrollbars=yes,resizable=yes');
}

//opens window
function OpenWindow2(URL,WIDTH,HEIGHT,left,top)
{
	var left=0;
	var top =0;
	window.open(URL,Math.floor(Math.random()*(100)),'left='+left+',top='+top+',width='+WIDTH+',height='+HEIGHT+',resizable=yes');
}

function OpenWindow3(URL,WIDTH,HEIGHT)
{
	var left=0;
	var top =0;
	window.open(URL,Math.floor(Math.random()*(100)),'left='+left+',top='+top+',width='+WIDTH+',height='+HEIGHT+',scrollbars=yes,resizable=no');
}

function OpenWindow4(URL,WIDTH,HEIGHT,left,top)
{
	window.open(URL,Math.floor(Math.random()*(100)),'left='+left+',top='+top+',width='+WIDTH+',height='+HEIGHT+',scrollbars=yes,resizable=no');
}


/* Functions checks form fields. */
function IsOnlySpace(form,fieldname,errmsg)
{
	re = /\s*/;
	val = form.elements[fieldname].value;
	if ( re.exec(val) == val && val != "")
	{
		alert(errmsg);
		form.elements[fieldname].value = "";
		form.elements[fieldname].focus();
		return(true);
	}
	return(false);
}

//urlencode

var errEmail = 'E-posta adresi name@domain formatında olmalı ve Türkçe karakter içermemelidir.';
// Email check start
function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
/* Finally, let's start trying to figure out if the supplied address is
   valid. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid
if (user.match(userPat)==null) {
    // user is not valid
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
		return false
	    }
    }
    return true
}
// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
    return false
}
/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 ||
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   return false
}
// Make sure there's a host name preceding the domain.
if (len<2) {
   return false
}
// If we've gotten this far, everything's valid!
return true;
}
// Email check End


function chkdate(objName) {
//var strDatestyle = "US"; //United States date style
var strDatestyle = "EU";  //European date style
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var booFound = false;
var datefield = objName;
var strSeparatorArray = new Array("-"," ","/",".");
var intElementNr;
var err = 0;
var strMonthArray = new Array(12);
strMonthArray[0] = "Oca";
strMonthArray[1] = "Şub";
strMonthArray[2] = "Mar";
strMonthArray[3] = "Nis";
strMonthArray[4] = "May";
strMonthArray[5] = "Haz";
strMonthArray[6] = "Tem";
strMonthArray[7] = "Ağu";
strMonthArray[8] = "Eyl";
strMonthArray[9] = "Eki";
strMonthArray[10] = "Kas";
strMonthArray[11] = "Aralık";
strDate = datefield.value;
if (strDate.length < 1) {
return true;
}
for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
strDateArray = strDate.split(strSeparatorArray[intElementNr]);
if (strDateArray.length != 3) {
err = 1;
return false;
}
else {
strDay = strDateArray[0];
strMonth = strDateArray[1];
strYear = strDateArray[2];
}
booFound = true;
   }
}
if (booFound == false) {
if (strDate.length>5) {
strDay = strDate.substr(0, 2);
strMonth = strDate.substr(2, 2);
strYear = strDate.substr(4);
   }
}
if (strYear.length == 2) {
strYear = '20' + strYear;
}
// US style
if (strDatestyle == "US") {
strTemp = strDay;
strDay = strMonth;
strMonth = strTemp;
}
intday = parseInt(strDay, 10);
if (isNaN(intday)) {
err = 2;
return false;
}
intMonth = parseInt(strMonth, 10);
if (isNaN(intMonth)) {
for (i = 0;i<12;i++) {
if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
intMonth = i+1;
strMonth = strMonthArray[i];
i = 12;
   }
}
if (isNaN(intMonth)) {
err = 3;
return false;
   }
}
intYear = parseInt(strYear, 10);
if (isNaN(intYear)) {
err = 4;
return false;
}
if (intMonth>12 || intMonth<1) {
err = 5;
return false;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
err = 6;
return false;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
err = 7;
return false;
}
if (intMonth == 2) {
if (intday < 1) {
err = 8;
return false;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
err = 9;
return false;
}
}
else {
if (intday > 28) {
err = 10;
return false;
}
}
}
if (strDatestyle == "US") {
 // datefield.value = strMonthArray[intMonth-1] + " " + intday+" " + strYear;
}
else {
// datefield.value = intday + " " + strMonthArray[intMonth-1] + " " + strYear;
}
return true;
}
function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}
function doDateCheck(from, to) {
if (Date.parse(from.value) <= Date.parse(to.value)) {
alert("The dates are valid.");
}
else {
if (from.value == "" || to.value == "")
alert("Both dates must be entered.");
else
alert("To date must occur after the from date.");
   }
}



//urlencode
function urlEncode(inStr)
{
	outStr=' '; //not '' for a NS bug!
	for (i=0; i < inStr.length; i++)
	{
		aChar=inStr.substring (i, i+1);
		switch(aChar)
		{
			case '%': outStr += "%25"; break; case ',': outStr += "%2C"; break;
			case '/': outStr += "%2F"; break; case ':': outStr += "%3A"; break;
			case '~': outStr += "%7E"; break; case '!': outStr += "%21"; break;
			case '"': outStr += "%22"; break; case '#': outStr += "%23"; break;
			case '$': outStr += "%24"; break; case "'": outStr += "%27"; break;
			case '`': outStr += "%60"; break; case '^': outStr += "%5E"; break;
			case '&': outStr += "%26"; break; case '(': outStr += "%28"; break;
			case ')': outStr += "%29"; break; case '+': outStr += "%2B"; break;
			case '{': outStr += "%7B"; break; case '|': outStr += "%7C"; break;
			case '}': outStr += "%7D"; break; case ';': outStr += "%3B"; break;
			case '<': outStr += "%3C"; break; case '=': outStr += "%3D"; break;
			case '>': outStr += "%3E"; break; case '?': outStr += "%3F"; break;
			case '[': outStr += "%5B"; break; case '\\': outStr += "%5C"; break;
			case ']': outStr += "%5D"; break; case ' ': outStr += "+"; break;
			default: outStr += aChar;
		}
	}
	return outStr.substring(1, outStr.length);
}




function IsNumeric(str)
{
	var len =str.length;
    for (var i = 0; i < len; i++)
    {
      var ch = str.substring(i, i + 1);
      if ((ch < "0" )||( ch > "9" ))
      {
	return false;
      }
    }
    return true;
}

function IsNumeric2(str)
{
    var len = str.length;
    for (var i = 0; i < len; i++) {
        var ch = str.substring(i, i + 1);
        if(i==0) {
            if(ch!="-" && (ch < "0" || ch > "9" ))
            	return false;
            else
            	continue;
        }
        if ((ch < "0" )||( ch > "9" )) return false;
    }
    return true;
}

function IsFloat(str)
{
	var len =str.length;
    for (var i = 0; i < len; i++)
    {
      var ch = str.substring(i, i + 1);
      if ((ch < "0" )||( ch > "9" ))
      {
		if (ch != "," && ch != ".")
			return false;
      }
    }
    return true;
}

// Checks text box whether is valid date
function checkdate(objName) {
var datefield = objName;
if (chkdate(objName) == false) {
datefield.select();
alert("Girdiğiniz tarih doru değil lütfen tekrar deneyin.");
datefield.focus();
return false;
}
else {
return true;
   }
}

function Only_Letter(e) {
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;  // Enter
	if (whichCode == 0) return true;  //Delete etc.
	if ((whichCode >=97 && whichCode <=122) || (whichCode <=90 && whichCode >=65)){
	return true;}
	var validChars="üÜğĞışŞİçÇöÖ ";
	for (i=0; i<validChars.length; i++) {
		if (whichCode==validChars.charCodeAt(i)) {
			return true;
		}
	}
	return false;
}

function Only_Digit_With_Dot(e) {
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13 || whichCode == 46) return true;  // Enter & Dot
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;
    }
}

function Only_Digit_With_Comma(e) {
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13 || whichCode == 44) return true;  // Enter & Comma
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;
    }
}

function Only_Digit(e) {
    var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;  // Enter
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;
    }
}

function Only_Digit_Price(e) {
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13 || whichCode == 44 || whichCode == 46) return true;  // Enter & Comma & Dot
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;
    }
}
		
function writeFlash(u, w, h) {
	var outStr='';
	outStr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://www.macromedia.com/go/getflashplayer" width="'+ w +'" height="'+ h +'"><param name="movie" value="'+ u +'"><embed src="'+ u +'" quality="high" width="'+ w +'" height="'+ h +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
	document.write(outStr)	;
}
