
var Site =
{
	prc: function()
	{
		new Ajax.Request('pagerank', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'getpr',
					'url' : $('url').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
					
//					if (antext != 'קוד האישור שהוכנס אינו נכון')
//					{
//						$('capimage').src = 'cap.php?'+Math.random();
//					}
				}
		});
	
	},
	alexa : function()
	{
		new Ajax.Request('alexarank', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'getalexa',
					'url' : $('url').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
					
//					if (antext != 'קוד האישור שהוכנס אינו נכון')
//					{
//						$('capimage').src = 'cap.php?'+Math.random();
//					}
				}
		});
	},
	textratio : function()
	{
		new Ajax.Request('textratio', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'getratio',
					'url' : $('url').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
 
				}
		});
	},
	keyword_analyzer : function()
	{
		new Ajax.Request('keyword_analyzer', 
				{
			method: 'post',
			parameters: 
			{
			'do' : 'getKeyWords',
			'url' : $('url').value, 
			'text' : $('text').value 
			},
			onLoading: function() 
			{
				$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
			},
			onComplete: function(answer) 
			{
				antext = answer.responseText;
				$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
				
			}
				});
	},
	links : function()
	{
		new Ajax.Request('incominglinks', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'getlinks',
					'url' : $('url').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
					
//					if (antext != 'קוד האישור שהוכנס אינו נכון')
//					{
//						$('capimage').src = 'cap.php?'+Math.random();
//					}
				}
		});
	},
	headercheck : function()
	{
		new Ajax.Request('headerscheck', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'getheaders',
					'url' : $('url').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
//					
//					if (antext != 'קוד האישור שהוכנס אינו נכון')
//					{
//						$('capimage').src = 'cap.php?'+Math.random();
//					}
				}
		});
	},
	ipcheck : function()
	{
		new Ajax.Request('ipcheck', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'doipcheck',
					'url' : $('url').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
					
//					if (antext != 'קוד האישור שהוכנס אינו נכון')
//					{
//						$('capimage').src = 'cap.php?'+Math.random();
//					}
				}
		});
	},	
	position : function()
	{
		new Ajax.Request('position', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'doposcheck',
					'url' : $('url').value,
					'word' : $('word').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
 
				}
		});
	},
	csscompressor : function()
	{
		new Ajax.Request('csscopressor', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'docompress',
					'data' : $('data').value 
//					'capcode' : $('capcode').value 
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					$('data').value = antext
					$('res').innerHTML = '<strong>התוכן עודכן בהצלחה</strong>';
					
 
				}
		});
	},
	
	sleepmode : 0,
	update_sleep: function()
	{
		Site.sleepmode = Site.sleepmode+1;
	},
	domaincheck : function()
	{
		var dname = $('dname').value
		
		if (dname.length >= 3 )
		{
			var s = setInterval('Site.update_sleep()', 100);
			
			//alert('starting checking')
		}
		
		if (Site.sleepmode >= 9)
		{
			window.clearInterval(s);
			Site.do_domaincheck()
		}
		
	},
	do_domaincheck: function()
	{
		if ($('dname').value.length >= 3 )
		{
			new Ajax.Request('domaincheck', 
			{
				method: 'post',
					parameters: 
					{
						'do' : 'getdomaininfo',
						'domain' : $('dname').value, 
						'ext1' : $('ext1').value, 
						'ext2' : $('ext2').value, 
						'ext3' : $('ext3').value, 
						'ext4' : $('ext4').value 
					},
					onLoading: function() 
					{
						$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
					},
					onComplete: function(answer) 
					{
						antext = answer.responseText;
						$('res').innerHTML = '<strong>'+answer.responseText+'</strong>';
						
 
					}
			});
		}
	},
	SendContact: function()
	{
		new Ajax.Request('contactus', 
		{
			method: 'post',
				parameters: 
				{
					'do' : 'sendmail',
					'username' : $('username').value, 
					'email' : $('email').value, 
					'subject' : $('subject').value, 
					'text' : $('text').value, 
					'capcode' : $('capcode').value
				},
				onLoading: function() 
				{
					$('res').innerHTML = '<img src="./images/ajaxloader.gif" alt="" />';
				},
				onComplete: function(answer) 
				{
					antext = answer.responseText;
					
					if (antext == '1')
					{
						$('Cwarper').innerHTML = 'הודעתך נשלחה בהצלחה.'
					}
					else if(antext == '0')
					{
						antext = 'ארעה שגיאה בעת שליחת ההודעה, אנא נסה שוב מאוחר יותר';
					}
					$('res').innerHTML = '<strong>'+antext+'</strong>';
					

				}
		});
	}
	
	
}