var currentwebsite;

function initialize (lan) {
  getPariteler(lan);
}

// pariteler.aspx
function getPariteler(lan) { new Ajax.Request( "../includes/pariteler.aspx?dil="+lan, { method: "get", evalScripts: true, onSuccess: pariteler, onFailure: reportError } ); }
function pariteler(transport) { $('d_pariteler').innerHTML=transport.responseText; }
// end-pariteler.aspx

function reportError(transport) {
  poststr = "fld_error=" + encodeURI("currentwebsite: "+currentwebsite+"<br>\n"+transport.responseText);
  new Ajax.Request( "senderror.asp", { method: "post", postBody: poststr, onSuccess: renderPage } );
}

function popUpImage(name, url) { window.open(url, name, 'left=0,top=0,width=800,height=600,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=no'); }

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function limitText(obj, maxLength) {
  if (obj.value.length >= maxLength) obj.value = obj.value.substring(0, maxLength);
  temp = $('charCount').innerHTML.split(':');
  $('charCount').innerHTML = temp[0] + ': ' + (maxLength - obj.value.length).toString();
}
