// JavaScript Document
// ajax register
if ( typeof XMLHttpRequest != "undefined" )
	{
	var Ajax	=	new XMLHttpRequest();	
	}
else if ( window.ActiveXObject )
	{
		var aVersions = ["MSXML2.XMLHTTP.5.0","MSXML.XMLHTTP.4.0","MSXML.XMLHTTP.3.0","MSXML.XMLHTTP","Microsoft.XMLHTTP"];
		for ( var i = 0 ; i < aVersions.length; i++ )
			{
			try {
				var Ajax = new ActiveXObject(aVersions[i])	;
				} catch (oError) { }
			}
	}
if ( !Ajax )
	{
	alert("ajax nasb nashode.");	
	} 
// neshan dadan form ozviat
function showformregisterbanner()
{ document.getElementById("show_error1").innerHTML ="";
  document.getElementById("show_error").innerHTML ="";	
 document.getElementById("show_html").innerHTML ="<img src='img/body/90c.gif'>";
var url = "members/registerbanner.php";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			}
		}
	}
	Ajax.send(null);
}
//panjere popup baray upload kardan banner
function PopUp(url_pop,name,etc) {

Yaldex=window.open(url_pop,'upload','width=500,height=380,left=100,top=100');
Yaldex.focus();
}


//sabt banner dar paygah dadeh 
function registerbanner(titlebanner,siteurl,typebanner)
{
   window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/registerbanner.php?titlebanner="+titlebanner+"&siteurl="+siteurl+"&typebanner="+typebanner;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_error").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}



// neshan dadan form taghir password
function showformchangepassword()
{
  document.getElementById("show_error").innerHTML ="";	
 document.getElementById("show_html").innerHTML ="<img src='img/body/90c.gif'>";
var url = "members/changepassword.php";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			}
		}
	}
	Ajax.send(null);
}


//change password karbar 
function changepassword(passnow,passnew,repassnew)
{
   
   window.document.getElementById('show_error').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/changepassword.php?passnow="+passnow+"&passnew="+passnew+"&repassnew="+repassnew;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				
				document.getElementById("show_error").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}



// neshan dadan formdelete and edit banner
function editanddelete()
{
  document.getElementById("show_error1").innerHTML ="";

 document.getElementById("show_error").innerHTML ="";
 document.getElementById("show_html").innerHTML ="<img src='img/body/90c.gif'>";
var url = "members/editanddelbanner.php";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			}
		}
	}
	Ajax.send(null);
}

//check kardan baray hazf banner
function checkdelete(check,code)
{
 if(check==true)
{


window.document.getElementById('show_error').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/deletebanner.php?code="+code;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_error").innerHTML="";
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}

}


// neshan dadan form and edit banner
function showformedit(code)
{
 window.document.getElementById('show_error1').innerHTML="";
 document.getElementById("show_error").innerHTML ="<img src='img/body/90c.gif'>";
var url = "members/editbanner.php?code="+code;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_error").innerHTML = Ajax.responseText ;
			}
		}
	}
	Ajax.send(null);
}


//edit banner dar paygah dadeh 
function editbanner(siteurl,typebanner,codebanner)
{
   
   window.document.getElementById('show_error1').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/sabteditbanner.php?siteurl="+siteurl+"&typebanner="+typebanner+"&codebanner="+codebanner;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_error1").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}

//nemayesh amar baner ha 
function showamarbanners()
{
   window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/panel.php?";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_amar").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}


//daryaft code gharar dadan banners 
function givecode()
{
   window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/givecode.php?";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}


//daryaft code moarefi karbaran be system 
function moarref()
{
   window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/moarref.php?";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}








//neshan dadan form kharid bazdid 
function bazdid()
{
   window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='../img/body/90c.gif'>";
   var url = "members/buy.php";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}

function sabtkharidbazdid(numbercart,date1,numberfish,class1,sabt)
{
   
    window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/buy.php?numbercart="+numbercart+"&date1="+date1+"&numberfish="+numberfish+"&class1="+class1+"&sabt="+sabt;
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}



//nemayesh amar click ve nemayesh banner dar web site karbaran
function amarmysite()
{
   
    window.document.getElementById('show_error1').innerHTML="";
   window.document.getElementById('show_error').innerHTML="";
   window.document.getElementById('show_html').innerHTML="<img    src='img/body/90c.gif'>";
   var url = "members/amarmysite.php";
Ajax.open("GET",url,true);
Ajax.onreadystatechange = function()
	{
	if ( Ajax.readyState == 4 )
		{
		if ( Ajax.status == 200 )
			{
				document.getElementById("show_html").innerHTML = Ajax.responseText ;
			   
			}
		}
	}
	Ajax.send(null);
}




