// JavaScript Document
var init_tab = '', over_tab = '', out_tab = '';

var is_clicked = false;
var init_tabbar_css = 'tabbartw';

show_init_popup = function() {
	var init_popup = Dom.get("init_popup");
	if (init_popup) {
		var show_pop = new YAHOO.widget.Panel("init_popup", 
			{ 
				width:"640px",
				fixedcenter:true,  
				close:true,
				draggable:false,
				zindex: 51,
				modal:true,
				visible:false,
				iframe:true
			}
		);
		show_pop.render();
		if (!readCookie('show_init_popup')) {
			show_pop.show();
			createCookie('show_init_popup','waarde',1);
		}
	}
};

function createCookie(name,value,hours) {
	if (hours) {
		var date = new Date();
		date.setTime(date.getTime()+(hours*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


shop_init = function() { 
	show_init_popup();

	if (Dom.get('emptybar')) {
		var init_tabbar_css = Dom.get('emptybar').className;
		var tabbar_over = function(e) {
			var hover_id = this.id;
			hover_id = hover_id.replace('tab-', '');
			
			Dom.get('emptybar').className = 'tabbar' + hover_id;
		};
	
		var tabbar_out = function(e) {
			Dom.get('emptybar').className = init_tabbar_css;
		};
	
		var ulshops = Dom.get('ulshops');
		if (ulshops) {
			var shoptabs = ulshops.getElementsByTagName('LI');
			Event.on(shoptabs, 'mouseover', tabbar_over);
			Event.on(shoptabs, 'mouseout', tabbar_out);
		}
	}

	personal_init();
};

Event.onDOMReady(shop_init);
