// Initialise the effects
window.addEvent('domready', function() {
								 
//=========Local Path=============//
//var path = 'http://localhost/insite/';
//=========Server Path===========//
//var path = 'http://www.zanetine.com/insite/';
// HERE IS WHAT YOU READ IN JS CODE
/*$$('#top-buttons-box .animate-icon').each(function(e){
  var fade = new Fx.Style(e, 'opacity', {wait:false});
  fade.set(1);
  e.addEvent('mouseover', function(){
    fade.start(.5);
  });
  e.addEvent('mouseout', function(){
    fade.start(1);
  });
});*/


var list = $$('#top-buttons-box .animate-icon');
var list1 = $$('#bottom-buttons-mirror .animate-icon-mirror');
//--------After Page Load Animation----------------------//
j = 0;
list.each(function(e) {
var bounce = new Fx.Styles(e, {duration:1000, wait: false});
var bounceMirror = new Fx.Styles(list1[j], {duration:1000, wait: false});
			bounce.start({
				'opacity': [0, 1]
			});
			bounceMirror.start({
				'opacity': [0, 1]		
			});
j++;
});
//-------------------------------------------------//
//-------Roll Over Animations---------------------//
i = 0;
list.each(function(element) {
	var fx = new Fx.Styles(element, {duration:550, wait:false, transition:Fx.Transitions.circOut});
	var test = new Fx.Styles(list1[i], {duration:550, wait:false, transition:Fx.Transitions.circOut});
		element.addEvent('mouseenter', function(){
			fx.start({
				'margin-top': 15
			});
			test.start({
				'margin-top': 7,
				'opacity': [1, 0.2]
			});
		});
		element.addEvent('mouseleave', function(){
			fx.start({
				'margin-top': 22
			});
			test.start({
				'margin-top': 0,
				'opacity': [0.2, 1]
			});
		});
		i++;
});
//----------------------------------------------//

//-----------On CLick Animations and Events-----//
$('home-icon').addEvent('click',function(e) {
    $('inner-tube-left').setStyle('background', 'url(css/default/inner_tube_home.png) no-repeat');
	$('heading').setStyles({background:'url(css/default/welcome.png) no-repeat',display:'block'});
	$('error-notice').setHTML('&nbsp;');
	var matter = $('matter');
 	var url = "zanetine-web-design-india.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}.bind(this));
 
$('services-icon').addEvent('click',function(e) {
    $('inner-tube-left').setStyle('background','url(css/default/inner_tube_services.png) no-repeat');
	$('heading').setStyle('display','none');
	var matter = $('matter');
 	var url = "web20-ajax-development-services-india.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}.bind(this));

$('about-icon').addEvent('click',function(e) {
   $('inner-tube-left').setStyles({background: 'url(css/default/inner_tube_about.png) no-repeat',
								   opacity: '[0, 1]'});
   $('heading').setStyles({background:'url(css/default/about_heading.png) no-repeat', display:'block'});
   $('error-notice').setHTML('&nbsp;');
	var matter = $('matter');
 	var url = "about-web20-development-company.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}.bind(this));

$('contact-icon').addEvent('click',function(e) {
    $('inner-tube-left').setStyles({background:'url(css/default/inner_tube_contact.png) no-repeat'});
	$('heading').setStyles({background: 'url(css/default/contact_heading.png) no-repeat',display: 'block'});
	$('error-notice').setHTML('&nbsp;');
	var matter = $('matter');
 	var url ="contact-web-design-india.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}.bind(this));

$('contact-link').addEvent('click',function(e) {
    $('inner-tube-left').setStyle('background','url(css/default/inner_tube_contact.png) no-repeat');
	$('heading').setStyle('background','url(css/default/contact_heading.png) no-repeat');
	$('error-notice').setHTML('&nbsp;');
	var matter = $('matter');
 	var url ="contact-web-design-india.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}.bind(this));

});
//---Contact Link-----------//
function get_contact_page(e) {
    $('inner-tube-left').setStyle('background','url(css/default/inner_tube_contact.png) no-repeat');
	$('heading').setStyles({background: 'url(css/default/contact_heading.png) no-repeat',display: 'block'});
	var matter = $('matter');
 	var url ="contact-web-design-india.html";
	var updater = new Ajax(url, {
		method: 'get',
		update: 'matter',
		onRequest: function() {
			$('inner-tube-content').setStyle('opacity', 0.2);
		},
		onComplete: function() {
			$('inner-tube-content').setStyle('opacity', 1);
		}
	});
	// Finally, the request
	updater.request();
	e = new Event(e).stop();
}
//---------Tool Tip------//
function showToolTip(e,text){
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos-90 + 'px';
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';
}	

function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';
	
}
//------------------//s
