//**********************************
var arrNames;
var arrValues;
var ckNames;
var ckValues;

//**********************************
function xyz(){
var loc,i,j,dt;
var arrNameValue= new Array();
var arrIndNameVal = new Array();
arrNames= new Array();
arrValues= new Array();
var dt = new Array();
var loc = document.location.toString();

arrNameValue = loc.split("?");
arrIndNameVal = arrNameValue[1].split("&");

for (i=0; i<arrIndNameVal.length; i++)
  {
   dt = arrIndNameVal[i].split("=");
   arrNames[i]= dt[0];
   arrValues[i]=dt[1];	
  } 	
}

//26**********************************
function getaText()
{
  document.write(unescape(arrValues[0]));
}


function getbText()
{
  document.write(arrValues[1]);
}

function getcText()
{
  document.write(arrValues[2]);
}

//**********************************

function getDType(){
var loc;
var arrNameValue= new Array();
var arrIndNameVal = new Array();
loc = document.location.toString();
arrNameValue = loc.split("?");
arrIndNameVal = arrNameValue[1].split("=");
//alert(arrIndNameVal[1]);
return arrIndNameVal[1];
}
//**********************************
/*function dnldText()
{
var xfile=getDType();
if (xfile=="spc")
	document.write ( " Powerpoint Demo: SPC WorkBench" );
if (xfile=="msa")
	document.write ( " Self-Running Slide Show: ProMSA" );
if (xfile=="quin")
	document.write ( " Quincunx SPC Simulator" );
if (xfile=="free")
	document.write ( " Freeware Measuring Instrument Health Compass" );
}	
*/
//********************************************************************************

//Default StatusBar Text
function setDefStatus()
{
  window.defaultstatus = "Symphony Technologies";
  window.status = window.defaultstatus;
}

//Set StatusBar Text
function setStatus(sMsg)
{
  window.status = sMsg;
  return true;
}

//Clear StatusBar Text
function clrStatus()
{
  window.status = window.defaultstatus;
  return true;
}
//********************************************************************************
//
function swapimage(imagename,newimage){
document.imagename.src=newimage;
}

//Swap Checkmark Image
function swapcheck(imageid,action){
if(action==0) 
	document.images(imageid).src="images/bcheck.gif";
else
	document.images(imageid).src="images/rcheck.gif";
}

// Show Blank image
function showBlank(el){
// document.images("i" + el.id).src="images/blank16.gif";
 setDefStatus();
}

// Show Bullet + StatusBar message
function showBul(el,sMsg){
// document.images("i" + el.id).src="images/arcbul.gif";
 return setStatus(sMsg);
}

//***** Cookie Functions   ***********************************
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
//      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((expires) ? "; expires=" + expires : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


function getCookie(name) {
  var dc = document.cookie;
  
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;

  return unescape(dc.substring(begin + prefix.length, end));
}


function createCookie(s){
var s;

//Delet cookie if exists:
setCookie('stpl','','Sat, 01-Jan-2005 00:00:00 GMT',null,null,null);

//Format New Cookie
   x="?Name=" + document.forms[0].Name.value + "&Designation=" + document.forms[0].Designation.value;
   x= x + "&Organization=" + document.forms[0].Organization.value + "&Email=" + document.forms[0].Email.value;
   x=x + "&Prefix=" + document.forms[0].Prefix.value + "&Country=" + document.forms[0].Country.value;

// Set New Cookie
   setCookie('stpl',x,'Fri, 31-Dec-2010 00:00:00 GMT',null,null,null);

 return;
}

//**** Cookie Info ***************
function ckInfo(ckStr){
var ckStr=getCookie('stpl');
   if( ckStr!= null){
	var ckNameValues; 
	var dt = new Array();
	var pair=new Array();
	ckNames= new Array();
	ckValues= new Array();
	var e;

	ckNameValues= ckStr.substring(ckStr.indexOf('?') + 1, ckStr.length);
	dt= ckNameValues.split("&");
	for (i=0; i<dt.length; i++) {
	   pair=dt[i].split("=");
	   ckNames[i]= pair[0];
	   ckValues[i]=pair[1];
	   if ((e=MM_findObj(ckNames[i]))!=null) {
		e.value=ckValues[i];
	   }
	}
   }
	
}

//******URL Parser **************************************************************************
// Add the following line in the document head tag to include:
// <script language="javascript" src="urlparser.js"></script>
//parseCallingURL(parent.document.URL)
	
	var nMaxVars = 0;
	var sVarLine = "";
	var sName = new Array();
	var sValue = new Array();
	
	function getMaxVars() { return nMaxVars; }
	function getVarString() { return sVarLine; }
	function getNameArray() { return sName; }
	function getValueArray() { return sValue; }
		
	function parseCallingURL(sCallingURL) {

		//Get the calling URL and parse out variables
		sCallingURL = String(sCallingURL);
		//var sCallingURL = String(document.location);
		if (sCallingURL.length == 0)
			return;
			
		// Check if there are any variables
		if (sCallingURL.indexOf('?') != -1) {
			sVarLine = String(sCallingURL.substring(sCallingURL.indexOf('?') + 1, sCallingURL.length));
		} else {
			// No variables
			return;
		}
		
		var nPos = 0;
		var sChar = "";
		var sWord = "";
		nMaxVars = 0;
		
		// Parse
		while (nPos < sVarLine.length) {
			sChar = sVarLine.substring(nPos, nPos + 1);
			
			if (sChar == "=") {
				sName[nMaxVars] = sWord;
				sWord = "";
				
			} else if (sChar == "&") {
				sValue[nMaxVars] = sWord;
				sWord = "";
				nMaxVars++;
				
			} else if (nPos == sVarLine.length - 1) {
				sWord += sVarLine.substring(nPos, nPos + 1);
				sValue[nMaxVars] = sWord;
				sWord = "";
				nMaxVars++;
				
			} else {
				sWord += sChar;
			}
			nPos++;
		}
	}
//********************************************************************************
//Changed to handle URL from Cresitive
function hiddenText()
{
if(sValue[1] == "msa.zip"){sValue[1]="msa_en.zip";}
document.write("<input type=HIDDEN name=aText value='" + unescape(sValue[0]) + "'>");
document.write("<input type=HIDDEN name=bText value='" + unescape(sValue[1]) + "'>");
document.write("<input type=HIDDEN name=subject value='" + unescape(sValue[0]) );
document.write("'>");
var ee= "<input type=HIDDEN name='Referrer' value='" + document.referrer + "'>"
document.write(ee);
}
//********************************************************************************
// Cookie based Welcome on Index page
function welCome(){
	var x;
	x=getCookie('stpl');
	if(x != null){
	   parseCallingURL(x);
  	  document.write(sValue[0] + "!");
	}
	else {
	   document.write("!");		
	}
	return x;
}

function setQPJ(){
	var tempx;

 	document.dnldform.subqpj.value="No";
	if(document.dnldform.sendj.checked){
 	 document.dnldform.subqpj.value="Subscribe";
	}
	tempx=document.dnldform.PostalAddress.value;
	tempx= tempx + ":" + document.referrer;
	document.dnldform.PostalAddress.value=tempx;
	return;	
}

//*******************************************************************************
//WebRing
//*******************************************************************************
function webring(){
document.write("<table style='border:solid 1px navy;' cellpadding=2 cellspacing=0 align=center bgcolor=#cccccc width=100%>");
document.write("<tr><td><table bgcolor='#eeeeee' border=0 cellpadding=0 cellspacing=4 align=center style='border:solid 2px #990066;' width=100%>");
document.write("<tr><td align=center nowrap style='font-family:verdana,arial; font-size:7pt;'>");
document.write("<img src='http://us.yimg.com/i/wr/wrsm1.gif' width=14 height=13 border=0>");
document.write("<b>Quality Assurance Webring<br>");
document.write("by <a href='http://profiles.yahoo.com/howardat_il' target=_new>Howard Atkins</a>");
document.write("</td></tr><tr><td  height=2 bgcolor='#990066'></td></tr>");
document.write("<tr><td nowrap align=center style='font-family:verdana,arial; font-size:7pt;'>");
document.write("[  <a href='http://d.webring.com/wrman?ring=qual&addsite' target=_new>Join</a>");
document.write("|  <a href='http://d.webring.com/hub?ring=qual&id=109&hub' target=_new>Ring Hub</a>  ]");
document.write("</td></tr><tr>");
document.write("<td nowrap  align=center style='font-family:verdana,arial; font-size:7pt;'>");
document.write("[  <a href='http://d.webring.com/go?ring=qual&id=109&prev' target=_new>&lt;&lt;</a>");
document.write("|  <a href='http://d.webring.com/go?ring=qual&id=109&random' target=_new>Random</a>");
document.write("|  <a href='http://d.webring.com/go?ring=qual&id=109&next' target=_new>&gt;&gt;</a>  ]");
document.write("</td></tr><tr><td  height=2 bgcolor='#990066'></td></tr>");
document.write("<tr><td nowrap  align=center style='font-family:tahoma,verdana,arial; font-size:7pt;'>");
document.write("[ <a href='http://dir.webring.com/rw' target=_new>Home</a>");
document.write("| <a href='http://dir.webring.com/h/what.html' target=_new>About</a>");
document.write("| <a href='http://dir.webring.com/h/privacy.html' target=_new>Privacy</a> ]");
document.write("</td></tr></table></td></tr></table>");
}
//*******************************************************************************
/************************************/
//Find Object from ID: Macromedia Stuff
/************************************/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
/************************************/
function openDownload(what,file){
var a = "confirm.htm?aText=" + what + "&bText=" + file;
window.open(a,"_new");
//,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+sbars+", resizable="+resize+, width="+w+", height="+h);

}

function openpdf(file){
window.open(file,"_new");
}
/****************************************************/
//taken from Elsmar: Hoizontal: Check mihc.htm for usage
function ScrollMarquee() {
	window.setTimeout('ScrollMarquee()',ScrollSpeed);
	var msg = document.marquee1.text.value; 
	document.marquee1.text.value =msg.substring(ScrollChars) + msg.substring(0,ScrollChars); 
} 
/************************************************************************************
Function to scroll custmer list in a Marquee Element.
1. Define Customer list: [String , string , string,....,String]
2. To call in HTML file:
	i) Include this js file in the <head> section: <script LANGUAGE="JavaScript" SRC="stpl.js"></script>
	ii) Call: <script language=JavaScript>custList();</script>
**************************************************************************************/
function custList(){
var i;
var custname=[
	"Agere Systems, Singapore",
	"Bossard Milwaukee, USA",
	"Contitech, Spain",
	"Cummins India",
	"Denso Sistemas Térmicos, Brazil",
	"Eaton Quality Institute, USA",
	"Fujitsu Ten Limited, Japan &amp; Mexico",
	"Hana Semiconductors, Thailand",
	"Lear Corporation, Philippines",	
	"Lucas TVS, India",	
	"Murata Manufacturing, Japan",	
	"NSK Bearings, Thailand",
	"Philips Semiconductors, Germany",
	"Precision Aerospace, AZ, USA",
	"Siam Toyota, Thailand",
	"The Timken Company, OH, USA",
	"Toshiba Semiconductor, Japan",
	"TVS Motors, India",	
	"UBE Automotive, Canada",
	"WABCO Automotive, UK"
//Add as required....
];

document.write("<marquee  direction=up scrolldelay=400 height=140  style='border:1px solid #336699;'>");
document.write("<table border=0 cellpadding=0 cellspacing=0>");
for (i=0;i<custname.length;i++){
	document.write("<tr><td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/arcbul.gif'>&nbsp;<span class=custname>");
	document.write(custname[i]);
	document.write("</span></td></tr>");
}

document.write("</table></marquee>");
}
/*************************************************************************/
function addTagLine(){
var tagLine="Symphony Technologies"	//"Planning, Design &amp; Analysis";
	document.write("<h3>")
	document.write(tagLine);
	document.write("&nbsp;&nbsp;</h3>");
}

function aa()
{

	alert("aa");
}
/*************************************************************************/
function leadText(fName){
var LTxt;
LTxt="";
	if(fName=="pcwizard.zip"){

	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Related Software:</b></Font><br><br>Download and evaluate the following <b>related product</b> from SymphonyTech.<br><br>";
	LTxt=LTxt + "<center><IMG SRC='images/spcico.gif' hspace='5'><a href='http://www.symphonytech.com/spcwork.htm'><b>SPC WorkBench</b></a></center><br>";
	LTxt=LTxt + "A powerful, yet easy-to-use SPC Software for the shop floor.<br><br>";
	LTxt=LTxt + "XMR, XBar-R, XBar-s, p, np, c and u charts. Histogram, Normal Probability Plot and Pareto graphs.<br><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=SPC WorkBench V4.0&amp;bText=spc.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download 30-day Evaluation Version Free' border=0></a>";
	LTxt=LTxt + "</center></div>";
	}
	else if (fName=="instrr.zip"){
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Related Software:</b></Font><br><br>Download and evaluate the following <b>related product</b> from SymphonyTech.<br><br>";
	LTxt=LTxt + "<center><IMG SRC='images/proico.gif' hspace='5'><a href='http://www.symphonytech.com/promsa.htm'><b>ProMSA</b></a></center><br>";
	LTxt=LTxt + "A complete MSA software for <b>easy compliance with AIAG MSA manual 4<sup>th</sup> edition</b>.<br><br>";
	LTxt=LTxt + "Stability, Bias, Linearity, Gage R&R (Range-Average, Crossed &amp; Nested ANOVA), CrossTab kappa, Signal Detection and Analytic Method.<br><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=ProMSA V4 (English)&amp;bText=msa_en.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download 30-day Evaluation Version Free' border=0></a>";
	LTxt=LTxt + "</center></div>";
	}

	else if (fName=="dfunnel.zip"){
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Related Software:</b></Font><br><br>Download and evaluate the following <b>related product</b> from SymphonyTech.<br><br>";
	LTxt=LTxt + "<center><IMG SRC='images/RedBeadico.gif' hspace='5'><a href='http://www.symphonytech.com/redbeadexp.htm'><b>Demings Red Bead Experiment Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=Red Bead Experiment Simulator&amp;bText=redbead.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a></center><hr>";
	LTxt=LTxt + "<center><IMG SRC='images/quinico.gif' hspace='5'><a href='http://www.symphonytech.com/quincunx.htm'><b>SPC Training Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=SPC Training Simulator&amp;bText=quin.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a>";
	LTxt=LTxt + "</center></div>";
	}
	else if (fName=="redbead.zip"){
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Related Software:</b></Font><br><br>Download and evaluate the following <b>related product</b> from SymphonyTech.<br><br>";
	LTxt=LTxt + "<center><IMG SRC='images/funnelicon.jpg' hspace='5'><a href='http://www.symphonytech.com/redbeadexp.htm'><b>Demings Funnel Experiment Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=Funnel Experiment Simulator&amp;bText=dfunnel.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a></center><hr>";
	LTxt=LTxt + "<center><IMG SRC='images/quinico.gif' hspace='5'><a href='http://www.symphonytech.com/quincunx.htm'><b>SPC Training Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=SPC Training Simulator&amp;bText=quin.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a>";
	LTxt=LTxt + "</center></div>";
	}
	else if (fName=="quin.zip"){
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Related Software:</b></Font><br><br>Download and evaluate the following <b>related product</b> from SymphonyTech.<br><br>";
	LTxt=LTxt + "<center><IMG SRC='images/funnelicon.jpg' hspace='5'><a href='http://www.symphonytech.com/redbeadexp.htm'><b>Demings Funnel Experiment Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=Funnel Experiment Simulator&amp;bText=dfunnel.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a></center><hr>";
	LTxt=LTxt + "<center><IMG SRC='images/redbeadico.gif' hspace='5'><a href='http://www.symphonytech.com/redbeadexp.htm'><b>Demings Red Bead Experiment Simulator</b></a></center><br>";
	LTxt=LTxt + "<center><a href='confirm.htm?aText=Red Bead Experiment Simulator&amp;bText=redbead.zip'>";
	LTxt=LTxt + "<img src='images/dnldnow.gif' hspace=3 width=150 alt='Download Evaluation Version Free' border=0></a>";
	LTxt=LTxt + "</center></div>";
	}
	else if (fName=="gdtwiz.zip"){
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>E-Learning Course in GD and T</b></Font> also available:<br><br>";
	LTxt=LTxt + "<center><a href='http://www.symphonytech.com/gdtwebtutor.htm'><IMG SRC='img2/webgdtlogo.gif'></a></center><br><br>";
	LTxt=LTxt + "<center>GD and T WEB Tutor is an E-Learning course identical in content as GDT WIZ Tutor. For more information and a Free Sample Course Module Click:";
	LTxt=LTxt + "<a href='http://www.symphonytech.com/gdtwebtutor.htm'>";
	LTxt=LTxt + "<b>GD and T WEB Tutor</b></a>";
	LTxt=LTxt + "</center></div>";
	}
	else {  
	LTxt=LTxt + "<div style='border:red 2px solid; padding:10px'><font color='red'><b>Explore SymphonyTech Website...</b></Font><br><br>";
	LTxt=LTxt + "<center><a href='http://www.symphonytech.com/index.htm'><b>Home Page</b></a></center><br><br>";
	LTxt=LTxt + "<center><a href='http://www.symphonytech.com/mihc.htm'><b>Downloads Page</b></a></center><br><br>";
	LTxt=LTxt + "<center><a href='http://www.symphonytech.com/feature.htm'><b>Featured Articles Page</b></a>";
	LTxt=LTxt + "</center></div>";
	}

	document.write(LTxt);
}
/*************************************************************************/
