// JavaScript Document

var ieVersion=1;
var ffVersion=1.0;
var otherBrowser=0; // it will be 1, if the browser is neither IE nor FF.
var x=0;

if(isOldIE())
	x=x+1;
else
	otherBrowser=1;
if (isOldFF() && otherBrowser==1)
	x=x+1;
if(x==0)
	showTabs();
else
	showAlert();
	
function showAlert()
{
	var divTag = document.createElement('div'); 
	divTag.id = 'notifyContainer'; 
	document.body.appendChild(divTag);
	
	document.write("<link href='http://www.andmine.com/tabs/topWindowMsg.css' type='text/css' rel='stylesheet' />"); 
	document.write("<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'> </\script> \n");
	document.write("<script type='text/javascript' src='http://www.andmine.com/tabs/topWindowMsg.js'> </\script>");
	
	$(function() {
		notify.showFirstTime("<img src='http://www.andmine.com/tabs/alert_icon.png' width='1.2%' height='1.2%'> Andmine recommends you update your browser to the latest version now. "); });
}
function showTabs()
{
	//document.write("<script type='text/javascript' src='http://www.andmine.com/tabs/show_tabs.js'><\/script>");
	executeTabsCode();
}

function isOldIE()
{
	if(/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{
		ieVersion=new Number(RegExp.$1); // capture x.x portion and store as a number
		if(ieVersion<7)
		return true;
	}
	else
	{
		otherBrowser=1;
		return false;
	}		
}

function isOldFF()
{
	if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
	{
		ffVersion=new Number(RegExp.$1); //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
		if(ffVersion<3.5)
		return true;
	}
	return false;
}

function executeTabsCode(){
				if(andmine_tabs_side == "right"){
				document.write("<link href='http://www.andmine.com/tabs/andmine_tabs_r.css' type='text/css' rel='stylesheet' />");
				//document.write("<link href='http://localhost/andmine/tabs/andmine_tabs_r.css' type='text/css' rel='stylesheet' />");
				if(andmine_tabs.length > 0){
						document.write("<div id='andmine_tab_container' class='andmine_tab_rotateText'>");
						for(i=0;i<andmine_tabs.length;i++){
							
							var rounded_corner_bottom = "<div class='andmine_trans_grid'>"+
												"<table cellpadding='0' cellspacing='0' border='0'  ><tr>"+
													"<td class='andmine_transparent_0' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													
												"</tr><tr>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+	
												"</tr></table></div>";
													
							var rounded_corner_top = "<div class='andmine_trans_grid'>"+
												"<table cellpadding='0' cellspacing='0' border='0' ><tr>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_0' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr></table></div>";					
							
							if(navigator.appName == "Microsoft Internet Explorer"){
								
									if ( getInternetExplorerVersion() >= 7.0 )
									{
										var displayText = andmine_tabs[i][1];
										var letterCount = displayText.length;
										var calculatedWidth = 0;
										var validpattern = new RegExp('[A-Z]');
										var iLen = 0;var strChar="";
										//alert(letterCount);
										if(letterCount < 10)
										{
											for(iLen = 0; iLen <= letterCount; iLen++)
											{
												strChar = displayText[iLen];
												if (validpattern.test(strChar))
													calculatedWidth = calculatedWidth+16;
												else
													calculatedWidth = calculatedWidth+10;
											}
										}
										else							
											calculatedWidth = Math.ceil(letterCount*8);
										//alert(calculatedWidth);
									}
									document.write("<a href='"+andmine_tabs[i][2]+"' "+(andmine_tabs[i][4] == true?" target='_blank'":"")+" ><span class='andmine_tab' alt='"+andmine_tabs[i][5]+"' title='"+andmine_tabs[i][5]+"'><table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td width='3'>"+rounded_corner_bottom+"</td><td style='height:3px;background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a></td><td width='3'>"+rounded_corner_top+"</td></tr></table><div class='andmine_tab_bg' id='andmine_tab"+i+"' style='width: "+calculatedWidth+"px;'>");
								
							}
							else
							{
							
							
							
							document.write("<a href='"+andmine_tabs[i][2]+"' "+(andmine_tabs[i][4] == true?" target='_blank'":"")+" ><span class='andmine_tab' alt='"+andmine_tabs[i][5]+"' title='"+andmine_tabs[i][5]+"'><table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td width='3'>"+rounded_corner_bottom+"</td><td style='height:3px;background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a></td><td width='3'>"+rounded_corner_top+"</td></tr></table><div class='andmine_tab_bg' id='andmine_tab"+i+"'>");
							
							}
							/*document.write("<a href='"+andmine_tabs[i][2]+"' "+(andmine_tabs[i][4] == true?" target='_blank'":"")+" ><span class='andmine_tab' alt='"+andmine_tabs[i][5]+"' title='"+andmine_tabs[i][5]+"'><table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td width='3'>"+rounded_corner_bottom+"</td><td style='height:3px;background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a></td><td width='3'>"+rounded_corner_top+"</td></tr></table><div class='andmine_tab_bg' id='andmine_tab"+i+"'>");*/
						
						//if(andmine_tabs[i][0] != "No_Icon_Image")
							document.write("<span class='icon' id='icon_"+andmine_tabs[i][0]+"'></span>");
						
						document.write(andmine_tabs[i][1]+"</div></span></a>");
						
							
							
							
							_icon_elm = document.getElementById("icon_"+andmine_tabs[i][0]);
							//_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_r/"+andmine_tabs[i][0]+".png)";// no-repeat right;
							if(andmine_tabs[i][0] !=""  && andmine_tabs[i][0] != "No_Icon_Image"){
							//if(andmine_tabs[i][0] != "Own_Icon_Image")	
							//_icon_elm.style.backgroundImage ="url(uploaded_icons/"+andmine_tabs[i][6]+")";
							//else
							_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_r/"+andmine_tabs[i][0]+".png)";
							
							_icon_elm.style.backgroundRepeat ="no-repeat";
							_icon_elm.style.backgroundPosition = "right";
							}
							else{// if no image icon, then make sure that there is no extra space that would otherwise be occupied by the icon
									_icon_elm.style.backgroundImage ="none";
									_icon_elm.style.width="0px";
									document.getElementById("andmine_tab"+i).style.paddingRight="0px";
							}
							document.getElementById("andmine_tab"+i).style.backgroundColor = (andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc");

						}
						document.write("</div><!-- This website is using AndMine's Tabs - generate your own at <a href='http://andmine.com/tabs' alt='andmine.com' title='andmine.com'>www.andmine.com/tabs/</a> -->");
						window.onload = function(){
							document.getElementById('andmine_tab_container').style.display = 'block';
							
							if(navigator.appName == "Microsoft Internet Explorer"){
									_andmine_total_width = document.getElementById("andmine_tab_container").clientWidth ;
									if ( getInternetExplorerVersion() >= 7.0 )
										document.getElementById("andmine_tab_container").style.marginRight = (30-_andmine_total_width)+"px";
								
							};
							//document.getElementById('andmine_tab_container').style.display = 'block';
						}
						
					}
			}else if(andmine_tabs_side == "left"){
					if(navigator.appName == "Microsoft Internet Explorer")				
						leftTabsForIE();
					else
						leftTabsForOthers();
			}
}
function leftTabsForIE(){
document.write("<link href='http://www.andmine.com/tabs/andmine_tabs_ie.css' type='text/css' rel='stylesheet' />");
			if(andmine_tabs.length > 0){
				document.write("<div id='andmine_tab_container' class='andmine_tab_rotateText'>");
				for(i=andmine_tabs.length -1;i>=0;i--){
					document.write("<a href='"+andmine_tabs[i][2]+"' "+(andmine_tabs[i][4] == true?" target='_blank'":"")+" ><span class='andmine_tab' id='andmine_tab"+i+"' alt='"+andmine_tabs[i][5]+"' title='"+andmine_tabs[i][5]+"'><span class='andmine_tab_c_b_l'></span>"+andmine_tabs[i][1]);
					//if(andmine_tabs[i][0] != "No_Icon_Image")
				 		document.write("<span class='icon' id='icon_"+andmine_tabs[i][0]+"'></span>");
					document.write("<span class='andmine_tab_c_b_r'></span></span></a>");
					
					document.getElementById("andmine_tab"+i).style.backgroundColor = (andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc");
					//if(andmine_tabs[i][0] != "No_Icon_Image"){
						_icon_elm = document.getElementById("icon_"+andmine_tabs[i][0]);
						//_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_l/"+andmine_tabs[i][0]+".png)";// no-repeat right;
					if(andmine_tabs[i][0] !="" && andmine_tabs[i][0] != "No_Icon_Image"){
						_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_l/"+andmine_tabs[i][0]+".png)";
						_icon_elm.style.backgroundRepeat ="no-repeat";
						_icon_elm.style.backgroundPosition = "right";
					}
					else{// if no image icon, then make sure that there is no extra space that would otherwise be occupied by the icon
						_icon_elm.style.backgroundImage ="none";
						_icon_elm.style.width="0px";
						document.getElementById("andmine_tab"+i).style.paddingRight="3px";
					}
				}
				document.write("</div><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a><!-- This website is using AndMine's Tabs - generate your own at <a href='http://andmine.com/tabs' alt='andmine.com' title='andmine.com'>www.andmine.com/tabs/</a> --> ");		
				window.onload = function(){
					_andmine_total_width = document.getElementById("andmine_tab_container").offsetWidth;
					document.getElementById('andmine_tab_container').style['-webkit-transform'] = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
					document.getElementById('andmine_tab_container').style.MozTransform = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
					document.getElementById('andmine_tab_container').style['-o-transform'] = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
					//document.getElementById('andmine_tab_container').style.display = 'block';
					};	
					
			}
}

function leftTabsForOthers(){
	document.write("<link href='http://www.andmine.com/tabs/andmine_tabs.css' type='text/css' rel='stylesheet' />");
					if(andmine_tabs.length > 0){
						document.write("<div id='andmine_tab_container' class='andmine_tab_rotateText'>");
						for(i=andmine_tabs.length -1;i>=0;i--){
							
							var rounded_corner_bottom = "<div class='andmine_trans_grid'>"+
												"<table cellpadding='0' cellspacing='0' border='0'  ><tr>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td class='andmine_transparent_0' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr></table></div>";
												
					var rounded_corner_top = "<div class='andmine_trans_grid'>"+
												"<table cellpadding='0' cellspacing='0' border='0' ><tr>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr><tr>"+
													"<td class='andmine_transparent_92' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_66' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
													"<td class='andmine_transparent_0' style='background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";'></td>"+
												"</tr></table></div>";					
							
							document.write("<a href='"+andmine_tabs[i][2]+"' "+(andmine_tabs[i][4] == true?" target='_blank'":"")+" ><span class='andmine_tab'  alt='"+andmine_tabs[i][5]+"' title='"+andmine_tabs[i][5]+"'><div class='andmine_tab_bg' id='andmine_tab"+i+"'>"+andmine_tabs[i][1]);
							//if(andmine_tabs[i][0] != "No_Icon_Image")
								document.write("<span class='icon' id='icon_"+andmine_tabs[i][0]+"'></span>");
							//document.write("<span class='andmine_tab_c_b_l'>"+rounded_corner_bottom+"</span><div style='background-color:blue; height:3px; width:100%; float:left;'></div><span class='andmine_tab_c_b_r'>"+rounded_corner_top+"</span></span></a>");
							document.write("</div><table cellspacing='0' cellpadding='0' border='0' width='100%' height='2'><tr><td width='3'>"+rounded_corner_bottom+"</td><td style='height:3px;background-color:"+(andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc")+";' ><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a></td><td width='3'>"+rounded_corner_top+"</td></tr></table></span></a>");
							
							document.getElementById("andmine_tab"+i).style.backgroundColor = (andmine_tabs[i][3].length >0?andmine_tabs[i][3]:"#6772bc");
							
							//if(andmine_tabs[i][0] != "No_Icon_Image"){
								_icon_elm = document.getElementById("icon_"+andmine_tabs[i][0]);
								//_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_l/"+andmine_tabs[i][0]+".png)";// no-repeat right;
								if(andmine_tabs[i][0] !="" && andmine_tabs[i][0] != "No_Icon_Image"){
								_icon_elm.style.backgroundImage ="url(http://www.andmine.com/tabs/icons_l/"+andmine_tabs[i][0]+".png)";
								_icon_elm.style.backgroundRepeat ="no-repeat";
								_icon_elm.style.backgroundPosition = "right";
							}
								else{ // if no image icon, then make sure that there is no extra space that would otherwise be occupied by the icon
									_icon_elm.style.backgroundImage ="none";
									_icon_elm.style.width="0px";
									document.getElementById("andmine_tab"+i).style.paddingRight="3px";
								}
						}
						document.write("</div><a href='http://andmine.com'><img src='http://www.andmine.com/tabs/spacer.gif' width='1' height='1' border='0'></a><!-- This website is using AndMine's Tabs - generate your own at <a href='http://andmine.com/tabs' alt='andmine.com' title='andmine.com'>www.andmine.com/tabs/</a> --> ");		
						window.onload = function(){
							_andmine_total_width = document.getElementById("andmine_tab_container").offsetWidth;
							document.getElementById('andmine_tab_container').style['-webkit-transform'] = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
							document.getElementById('andmine_tab_container').style.MozTransform = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
							document.getElementById('andmine_tab_container').style['-o-transform'] = 'translateY('+_andmine_total_width+'px) rotate(-90deg)';
							document.getElementById('andmine_tab_container').style.display = 'block';
							};	
							
					}
}
function getInternetExplorerVersion(){

   var rv = -1; // Return value assumes failure.
   if (navigator.appName == 'Microsoft Internet Explorer')
   {
      var ua = navigator.userAgent;
      var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
      if (re.exec(ua) != null)
         rv = parseFloat( RegExp.$1 );
   }
   return rv;
}
