
function showImg(pic)
{
	if(pic=="p1"){p0.style.display="none";p1.style.display="block";p2.style.display="none";p3.style.display="none";p4.style.display="none";}
	else if(pic=="p2"){p0.style.display="none";p1.style.display="none";p2.style.display="block";p3.style.display="none";p4.style.display="none";}
	else if(pic=="p3"){p0.style.display="none";p1.style.display="none";p2.style.display="none";p3.style.display="block";p4.style.display="none";}
	else if(pic=="p4"){p0.style.display="none";p1.style.display="none";p2.style.display="none";p3.style.display="none";p4.style.display="block";}
}

function DateValidate(which){var sel = eval("document.frmMainForm." + which + "day.selectedIndex");var i=eval("document.frmMainForm." + which + "month.options[document.frmMainForm." + which + "month.selectedIndex].value");var j=eval("document.frmMainForm." + which + "year.options[document.frmMainForm." + which + "year.selectedIndex].value");var k;if(i=="1" || i=="3" || i=="5" || i=="7" || i=="8" || i=="10" || i=="12"){eval("document.frmMainForm." + which + "day.length=31");for(k=28;k<=30;k++){eval("document.frmMainForm." + which + "day.options[" + k + "].value=" + parseInt(k+1));eval("document.frmMainForm." + which + "day.options[" + k + "].text=" + parseInt(k+1));}}if(i=="4" || i=="6" || i=="9" || i=="11"){eval("document.frmMainForm." + which + "day.length=30");for(k=28;k<=29;k++){eval("document.frmMainForm." + which + "day.options[" + k + "].value=" + parseInt(k+1));eval("document.frmMainForm." + which + "day.options[" + k + "].text=" + parseInt(k+1));}}var mydate=new Date();if(i==2){mydate.setDate(1);mydate.setYear(j);mydate.setMonth(1);mydate.setDate(31);var k=31-mydate.getDate();eval("document.frmMainForm." + which + "day.length=" + k);if((k==29) || (k==28)){eval("document.frmMainForm." + which + "day.options[" + (k-1) + "].value=" + k);eval("document.frmMainForm." + which + "day.options[" + (k-1) + "].text=" + k);}}if((sel+1) > eval("document.frmMainForm." + which + "day.length")){eval("document.frmMainForm." + which + "day.selectedIndex=document.frmMainForm." + which + "day.length-1");}}
function YourDate(){var tdate,tday,tmonth,tyear,yindextdate=new Date();tday=tdate.getDate();tmonth=tdate.getMonth();document.frmMainForm.smonth.selectedIndex=tmonth;document.frmMainForm.emonth.selectedIndex=tmonth;document.frmMainForm.syear.selectedIndex=20;document.frmMainForm.eyear.selectedIndex=20;DateValidate('s');DateValidate('e');document.frmMainForm.sday.selectedIndex=tday-1;document.frmMainForm.eday.selectedIndex=tday-1;}
function submitMainsearch(){if(document.frmMainsearch.SearchWord.value.indexOf(" ")==0){alert("Search string should not start with spaces.");document.frmMainsearch.SearchWord.focus();return false;}if(document.frmMainsearch.SearchWord.value==""){alert("Please enter a search string.");document.frmMainsearch.SearchWord.focus();return false;}document.frmMainsearch.submit();return true;}var cswmDi=".style.display";var cswmTI="";var cswmClkd=-1;var cswmPI=new Array();var cswmPx=new Array();var cswmPy=new Array();var cswmNH=new Array();var cswmPW=0;var cswmPH=0;var cswmSPnt="";var cswmDir="";var cswmMB=0;var cswmSI="";var cswmSE=new Object();var cswmSEL=0;var cswmSET=0;var cswmSEH=0;var cswmSEW=0;var cswmBW=0;var cswmBH=0;var cswmAR=0;var cswmAB=0;var cswmSLA=0;var cswmSTA=0;var cswmExIS=new Image();cswmExIS.src="";var cswmExdIS=new Image();cswmExdIS.src="";var cswmCTH=true;var cswmXOff=0;var cswmYOff=0;var cswmFP=0;var cswmSH=false;var cswmSTI=0;var cswmTS=0;var cswmTL=0;var cswmTTI="";var cswmPR="";var cswmSA=0;var cswmSIP=0;var cswmSS=0;
function cswmT(ms){if(ms!="off"){if(cswmCTH!=0){cswmTI=setTimeout("cswmHP(0);cswmTS=0;",ms);}}else{clearTimeout(cswmTI);}}
function cswmST(l,g,i){if(i){cswmSTI = setTimeout("cswmHP("+l+");cswmSP("+g+",'"+i+"');",350);}else if(l){cswmSTI = setTimeout("cswmHP("+l+");",350);}else{clearTimeout(cswmSTI);}}
function cswmShow(id,srcid,relpos,offsetX,offsetY,fixedpos){clearTimeout(cswmTI);if(cswmClkd!=id){cswmHP(0);cswmSI=srcid;cswmSPnt=relpos;cswmClkd=id;cswmDir="right";if(document.all["cswmPopup"+id]){if(offsetX)cswmXOff=offsetX;if(offsetY)cswmYOff=offsetY;if(fixedpos)cswmFP=fixedpos;cswmSP(id);}}}
function cswmHide(){cswmTI=setTimeout("cswmHP(0);cswmTS=0;", 250);}
function cswmHiI(id,l){var d;d=document;var item=d.all['cswmItem'+id];if(!item){return;}else{item=d.all['cswmItem'+id];var expand=d.all['cswmExpand'+id];var expandIc=d.all['cswmExpandIc'+id];var icoOn=d.all['cswmIcoOn'+id];}var bgco;try{bgco=item.getAttribute('cswmSelColor');}catch(e){bgco = false;}if(icoOn){d.all['cswmIco'+id].style.display='none';icoOn.style.display='inline';}item.style.color='#FFFFFF';expand.style.color='#FFFFFF';if(bgco){item.style.backgroundColor=bgco;expand.style.backgroundColor=bgco;}else{item.style.backgroundColor='gray';expand.style.backgroundColor='gray';}if(expandIc){expandIc.src=cswmExdIS.src;}cswmNHM(id,l);cswmNH[l-1]=id;}
function cswmNHM(id,l){if(cswmNH[l-1]!=id){var count=l-1;for(count=l-1;count<cswmNH.length;count++){cswmDiI(cswmNH[count]);}cswmNH.length=l;}}
function cswmDiI(id){var d;d=document;var item=d.all['cswmItem'+id];if(!item){return;}else{item=d.all['cswmItem'+id];var expand=d.all['cswmExpand'+id];var expandIc=d.all['cswmExpandIc'+id];var icoOn=d.all['cswmIcoOn'+id];}var bgco;try{bgco=item.getAttribute('cswmUnSelColor');}catch(e){bgco = false;}if(icoOn){d.all['cswmIco'+id].style.display='inline';icoOn.style.display='none';}item.style.color='#222222';expand.style.color='#222222';if(bgco){item.style.backgroundColor=bgco;expand.style.backgroundColor=bgco;}else{item.style.backgroundColor='#FFFFFF';expand.style.backgroundColor='#FFFFFF';}if(expandIc){expandIc.src=cswmExIS.src;}}
function cswmSP(id,itemid){if(!itemid){if(cswmFP){cswmSEL=cswmXOff;cswmSET=cswmYOff;cswmSEH=1;cswmSEW=1;cswmFP=0;}else{if(!document.all[cswmSI]){return;}cswmSE=new Object(document.all[cswmSI]);var cswmPrO=cswmSE;var cswmPrT="";cswmSEL=cswmSE.offsetLeft+cswmXOff-5;cswmSET=cswmSE.offsetTop+cswmYOff+4;cswmSEH=cswmSE.offsetHeight;cswmSEW=cswmSE.offsetWidth;while(cswmPrT!="BODY"){cswmPrO=cswmPrO.offsetParent;if(cswmPrO.style.position=='absolute'){break;}cswmSEL+=cswmPrO.offsetLeft;cswmSET+=cswmPrO.offsetTop;cswmPrT=cswmPrO.tagName;}}document.all["cswmPopup"+id].style.display="block";cswmPW=document.all["cswmPopup"+id].clientWidth;cswmPH=document.all["cswmPopup"+id].clientHeight;cswmBW=document.body.clientWidth;cswmBH=document.body.clientHeight;cswmSLA=document.body.scrollLeft;cswmSTA=document.body.scrollTop;switch(cswmSPnt){case "above":cswmPx[cswmPx.length]=cswmSEL;cswmPy[cswmPy.length]=cswmSET-cswmPH;cswmCA();cswmCR();break;case "below":cswmPx[cswmPx.length]=cswmSEL;cswmPy[cswmPy.length]=cswmSET+cswmSEH;cswmCB();cswmCR();break;case "right":cswmPx[cswmPx.length]=cswmSEL+cswmSEW;cswmPy[cswmPy.length]=cswmSET;cswmCR();cswmCB();break;case "left":cswmPx[cswmPx.length]=cswmSEL-cswmPW;cswmPy[cswmPy.length]=cswmSET;cswmCL();cswmCB();cswmDir="left";break;}cswmXOff=0;cswmYOff=0;document.all["cswmPopup"+id].style.left=cswmPx[cswmPx.length-1];document.all["cswmPopup"+id].style.top=cswmPy[cswmPy.length-1];cswmPI[cswmPI.length]=id;document.all["cswmPopup"+id].style.clip="rect(auto)";if(cswmTS==0){cswmPR=new Object(document.all["cswmPopup"+id]);cswmSA=true;switch(cswmSPnt){case "below":cswmSIP=cswmPy[cswmPy.length-1];cswmSS=cswmPH/4;cswmScI(cswmPH);cswmTS=1;break;case "right":cswmSIP=cswmPx[cswmPy.length-1];cswmSS=cswmPW/4;cswmScI(cswmPW);cswmTS=1;break;case "above":cswmSIP=cswmPy[cswmPy.length-1];cswmSS=cswmPH/4;cswmScI(cswmPH);cswmTS=1;break;case "left":cswmSIP=cswmPx[cswmPy.length-1];cswmSS=cswmPW/4;cswmScI(cswmPW);cswmTS=1;break;}}}else{var d;d=document;if(cswmSA==true){return;}cswmPx[cswmPx.length]=document.all["cswmPopup"+cswmPI[cswmPI.length-1]].clientWidth+cswmPx[cswmPx.length-1]-4;var szPrE="";if(d.all["cswmItem"+itemid].parentElement.offsetTop==0){if(navigator.platform=="MacPPC"){var szPrE="parentElement.parentElement.";}else if(d.all["cswmItem"+itemid].parentElement.parentElement.parentElement.parentElement.className!="cswmPopupBox"){var szPrE="parentElement.parentElement.parentElement.";}}cswmPy[cswmPy.length]=eval("d.all[\"cswmItem"+itemid+"\"].parentElement."+szPrE+"offsetTop")+cswmPy[cswmPy.length-1];document.all["cswmPopup"+id].style.display="block";cswmPW=document.all["cswmPopup"+id].clientWidth;cswmPH=document.all["cswmPopup"+id].clientHeight;var cswmPrW=document.all["cswmPopup"+cswmPI[cswmPI.length-1]].clientWidth;cswmAR=cswmBW-cswmPx[cswmPx.length-1]+cswmSLA;cswmAB=cswmBH-cswmPy[cswmPy.length-1]+cswmSTA;if(cswmPx[cswmPx.length-2]==cswmSLA){cswmDir="right";}if((cswmAR<cswmPW)||(cswmDir=="left")){cswmMB=(cswmPx[cswmPx.length-1]-cswmPW-cswmPrW)+8;if((cswmMB>=0)&&(cswmMB>cswmSLA)){cswmDir="left";}else{cswmMB=cswmSLA;}cswmPx[cswmPx.length-1]=cswmMB;}if(cswmAB<cswmPH){cswmMB=cswmPy[cswmPy.length-1]-(cswmPH-cswmAB);if(cswmMB<cswmSTA){cswmMB=cswmSTA;}cswmPy[cswmPy.length-1]=cswmMB;}document.all["cswmPopup"+id].style.left=cswmPx[cswmPx.length-1];document.all["cswmPopup"+id].style.top=cswmPy[cswmPy.length-1];cswmPI[cswmPI.length]=id;}}
function cswmHP(level){if(cswmClkd==-1){return false;}else if(level==0){clearTimeout(cswmSTI);cswmClkd=-1;var id = cswmPI[0];var count=0;for(count=0;count<cswmNH.length;count++){cswmDiI(cswmNH[count]);}cswmNH.length=0;}var count=level;for(count=level;count<cswmPI.length;count++){document.all["cswmPopup"+cswmPI[count]].style.display="none";}cswmPI.length=level;cswmPx.length=level;cswmPy.length=level;}
function cswmCR(){cswmAR=(cswmBW+cswmSLA)-cswmPx[cswmPx.length-1];if(cswmAR<cswmPW){if(cswmSPnt=="below"||cswmSPnt=="above"){cswmMB=cswmPx[cswmPx.length-1]-(cswmPW-cswmAR);if(cswmMB<0||cswmMB<cswmSLA){cswmMB=cswmSLA;}cswmPx[cswmPx.length-1]=cswmMB;}else{cswmMB=cswmSEL-cswmPW;if(cswmMB>=0){cswmPx[cswmPx.length-1]=cswmMB;}}}}
function cswmCL(){if(cswmPx[cswmPx.length-1]<(cswmSLA)){cswmPx[cswmPx.length-1]=cswmSEL+cswmSEW;cswmCR();}}
function cswmCB(){cswmAB=(cswmBH+cswmSTA)-cswmPy[cswmPy.length-1];if(cswmAB<cswmPH){if(cswmSPnt=="below"){cswmMB=cswmPy[cswmPy.length-1]-cswmPH-cswmSEH;if(cswmMB>=0){cswmPy[cswmPy.length-1]=cswmMB;}}else{cswmMB=cswmPy[cswmPy.length-1]-(cswmPH-cswmAB);if(cswmMB<0||cswmMB<cswmSTA){cswmMB=cswmSTA;}cswmPy[cswmPy.length-1]=cswmMB;}}}
function cswmCA(){if(cswmPy[cswmPy.length-1]<(cswmSTA)){cswmPy[cswmPy.length-1]=cswmSET+cswmSEH;cswmCB();}}
function cswmScI(level){cswmTL=level;switch(cswmSPnt){case "below":if(level>=0){cswmPR.style.clip="rect(" + level + " " + cswmPW + " " + cswmPH + " 0)";cswmPR.style.top=(cswmSIP-cswmPH)+(cswmPH-level);setTimeout("cswmScI(cswmTL-cswmSS);",50);}else{cswmPR.style.clip="rect(0 " + cswmPW + " " + cswmPH + " 0)";cswmPR.style.top=cswmSIP;cswmSA=false;}break;case "right":if(level>=0){cswmPR.style.clip="rect(0 " + cswmPW + " " + cswmPH + " " + level + ")";cswmPR.style.left=(cswmSIP-cswmPW)+(cswmPW-level);setTimeout("cswmScI(cswmTL-cswmSS);",50);}else{cswmPR.style.clip="rect(0 " + cswmPW + " " + cswmPH + " 0)";cswmPR.style.left=cswmSIP;cswmSA=false;}break;case "above":if(level>=0){cswmPR.style.clip="rect(0 " + cswmPW + " " + (cswmPH - level) + " 0)";cswmPR.style.top=cswmSIP+level;setTimeout("cswmScI(cswmTL-cswmSS);",50);}else{cswmPR.style.clip="rect(0 " + cswmPW + " " + cswmPH + " 0)";cswmPR.style.top=cswmSIP;cswmSA=false;}break;case "left":if(level>=0){cswmPR.style.clip="rect(0 " + (cswmPW - level) + " " + cswmPH + " 0)";cswmPR.style.left=cswmSIP+level;setTimeout("cswmScI(cswmTL-cswmSS);",50);}else{cswmPR.style.clip="rect(0 " + cswmPW + " " + cswmPH + " 0)";cswmPR.style.left=cswmSIP;cswmSA=false;}break;}}/*A - Z*/
function showMsg( obj, msg ){alert(msg); obj.focus(); obj.select(); return false;}
function showMsgRdo(obj,msg){alert(msg);return false;}
function showMsgSlct(obj,msg){alert(msg); obj.focus();return false;}
function frmINQ(form) 
{
	if(form.txtContact.value=="")return showMsg(form.txtContact,"Contact Name is required information!");
	if(form.txtCompany.value=="")return showMsg(form.txtCompany,"Company Name is required information!");
	if(form.txtPhone.value=="")return showMsg(form.txtPhone,"Phone is required information!");
	if(!validEmail (form.txtEmail.value)){return showMsg(form.txtEmail,"Please insert a valid E-mail Address");}
	if(form.txtNature.value=="")return showMsg(form.txtNature,"Nature of meeting is required information!");
	
	if(form.sltAtendies.value=="0")return showMsgSlct(form.sltAtendies,"Estimated attendees is required information!");
	if(form.sltMonth.value=="0")return showMsgSlct(form.sltMonth,"Date is required information!");
	if(form.sltDay.value=="0")return showMsgSlct(form.sltDay,"Date is required information!");
	if(form.sltYear.value=="0")return showMsgSlct(form.sltYear,"Date is required information!");
	if(form.sltTimes.value=="0")return showMsgSlct(form.sltTimes,"Time(s) is required information!");
	
}
function frmRFQ(form) 
{
	if(form.txtContact.value=="")return showMsg(form.txtContact,"Contact is required information!");
	if(form.txtCompany.value=="")return showMsg(form.txtCompany,"Company is required information!");
	if(form.txtTitle.value=="")return showMsg(form.txtTitle,"Title is required information!");
	if(form.txtAddress1.value=="")return showMsg(form.txtAddress1,"Address is required information!");
	if(form.txtCity.value=="")return showMsg(form.txtCity,"City is required information!");
	if(form.txtState.value=="")return showMsg(form.txtState,"State/Province is required information!"); 
	if(form.txtZip.value=="")return showMsg(form.txtZip,"Zip/Postal Code is required information!");
	if(form.txtCountry.value=="")return showMsg(form.txtCountry,"Country is required information!");
	if(form.txtPhone.value=="")return showMsg(form.txtPhone,"Phone is required information!");
	if (!validEmail (form.txtEmail.value)){return showMsg(form.txtEmail,"Please insert a valid E-mail Address");}
	if((!form.chk1.checked)&&(!form.chk2.checked)&&(!form.chk3.checked)&&(!form.chk4.checked)&&(!form.chk5.checked)&&(!form.chk6.checked)&&(!form.chk7.checked)&&(!form.chk8.checked)){alert("I am inquiring about must be selected!");return false;} 
	if(form.sltSource.value==0){alert("How did you hear about TEK Park must be selected!");form.sltSource.focus();return false;} 
	if(form.hdn_rdo.value=="") return showMsgRdo(form.rdoHow,"How would you like to receive the information must be selected!");
}
function Up(){form.hdn_rdo.value="1";}
function Down(){form.hdn_rdo.value="0";}
function validEmail (email) 
{
	invalidChars = " / : , ; "
	if (email == "") { return false }
	for (i=0; i<invalidChars.length;i++) { badChar = invalidChars.charAt (i); if (email.indexOf (badChar, 0) >-1) { return false } }
	atPos = email.indexOf ("@", 1)
	if (atPos == -1) { return false }
	if (email.indexOf ("@", atPos+1) >-1) { return false }
	periodPos = email.indexOf (".", atPos)
	if (periodPos == -1) { return false }
	if (periodPos+3 > email.length) { return false }
	return true
}