function switchTab(showNo){
	unset('tab', 3, 'setActive');
	unset('t', 3, 'hide', '');
	
	document.getElementById('t' + showNo).style.display = 'block';
	document.getElementById('tab' + showNo).className  = 'active';
	
	return false;
}

function unset(prefix, count, action, extra){	
	for(i = 0; i<count; i++){
		o = document.getElementById(prefix + i);
		switch(action){
			case 'hide':
				o.style.display = 'none';
				break;
			case 'setActive':
				o.className  = extra;
				break
		}		
	}
}

function makePopup(windowPosX,windowPosY,windowName,url,name,w,h,extra){
	var titlebarHeight = 28;
	str="height="+h+",width="+w+","+extra;
	if(parseInt(navigator.appVersion)>3) // supports screen.width
		if (windowPosX == -1) {
			str+=",left=" + (screen.width -w)/2 + ",top=" + parseInt(((screen.height -h)-titlebarHeight)/2);
		}
		else {
			str+=",left="+windowPosX+",top="+windowPosY;
		}
	var k = eval(windowName + "=window.open('" + url + "','" + name + "','" + str + "')");
	return k;
}

function openPop(url,width,height) {
	ak_pop = makePopup(-1,-1,'tab', url,'tab',width,height,'scrollbars=yes');		
	ak_pop.focus();	
}

function openPhotogallery(url) {
	ak_pop = makePopup(-1,-1,'tab', url,'tab',600,800,'scrollbars=yes');		
	ak_pop.focus();	
	return false;
}
