// <![CDATA[
function noStar(inputStr) {
for (i = 0; i < inputStr.length; i++) {
var c = inputStr.charAt(i);
if ( c =="*" ) {
return false;
}
}
return true;
}
function validateSearchForm(a, url) {
if (a == 1) {
var input = document.header1.qt2.value;
var alertDisplay='';
/* 
if(input.length < 3){
alertDisplay+='Input must be at least 3 characters long.\n';
}
if(!noStar(input)){
alertDisplay+='\n';
alertDisplay+='An asterisk is not allowed in the input. \n';
}
*/
if(alertDisplay!=''){
alert(alertDisplay);
document.header1.qt2.focus();
document.header1.qt2.select();
return false;
}
if(document.header1.qt2.value == 'USサイト検索(製品番号入力)') {
document.header1.PART_NUMBER.value = '';
document.header2.PART_NUMBER.value = '';
}else {
document.header1.PART_NUMBER.value = document.header1.qt2.value;
document.header2.PART_NUMBER.value = document.header1.qt2.value;
}
document.header1.QueryText.value = document.header1.PART_NUMBER.value;
}
if (a == 2) {
if(document.header2.qt.value == 'USサイト検索(キーワード入力)') {
document.header2.qt.value ='';
}
document.header2.action="http://www.freescale.com/webapp/search/Serp.jsp";
document.header2.QueryText.value = document.header2.qt.value;
}
return true;
}
function submit(a,url) {
if (a==1) {
if(document.header.qt.value == 'USサイト検索(キーワード入力)') {
document.header.qt.value ='';
}
document.header.action =url;
}
if (a==2) {
var input = document.header.qt2.value;
var alertDisplay='';
if(input.length < 3){
alertDisplay+='Input must be at least 3 characters long.\n';
}
/* if(!noStar(input)){
alertDisplay+='\n';
alertDisplay+='An asterisk is not allowed in the input. \n';
}*/
if(alertDisplay!=''){
alert(alertDisplay);
document.header.qt2.focus();
document.header.qt2.select();
return;
}
if(document.header.qt2.value == 'USサイト検索(製品番号入力)') {
document.header.PART_NUMBER.value = '';
}else {
document.header.PART_NUMBER.value = document.header.qt2.value;
}
document.header.action = url ;
}
document.header.method = "POST";
document.header.submit();
}
function resetsearch(whichbox){
	if (document.getElementById(whichbox).value == ""){
		if (whichbox == "parts"){
			document.getElementById(whichbox).value = "USサイト検索(製品番号入力)";
		}else{
			document.getElementById(whichbox).value = "USサイト検索(キーワード入力)";
		}
	};
}

function getCookieLoginStatus() {
var name='SessID';
var start = document.cookie.indexOf(name+"=");
var temp = document.cookie.substring(start);
var indext = temp.indexOf("SessID=");
if (indext == -1) {
return false;
}
var val=temp.substring(indext+1);
if (val.length > 0) {
return true;
}
return false;
}
// ]]>
