﻿

// ------------ Box Container
function BoxContainer_Open (Title)
{document.write('<div style="margin-top:3px;width:800px;height:50px;background-color:#F3F3F3;border:1px solid #D0D0D0;border-top:0px; filter:progid:DXImageTransform.Microsoft.Shadow(color=\'#D7D7D7\', Direction=135, Strength=7);direction:rtl;"><div><div style="float:right;"><img src="'+ImageDir+'container01.gif" width="13" height="20" /></div><div style="height:10px;border-bottom:1px solid #D0D0D0;float:right;padding:3px;font-family:Tahoma, Arial;font-size:8pt;font-weight:bold;width:120px">' + Title + '</div><div style="height:10px;float:right;border-top:1px solid #D0D0D0;border-right:1px solid #D0D0D0;width:660px"></div></div><div style="padding:10px">');}

function BoxContainer_Close ()
{document.write('</div></div>');}

//------------ Tab Container
var arrTabs = new Array( );
var iCounter=1;

var Browsers = navigator.userAgent.toLowerCase();
NS  = ( (Browsers.indexOf('mozilla')!=-1) && ( (Browsers.indexOf('spoofer')==-1) && (Browsers.indexOf('compatible') == -1) ) );
NS_std = ( (document.getElementById) && (!document.all) && (Browsers.indexOf("opera") == -1) );
IE = ( (Browsers.indexOf("msie") != -1) && (Browsers.indexOf("opera") == -1) );
OP = (Browsers.indexOf("opera") != -1);
stdBrowser=(document.getElementById) ? true : false;


function Tab_Open ()
{document.write('<div style="width:900px;"><div style="width:100%;padding:0px;"><div id="TabMenu" style="height:25px; font-family:Tahoma, Arial;font-size:8pt;font-weight:bold;width:100%;text-align:center;margin-right:8px;"></div>');}

function Tab_Close ()
{
	document.write('</div>');

	var strTabMenu='';

	for (var j = 1 ; j < iCounter ; j++)
	{
		strTabMenu += '<div id="tab'+j+'_on" style="';

/*
		if(stdBrowser || IE){
			j==1?strTabMenu+='visibility:visible;':strTabMenu+='visibility:hidden;';
		}
		else if(NS){
			j==1?strTabMenu+='visibility:show;':strTabMenu+='visibility:hide;';
		}
*/
j==1?strTabMenu+='display:;':strTabMenu+='display:none;';
	
		strTabMenu += '"><div style="width:11px;height:25px;float:right;background-image:url('+ImageDir+'b01.gif);background-repeat:repeat-x;"></div><div style="height:25px; background-image:url('+ImageDir+'b02.gif);background-repeat:repeat-x;float:right;"><div style="margin-top:6px;width:150px;">' + arrTabs[j] + '</div></div><div style="width:4px;height:25px;float:right;background-image:url('+ImageDir+'b03.gif);background-repeat:repeat-x;"></div></div>\n' +
					  '<div id="tab'+j+'" style="cursor:hand;';
		j==1?strTabMenu+='display:none;':strTabMenu+='display:;';
		strTabMenu += '" onclick="TabClick(\''+j+'\')"><div style="width:5px;height:25px;float:right; border-bottom:1px solid #9D9D9D;background-image:url('+ImageDir+'b04.gif)"></div><div style="height:25px; background-image:url('+ImageDir+'b05.gif);float:right; border-bottom:1px solid #9D9D9D;background-repeat:repeat-x;"><div style="margin-top:6px;width:157px;color:#FFFFFF">' + arrTabs[j] + '</div></div><div style="width:3px;height:25px;float:right; border-bottom:1px solid #9D9D9D;background-image:url('+ImageDir+'b06.gif);"></div></div>\n'+
					  '<div style="width:3px;height:25px; border-bottom:1px solid #9D9D9D;float:right;"></div>\n';
	}

	strTabMenu += '<div style="width:'+(860-(167*(iCounter-1)))+';height:25px; border-bottom:1px solid #9D9D9D;float:right;"></div>\n';


	document.getElementById('TabMenu').innerHTML = strTabMenu;
}

function TabContainer_Open (Title)
{
	arrTabs[iCounter] = Title;
	var str = '';
	str += '<div id="tabContent'+iCounter+'" style="padding:30px;margin:3px 0px 0px 0px;width:880;height:50px;background-color:#F3F3F3;border:1px solid #D0D0D0;filter:progid:DXImageTransform.Microsoft.Shadow(color=\'#D7D7D7\', Direction=135, Strength=7);';

/*		if(stdBrowser || IE){
			iCounter==1?str+='visibility:visible;':str+='visibility:hidden;';
		}
		else if(NS){
			iCounter==1?str+='visibility:show;':str+='visibility:hide;';
		}
*/

str += iCounter==1?str+='display:;':str+='display:none;';
	str += '">';
	document.write(str);
	iCounter++;
}

function TabContainer_Close ()
{document.write('</div>');}




function TabClick(id)
{
	for (var j=1 ; j < iCounter ; j++)
	{
		document.getElementById('tab'+j).style.display='';
		document.getElementById('tab'+j+'_on').style.display='none';
		document.getElementById('tabContent'+j).style.display='none';
		
	}
	document.getElementById('tab'+id+'_on').style.display='';
	document.getElementById('tab'+id).style.display='none';
	document.getElementById('tabContent'+id).style.display='';
}


/*
<div style="width:800px;"><div style="height:50px;width:100%;"><div style="height:25px; font-family:Tahoma, Arial;font-size:8pt;font-weight:bold;width:100%;text-align:center">

<div id="tab1_on" style="display:none"><div style="width:11px;height:100%;float:right;background-image:url('+ImageDir+'b01.gif);background-repeat:repeat-x;"></div><div style="height:100%; background-image:url('+ImageDir+'b02.gif);background-repeat:repeat-x;float:right;"><div style="margin-top:6px;width:150px;">برای امتحان یا برای تست</div></div><div style="width:4px;height:100%;float:right;background-image:url('+ImageDir+'b03.gif);background-repeat:repeat-x;"></div></div>
<div id="tab1" style="cursor:hand;" onclick="TabClick('1')"><div style="width:5px;height:100%;float:right; border-bottom:1px solid #9D9D9D;background-image:url('+ImageDir+'b04.gif)"></div><div style="height:100%; background-image:url('+ImageDir+'b05.gif);float:right; border-bottom:1px solid #9D9D9D;background-repeat:repeat-x;"><div style="margin-top:6px;width:157px;color:#FFFFFF">برای امتحان یا برای تست</div></div><div style="width:3px;height:100%;float:right; border-bottom:1px solid #9D9D9D;background-image:url('+ImageDir+'b06.gif);"></div></div>

</div><div id="tabContent01" style="margin-top:3px;width:100%;;background-color:#F3F3F3;border:1px solid #D0D0D0;filter:progid:DXImageTransform.Microsoft.Shadow(color='#D7D7D7', Direction=135, Strength=7);">sdfsadf</div></div>

*/