var currentPanel = '';
var currentText = '';
var currentTab = '';


function hilite(tab){
	tab.style.backgroundColor = '#465c6e';
	tab.style.color="#91a8bc";
}

function unhilite(tab){
	tab.style.backgroundColor = '#91a8bc';
	tab.style.color="#000000";
}

function confirmdelete(message){
	//app.alert (cMessage, [nIcon], [nType]) 
	if(confirm(message + "\n\nAre you sure?")){
		return true;
		//alert('yes');
	}else{
		return false;
		//alert('no');
	}
}

function checkinput(user){
	confirm('nothing');
}

function tab1(id,src,top,left,width,height){
	this.id = id;
	this.src = src;
	this.top = top;
	this.left = left;
	this.width = width;
	this.height = height;
}

	
//panel constructor
function panel(id, src,top,left,width,height){
	this.id = id;
	this.src = src;
	this.top = top;
	this.left = left;
	this.width = width;
	this.height = height;
}

function paneltext(id,src,top,left,width,height){
	this.id = id;
	this.src = src;
	this.top = top;
	this.left = left;
	this.width = width;
	this.height = height;
}

//tabPanel constructor
function tabPanel(tab1, panel, paneltext){
	this.tab1 = tab1;
	this.panel = panel;
	this.paneltext = paneltext;
	this.writeTabPanel = writeTabPanel;
}

function hideBig(tab,panel){
	//alert(panel.width);
	hidePanel(currentPanel);
	panel.style.visibility = 'hidden';
	//document.getElementById(panel).style.visibility = 'visible';
	currentPanel = panel;
	//setState(tab);
	currentTab = tab;
	panel0.style.visibility = 'visible';
}
function showBig(tab,panel,paneltext){
	//alert(panel);
	hidePanel(currentPanel);
	hideText(currentText);
	document.getElementById(panel.id).style.visibility = 'visible';
	document.getElementById(paneltext.id).style.visibility = 'visible';
	//panel.style.visibility = 'visible';
	currentPanel = panel;
	currentText = paneltext;
	//setState(tab);
	currentTab = tab;
}

function showPanel(tab,panel){
	hidePanel(currentPanel);
	document.getElementById(panel).style.visibility = 'visible';
	currentPanel = panel;
	setState(tab);
	currentTab = tab;
}
function hidePanel(panel){
	if(currentPanel!='')
		panel.style.visibility = 'hidden';
}

function hideText(paneltext){
	if(currentText!='')
		paneltext.style.visibility = 'hidden';
}

function writeTabPanel(){
	
var tpText = '';
tpText += '<div style="position:absolute">'

tpText += '<div style="position:relative" id="';
tpText += this.tab1.id;
tpText += '" class="tab1" style="top:';
tpText += this.tab1.top;
tpText += 'px;left:';
tpText += this.tab1.left;
tpText += 'px;width:';
tpText += this.tab1.width;
tpText += 'px;height:';
tpText += this.tab1.height;
tpText += '"';
tpText += ' onMouseOver="javascript:showBig(' + this.tab1.id + ','+ this.panel.id + ','+ this.paneltext.id + ');">';
tpText += '<span class="pageno">' + this.panel.id.charAt(5) + this.panel.id.charAt(6)+ '</span>';
tpText += '<br/><img src="';
tpText += this.tab1.src;
tpText += '" height="' + this.tab1.height + '" width="' + this.tab1.width;
tpText += '"></div>';

tpText += '<div style="visibility:hidden;position:absolute" id="';
tpText += this.paneltext.id;
tpText += '" class="paneltext" style="top:';
tpText += this.paneltext.top;
tpText += ';left:';
tpText += this.paneltext.left;
tpText += 'px;width:';
tpText += this.paneltext.width;
tpText += ';height:';
tpText += this.paneltext.height;
tpText += '">';
tpText += this.paneltext.src;
tpText += '</div>';

tpText += '<div style="visibility:hidden;position:relative" id="';
tpText += this.panel.id;
tpText += '" class="panel" style="top:';
tpText += this.panel.top;
tpText += ';left:';
tpText += this.panel.left;
tpText += 'px;width:';
tpText += this.panel.width;
tpText += ';height:';
tpText += this.panel.height;
tpText += '"><img src="';
tpText += this.panel.src;
tpText += '" height="';
tpText += this.panel.height;
tpText += '" width="';
tpText += this.panel.width;
tpText += '"></div>';

tpText += '</div>';

document.write(tpText);}
			