var responseText = null;
function xmlHttpRequest(){var nesne=null;try{nesne=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{nesne=new ActiveXObject("Microsoft.XMLHTTP");} catch(oc){nesne=null;}} if(!nesne && typeof XMLHttpRequest != "undefined"){nesne=new XMLHttpRequest();}return nesne;}
function ajax(method,url,params,callBackFunction){
		var xmlHttp = new xmlHttpRequest();
		if(method == "GET"){
			xmlHttp.open("GET",url+"?"+params,true);
			parameters = null;
		}
		else{
			xmlHttp.open("POST",url,true);
			parameters = params;
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=iso-8859-9");
		}
		  xmlHttp.onreadystatechange=function(){
			   if(xmlHttp.readyState==4) {
			   		responseText = xmlHttp.responseText;
			   		eval(callBackFunction + "()");		
			   } 
		  }
		xmlHttp.send(parameters);
}

function wait(){
	document.getElementById("waitDiv").style.display="block";
}
function finishWaiting(){
	document.getElementById("waitDiv").style.display="none";	
}
function setParameters()
{
	var params='';
	
	if(document.getElementsByTagName('input'))  
	{
		var inpts = document.getElementsByTagName('input');
		for ( i=0;i<inpts.length;i++)
		{
			if(inpts[i].type == "checkbox")
			{
				if(inpts[i].checked == true)
				{
					params+=inpts[i].name+'='+inpts[i].value+'&';
				}
			}
			else
				params+=inpts[i].name+'='+inpts[i].value+'&';
		}
	}
	  
	if(document.getElementsByTagName('textarea'))  
	{
		var txtars = document.getElementsByTagName('textarea');
		for ( i=0;i<txtars.length;i++)
		{
			params+=txtars[i].name+'='+txtars[i].value+'&'
		}
	}
	
	if(document.getElementsByTagName('select'))  
	{
		var slcts = document.getElementsByTagName('select');
		for ( i=0;i<slcts.length;i++)
		{
			params+=slcts[i].name+'='+slcts[i].value+'&'
		}
	}
	
	params = params.substring(0,params.length-1)
	return params;
}
function setInnerHTML(objName,content){
	document.getElementById(objName).innerHTML = content;
}
function addInnerHTML(objName,content){
	document.getElementById(objName).innerHTML += content;
}
function oyVer(x){
	var method='GET';
	var callBackFunction='oySonucGoster';
	var url=$mosConfig_live_site+'/index3.php';
	var id=document.getElementById('cid').value;
	var params='option=ajax&user_rating='+x+'&cid='+id;
	//alert(params);
	ajax(method,url,params,callBackFunction);

}
function oySonucGoster(){

document.getElementById('content_rating').innerHTML=responseText;
}	
function listedenCikar(task){
	var c = confirm("Seçili kişileri  Listesinden kaldırmak istediğinize eminmisiniz?");
	if (!c){return false;}	
			var params='task='+task+'&act=del&';
				if(document.getElementsByTagName('input'))  {
					var inpts = document.getElementsByTagName('input');
					for ( i=0;i<inpts.length;i++){
						if(inpts[i].type == "checkbox"){
							if(inpts[i].checked == true){
							params+=inpts[i].name+'='+inpts[i].value+'&';
							}
					}
						/*else
						params+=inpts[i].name+'='+inpts[i].value+'&';*/
					}
				}
			sil(params);
			
}
function sil(x){
	var method='GET';
	var callBackFunction='silSonuc';
	var url='index4.php';
	
	var params='index.php?option=com_userDetail&'+x
	//ajax(method,url,params,callBackFunction);

	location.href=params;
}
function deleteMsg(){
	var c = confirm("Seçili kişileri mesajları istediğinize eminmisiniz?");
	if (!c){return false;}	
			var params='task=message&act=del&';
				if(document.getElementsByTagName('input'))  {
					var inpts = document.getElementsByTagName('input');
					for ( i=0;i<inpts.length;i++){
						if(inpts[i].type == "checkbox"){
							if(inpts[i].checked == true){
							params+=inpts[i].name+'='+inpts[i].value+'&';
							}
					}
						/*else
						params+=inpts[i].name+'='+inpts[i].value+'&';*/
					}
				}
	var x='index.php?option=com_userDetail&'+params
	//ajax(method,url,params,callBackFunction);
	location.href=x;
}
function deleteFav(){
	var c = confirm("Seçili kişileri favori Listesinden kaldırmak istediğinize eminmisiniz?");
	if (!c){return false;}
	var a='';

			var params='task=favList&act=del&';
				if(document.getElementsByTagName('input'))  {
					var inpts = document.getElementsByTagName('input');
					for ( i=0;i<inpts.length;i++){
						if(inpts[i].type == "checkbox"){
							
							if(inpts[i].checked == true){
							params+=inpts[i].name+'='+inpts[i].value+'&';
							a=1;
							}
					}
						/*else
						params+=inpts[i].name+'='+inpts[i].value+'&';*/
					}
				}
		
	var x='index.php?option=com_userDetail&'+params
	//ajax(method,url,params,callBackFunction);
	location.href=x;
}
function saveTema(f){
	valbutton(f)
	return false;
	/*
	var x='';
	x=document.f.tema.value;
	var params='index.php?option=com_userDetail&task=themes&act=save&temaID='+x;

alert(x);
	//location.href=params;
	return false;*/
}
function valbutton(f) {
	myOption = -1;
	for (i=0; i<f.tema.length; i++) {
	if (f.tema[i].checked) {
	myOption = i;
	
	x=f.tema[i].value;
	}
	}
	if (myOption == -1) {
	alert("Bir tema seçmelisiniz");
	return false;
	}
	var params='index.php?option=com_userDetail&task=themes&act=save&temaID='+x;
	location.href=params;	
return false;
	
	//f.submit();
}

function silSonuc(){
	alert(responseText)
	document.getElementById('userRelListTable').innerHTML=responseText;
}

function win(theURL,enboy) {
  	window.open(theURL,'picture',enboy);
}
function publishPoll(id){
	var params='index.php?option=com_userDetail&task=poll&act=publish&id='+id;
	location.href=params;
}
function getMyCat(){
	var method='GET';
	var callBackFunction='silSonuc';
	var url='index5.php';
	var params='';
	ajax(method,url,params,callBackFunction);
	alert(responseText);	
}


function cModuleTable(x){
	var $t='moduleDiv_'+x;
	var $y=document.getElementById($t).style.display;
	var $z=$y==''?'none':'';
	document.getElementById($t).style.display=$z;
}
function fTagPos(){
	var a=document.getElementById('li_tag_14').style.display
	var b=a==''?'none':'';
	for(var i=13;i<27;i++){
		document.getElementById('li_tag_'+i).style.display=b
		}

}
function closeInfoDiv(){
	document.getElementById('infoDiv').style.display='none';
	document.getElementById('infoDivKapat').style.display='';
}
function openInfoDiv(){
	document.getElementById('infoDiv').style.display='';
	document.getElementById('infoDivKapat').style.display='none';
	}
	
	function gdUserAction(userID,type){
		var x=userID;
		var y=type;
		var gdActLink=$mosConfig_live_site+"/index.php?option=com_action&userID="+x+"&task="+ y;
		window.open(gdActLink,'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=250,directories=no,location=no');
	}
		function gdUserComment(x,y,z){
		var gdActLink=$mosConfig_live_site+"/index.php?option=com_action&userID="+x+"&task="+ y+'&contentID='+z;
		window.open(gdActLink,'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=250,directories=no,location=no');
	
	}	
	
	
function WriteSWF(width, height, movie, wmode) {

	if (wmode == null) wmode = "window";

	var ht = '';

	ht += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">';

	ht += '<param name="movie" value="' + movie + '">';

	ht += '<param name="wmode" value="' + wmode + '">';

	ht += '<param name="Menu" value="false">';

	ht += '<param name="Quality" value="High">';

	ht += '<embed src="' + movie + '" quality=high ';

	ht += ' wmode="' + wmode + '" width="' + width + '" height="' + height + '"';

	ht += ' menu="false"';

	ht += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" >';

	ht += '</embed>';

	ht += '</object>';

	document.write(ht);

}	