
/////////////////////////////////////////////////////
//
//
// Global Variables
//
//
////////////////////////////////////////////////////


var content; //Y Series Evaluatin Kit Content
//Opacity
var time = 0;  // Opacity Fade In
var timeOut= 100; // Opacity Fade Out
var t; // Timer
var flagIn = 0;
var flagOut = 0;
//fadeFlag
//0 = Fade out
//1 = Fade in
var fadeFlag = 0;
var fadeInitialSetting = 0;
var fadeProgress = 0;
var typeBrowser = browserType();// Browser Check





/////////////////////////////////////////////////////
//
//
// Onload
//
//
////////////////////////////////////////////////////


window.onload=function(){
	commonFeatures(1);
	specificationList(0);
	WhatsIncluded(0);
}



/////////////////////////////////////////////////////
//
//
// Submenu Control
//
//
////////////////////////////////////////////////////


function switchMenu(obj)
{
	if(obj=='commonFeatures')
	{
		commonFeatures(1);
		specificationList(0);
		WhatsIncluded(0);
		//border(obj);
		menuBox(obj);
	}
	else if(obj=='specificationList')
	{
		commonFeatures(0);
		specificationList(1);
		WhatsIncluded(0);
		//border(obj);
		menuBox(obj);
	}
	else if(obj=='WhatsIncluded')
	{
		commonFeatures(0);
		specificationList(0);
		WhatsIncluded(1);
		//border(obj);
		menuBox(obj);
	}
	
}

function commonFeatures(status)
{
	
	if(status==1)
	{
		document.getElementById('evaulationMain').style.display = 'inline';
		
	}
	else if(status==0)
	{
		document.getElementById('evaulationMain').style.display = 'none';
	}
}

function specificationList(status)
{
	
	if(status==1)
	{
		document.getElementById('specificationList').style.display = 'inline';
		
	}
	else if(status==0)
	{
		document.getElementById('specificationList').style.display = 'none';
	}
}
function WhatsIncluded(status)
{
	
	if(status==1)
	{
		document.getElementById('WhatsIncluded').style.display = 'inline';
		
	}
	else if(status==0)
	{
		document.getElementById('WhatsIncluded').style.display = 'none';
	}
}
function border(id)
{
	
	if(id=='commonFeatures')
	{
		document.getElementById('features2').style.borderBottom = 'none';
		document.getElementById('specification').style.borderBottom = '#000000 2px solid';
		document.getElementById('VAS').style.borderBottom = '#000000 2px solid';
	}
	else if(id=='specificationList')
	{
		document.getElementById('features2').style.borderBottom = '#000000 2px solid';
		document.getElementById('specification').style.borderBottom = 'none';
		document.getElementById('VAS').style.borderBottom = '#000000 2px solid';
	}
	else if(id=='WhatsIncluded')
	{
		document.getElementById('features2').style.borderBottom = '#000000 2px solid';
		document.getElementById('specification').style.borderBottom = '#000000 2px solid';
		document.getElementById('VAS').style.borderBottom = 'none';
	}
}

function menuBox(id)
{
	
	if(id=='commonFeatures')
	{
		document.getElementById('features2').innerHTML = '<h3 id="subMenuFrame"><a href="javascript: void(0)" onClick="switchMenu(\'commonFeatures\');">Overview</a></h3>';
		document.getElementById('features2').style.backgroundColor = '#FF6600';
		
		document.getElementById('specification').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'specificationList\');">Features</a></h3>';
		document.getElementById('specification').style.backgroundColor = '#FFFFFF';
		
		document.getElementById('VAS').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'WhatsIncluded\');">What\'s Included</a></h3>';
		document.getElementById('VAS').style.backgroundColor = '#FFFFFF';
	}
	else if(id=='specificationList')
	{
		document.getElementById('features2').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'commonFeatures\');">Overview</a></h3>';
		document.getElementById('features2').style.backgroundColor = '#FFFFFF';
		
		document.getElementById('specification').innerHTML = '<h3 id="subMenuFrame"><a href="javascript: void(0)" onClick="switchMenu(\'specificationList\');">Features</a></h3>';
		document.getElementById('specification').style.backgroundColor = '#FF6600';
		
		document.getElementById('VAS').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'WhatsIncluded\');">What\'s Included</a></h3>';
		document.getElementById('VAS').style.backgroundColor = '#FFFFFF';
	}
	else if(id=='WhatsIncluded')
	{
		document.getElementById('features2').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'commonFeatures\');">Overview</a></h3>';
		document.getElementById('features2').style.backgroundColor = '#FFFFFF';
		
		document.getElementById('specification').innerHTML = '<h3 id="topicHeading"><a href="javascript: void(0)" onClick="switchMenu(\'specificationList\');">Features</a></h3>';
		document.getElementById('specification').style.backgroundColor = '#FFFFFF';
		
		document.getElementById('VAS').innerHTML = '<h3 id="subMenuFrame"><a href="javascript: void(0)" onClick="switchMenu(\'WhatsIncluded\');">What\'s Included</a></h3>';
		document.getElementById('VAS').style.backgroundColor = '#FF6600';
	}
}

/////////////////////////////////////////////////////
//
//
// Main Evaluation Kit Images
//
//
////////////////////////////////////////////////////



function allClear()
{
	document.getElementById('evalutionImageTextModel').innerHTML = '';
}

function CUE_Y1A_24063(num)
{
	if(num ==0)
	{
		var kitModel = 'CUE-Y1A-24063';	
		var VFDModel = 'CU24063-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24063-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24063.jpg) no-repeat";
	}
	else if(num ==1)
	{
		var kitModel = 'CUE-Y100-24063';	
		var VFDModel = 'CU24063-Y100';
		var kitInterface = 'RS232 logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24063-y1a-2.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y100-24063.jpg) no-repeat";
	}
	else
	{
		var kitModel = 'CUE-Y1A-24063';	
		var VFDModel = 'CU24063-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24063-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24063.jpg) no-repeat";
	}
	content = "<h2 id='seriesHeading2'>"+kitModel+"</h2>"+
                //"<h2 id='evaluationAvailFeatures'><a href='http://www.noritake-elec.com/y-series.htm'>CU24063-Y1A</a> Evaluation Kit</h2>"+
                "<h3 id='topicDescription'>New 24x6 character display,"+
                "<br>"+VFDModel+" showcases it's classic  "+
                "<br>look of the character display with the"+
                "<br>blend of square dots and short dot pitch"+
                "<br>found in the graphic display."+
				"<br>"+kitInterface+
                "<br>"+
                "</h3>"+
                "<br>"+
                kitLink; 
	
		
	//Change the content
	document.getElementById('evalutionImageTextModel').innerHTML = content;
	//Change the image
	//document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24063.jpg) no-repeat";
	
	
	
}

function CUE_Y1A_20027(num)
{
	if(num ==0)
	{
		var kitModel = 'CUE-Y1A-20027';	
		var VFDModel = 'CU20027-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu20027-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-20027.jpg) no-repeat";
	}
	else if(num ==1)
	{
		var kitModel = 'CUE-Y100-20027';	
		var VFDModel = 'CU20027-Y100';
		var kitInterface = 'RS232 logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu20027-y1a-2.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y100-20027.jpg) no-repeat";
	}
	else
	{
		var kitModel = 'CUE-Y1A-20027';	
		var VFDModel = 'CU20027-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu20027-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-20027.jpg) no-repeat";
	}
	content = "<h2 id='seriesHeading2'>"+kitModel+"</h2>"+
               //"<h2 id='evaluationAvailFeatures'><a href='http://www.noritake-elec.com/y-series.htm'>CU20027-Y1A</a> Evaluation Kit</h2>"+
                "<h3 id='topicDescription'>"+
                "New to the Y Series, "+VFDModel+" joins"+
                "<br>the family of 20x2 character displays. "+
                "<br>"+VFDModel+" has the same footprint"+
                "<br>as the popular 20x2 LCD and 20x2"+
                "<br>U Version display with the selectable"+
                "<br>font sizes and highlight function."+
				"<br>"+kitInterface+
				"</h3>"+
                "<br>"+
                kitLink;	
	
	//Change the content
	document.getElementById('evalutionImageTextModel').innerHTML = content;
	//Change the image
	//document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-20027.jpg) no-repeat";
	
}

function CUE_Y1A_24043(num)
{
	if(num ==0)
	{
		var kitModel = 'CUE-Y1A-24043';	
		var VFDModel = 'CU24043-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24043-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24043.jpg) no-repeat";
	}
	else if(num ==1)
	{
		var kitModel = 'CUE-Y100-24043';	
		var VFDModel = 'CU24043-Y100';
		var kitInterface = 'RS232 logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24043-y1a-2.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y100-24043.jpg) no-repeat";
	}
	else
	{
		var kitModel = 'CUE-Y1A-24043';	
		var VFDModel = 'CU24043-Y1A';
		var kitInterface = 'CMOS logic signal VFD module';
		var kitLink = "<a href='http://noritake-vfd.com/evaluationkitcu24043-y1a.aspx'><img src='images/icons/addToCart.jpg' border='0'></a>";
		//Change the image
		document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24043.jpg) no-repeat";
	}
	content = "<h2 id='seriesHeading2'>"+kitModel+"</h2>"+
                //"<h2 id='evaluationAvailFeatures'><a href='http://www.noritake-elec.com/y-series.htm'>CU24043-Y1A</a> Evaluation Kit</h2>"+
                "<h3 id='topicDescription'>"+
                "All new 24x4 character display"+
                "<br>"+VFDModel+" has the same "+
                "<br>footprint as popular 20x2 LCD "+
                "<br>and displays total of 96 characters, "+
                "<br>over 2x the character on the 20x2 LCD."+
                "<br> "+kitModel+" is 1U rack compatible."+
				"<br>"+kitInterface+
                "</h3>"+
                "<br>"+
                kitLink;	
	
	//Change the content
	document.getElementById('evalutionImageTextModel').innerHTML = content;
	//Change the image
	//document.getElementById('evalutionBgImage').style.background = "url(images/evaluationKit/ySeries/CUE-Y1A-24043.jpg) no-repeat";
	
}




/////////////////////////////////////////////////////
//
//
// Fade In
//
//
////////////////////////////////////////////////////

//While TEST


function fadeOutIn(model)
{
	if (fadeProgress == 0) // Check if the transition is in session
	{
		t=setInterval("fadeOutfadeIn("+model+")",1);
	}
	else if(fadeProgress == 1) // interrupt
	{
		clearInterval(t); // Stop the interval
		//time = 0; //Reset Timer
		fadeFlag = 0; //Clear flag
		fadeInitialSetting = 0; //reset the inital setting flag for fade in
		t=setInterval("fadeOutfadeIn("+model+")",1);
	}
	
	
}

function fadeOutfadeIn(model)
{
	
	
	if(fadeFlag == 0 && fadeInitialSetting == 0) //Initial counter setting
	{
		fadeInitialSetting = 1;
		if(fadeProgress == 0)
		{
			time = 25; // Set timer
			fadeProgress = 1; //Set the progress flag to busy
		}
	}
	else if(fadeFlag == 1 && fadeInitialSetting == 0)
	{
		
		if(model ==0)
		{
			CUE_Y1A_24043(0); // Replace BG to CUE-Y1A-24043
		}
		else if(model ==1)
		{
			CUE_Y1A_24063(0); // Replace BG to CUE-Y1A-24063
		}
		else if(model ==2)
		{
			CUE_Y1A_20027(0); // Replace BG to CUE-Y1A-20027
		}
		else if(model ==3)
		{
			CUE_Y1A_24043(1); // Replace BG to CUE-Y1A-24043
		}
		else if(model ==4)
		{
			CUE_Y1A_24063(1); // Replace BG to CUE-Y1A-24063
		}
		else if(model ==5)
		{
			CUE_Y1A_20027(1); // Replace BG to CUE-Y1A-20027
		}
		else
		{
			CUE_Y1A_24063(); // Replace BG to CUE-Y1A-24063
		}
		
		fadeInitialSetting = 1;
	}
	else if(fadeFlag == 2 && fadeInitialSetting == 0)
	{
		time = 0; // Set timer
		fadeInitialSetting = 1;
	}
	
	if(fadeFlag == 0 && fadeInitialSetting == 1) //Fade out
	{	
		
		if(time >= 0)
		{
			if (typeBrowser==0)
			{
				document.getElementById('evalutionBgImage').filters.alpha.opacity=time*4;
			}
			else
			{
				document.getElementById('evalutionBgImage').style.opacity=(time/100)*4;
			}
			time -= 1; 
		}
		else
		{
			time = 0; 
			fadeFlag = 1; //Clear flag
			fadeInitialSetting = 0; //reset the inital setting flag for fade in
			
			
		}
	}
	else if(fadeFlag == 1 && fadeInitialSetting == 1)
	{
		fadeFlag = 2;
		fadeInitialSetting = 0; //reset the inital setting flag for fade in
	}
	else if(fadeFlag == 2 && fadeInitialSetting == 1) //Fade in
	{
		if(time <= 25)
		{
			if (typeBrowser==0)
			{
				document.getElementById('evalutionBgImage').filters.alpha.opacity=time*4;
			}
			else
			{
				document.getElementById('evalutionBgImage').style.opacity=(time/100)*4;
			}
			time += 1;
		}
		else
		{
			clearInterval(t); // Stop the interval
			time = 0; //Reset Timer
			fadeFlag = 0; //Clear flag
			fadeInitialSetting = 0; //reset the inital setting flag for fade in
			fadeProgress = 0; //Set the progress flag to ready
		}
		
	}
	
}




/*
function fadeOutIn(model)
{
	if (fadeProgress == 0) // Check if the transition is in session
	{
		t=setInterval("fadeOutfadeIn("+model+")",1);
	}
	else if(fadeProgress == 1) // interrupt
	{
		clearInterval(t); // Stop the interval
		//time = 0; //Reset Timer
		fadeFlag = 0; //Clear flag
		fadeInitialSetting = 0; //reset the inital setting flag for fade in
		t=setInterval("fadeOutfadeIn("+model+")",1);
	}
	
	
}

function fadeOutfadeIn(model)
{
	
	
	if(fadeFlag == 0 && fadeInitialSetting == 0) //Initial counter setting
	{
		fadeInitialSetting = 1;
		if(fadeProgress == 0)
		{
			time = 100; // Set timer
			fadeProgress = 1; //Set the progress flag to busy
		}
	}
	else if(fadeFlag == 1 && fadeInitialSetting == 0)
	{
		
		if(model ==0)
		{
			CUE_Y1A_24043(); // Replace BG to CUE-Y1A-24043
		}
		else if(model ==1)
		{
			CUE_Y1A_24063(); // Replace BG to CUE-Y1A-24063
		}
		else if(model ==2)
		{
			CUE_Y1A_20027(); // Replace BG to CUE-Y1A-20027
		}
		else
		{
			CUE_Y1A_24063(); // Replace BG to CUE-Y1A-24063
		}
		
		fadeInitialSetting = 1;
	}
	else if(fadeFlag == 2 && fadeInitialSetting == 0)
	{
		time = 0; // Set timer
		fadeInitialSetting = 1;
	}
	
	if(fadeFlag == 0 && fadeInitialSetting == 1) //Fade out
	{	
		
		if(time >= 0)
		{
			if (typeBrowser==0)
			{
				document.getElementById('evalutionBgImage').filters.alpha.opacity=time;
			}
			else
			{
				document.getElementById('evalutionBgImage').style.opacity=(time/100);
			}
			time -= 1; 
		}
		else
		{
			time = 100; 
			fadeFlag = 1; //Clear flag
			fadeInitialSetting = 0; //reset the inital setting flag for fade in
			
			
		}
	}
	else if(fadeFlag == 1 && fadeInitialSetting == 1)
	{
		fadeFlag = 2;
		fadeInitialSetting = 0; //reset the inital setting flag for fade in
	}
	else if(fadeFlag == 2 && fadeInitialSetting == 1) //Fade in
	{
		if(time <= 100)
		{
			if (typeBrowser==0)
			{
				document.getElementById('evalutionBgImage').filters.alpha.opacity=time;
			}
			else
			{
				document.getElementById('evalutionBgImage').style.opacity=(time/100);
			}
			time += 1;
		}
		else
		{
			clearInterval(t); // Stop the interval
			time = 0; //Reset Timer
			fadeFlag = 0; //Clear flag
			fadeInitialSetting = 0; //reset the inital setting flag for fade in
			fadeProgress = 0; //Set the progress flag to ready
		}
		
	}
	
}
*/
