/**
 * SWFObject v1.5.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

//addLoadEvent
var addLoadEvent={
	funcs:[],lastfuncs:[],
	loaded:false,
	ifdebug:false,
	
	add:function (f){
		if (addLoadEvent.loaded) {
			f();
		}else{ 
			addLoadEvent.funcs.push(f);
		}
	},
	addFirst:function (f){
		if (addLoadEvent.loaded) {
			f();
		}else{ 
			addLoadEvent.funcs.unshift(f);
		}
	},
	addLast:function (f){
		if (addLoadEvent.loaded) {
			f();
		}else{ 
			addLoadEvent.lastfuncs.push(f);
		}
	},

	start:function(){
		if(addLoadEvent.loaded) return;
		for (var i=0,L=addLoadEvent.funcs.length;i<L;i++){
			try{
				addLoadEvent.funcs[i]();
			} catch(e){
				if (addLoadEvent.ifdebug) alert(e.toString());
			}
		}
		for (var i=0,L=addLoadEvent.lastfuncs.length;i<L;i++){
			try{
				addLoadEvent.lastfuncs[i]();
			} catch(e){
				if (addLoadEvent.ifdebug) alert(e.toString());
			}
		}
		
		addLoadEvent.loaded=true;
		delete addLoadEvent.funcs;
		delete addLoadEvent.start;
	},
	setOnload:function(mode){
		if(mode=="debug") addLoadEvent.ifdebug=true;
		if(window.addEventListener){
			window.addEventListener("load",addLoadEvent.start,false);
		} else if(window.attachEvent){
			window.attachEvent("onload",addLoadEvent.start);
		} else{
			window.onload=addLoadEvent.start;
		}		
	}
}

function ById(str_id){
	return (document.getElementById(str_id)) ? document.getElementById(str_id) : false ;
}

function setHeight(){

	if ((ById("left_cont") || ById("left_webpages")) && ById("main")){

		var targ=(ById("left_cont")) ? ById("left_cont") : ById("left_webpages");
		if (targ.clientHeight > ById("main").clientHeight){
		
			//ById("main").style.height=targ.clientHeight+"px";
			targ.appendChild(ById("footer"));
			ById("wrapper").style.height=132+targ.clientHeight+"px";
		}
		//mes(targ.clientHeight +":"+ ById("main").clientHeight);
	} 
	//Appear footer 
	ById("footer").style.display="block";
	
}
var flvs={
	width:335,
	height:280,
	num:0,
	swfname:"http://www.juki.co.jp/industrial_e/common/flash/player.swf",
	flashversion:"7",
	setRect:function(w,h){
		if(typeof w=="number") flvs.width=w;
		if(typeof w=="number") flvs.height=h;
	},
	clearing:function(obj){
		obj.innerHTML="";
		obj.className="videoarea_hide";
	},
	embed:function(targ,url){
		//property
		// targ : target id
		// url  : path to movie file(s)		
		
		if(!targ || (typeof targ != "string")) return false;
		if(!document.getElementById(targ))  return false;
		
		//alert("embe1");
		
		var targetObject=document.getElementById(targ);
		if(flvs.num==0) {
			flvs.clearing(targetObject);
		} 

		if(!url || (typeof url  != "string")) {
			targetObject.style.display="none";
			return false;
		} else {
			targetObject.style.height="285px";
		}
		//alert("2");
		
		
		flvs.num++;
		var divObj=document.createElement("div");
		var innerId=targ+flvs.num;
		divObj.setAttribute("id",innerId);
		targetObject.appendChild(divObj);
		
		flvs.url=url;
		flvs.innerId=innerId;
		//alert("3");
		
		var func=function(){							
			var url=flvs.url;
			var innerId=flvs.innerId;
/*			var so = new SWFObject(flvs.swfname+'?flvName='+url, "flvvideo"+flvs.num, flvs.width, flvs.height, flvs.flashversion);		
			so.addParam("quality", "high");
			so.addParam("allowFullScreen", "true");
			so.addParam("wmode","transparent");
			so.write(innerId);*/
			
			$(innerId).innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="flashmovie_1222777491047" height="'+flvs.height+'" width="'+flvs.width+'"><param name="movie" value="'+flvs.swfname+'?flvName='+url+'"><param name="quality" value="high"><param name="allowFullScreen" value="true"><embed src="'+flvs.swfname+'?flvName='+url+'" quality="high" swliveconnect="true" id="flashmovie_1222777491047" name="flashmovie_1222777491047" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" allowfullscreen="true" height="'+flvs.height+'" width="'+flvs.width+'"></object>';
			
			
		}
		addLoadEvent.addLast(func);
		
		
		
		
		//alert("4");
	}
}
function swf_embed(targ,url,width,height){
	if(!targ || (typeof targ != "string")) return false;
	if(!document.getElementById(targ))  return false;
	if(!url  || (typeof url  != "string")) return false;
	var so = new SWFObject(url, "flash_"+targ, width, height);
	so.addParam("quality", "high");
	so.write(targ);
}

var moveArea={
	//titleId:"productpage",
	titleId:"pict_qs",
	relatedId:"relatedlinkarea",
	parentObj:{},
	titleNextObj:{},
	areaHeight:200,
	initialize:function(){
		if((!ById(moveArea.titleId)) && (!ById(moveArea.relatedId))) return false;
		moveArea.parentObj=ById(moveArea.titleId).parentNode;
		moveArea.titleNextObj=ById(moveArea.titleId).nextSibling;//alert(moveArea.titleNextObj.nodeName);
		
		var obj = ById(moveArea.titleId).nextSibling;
		while(obj.nodeName=="#text"){
			obj=obj.nextSibling;
		}
		moveArea.titleNextObj=obj;
		
		addLoadEvent.addFirst(moveArea.move);
		document.write('<style>#'+moveArea.titleId+'{/*margin-bottom:'+moveArea.areaHeight+'px*/}');
		document.write('#'+moveArea.relatedId+'{visibility:hidden;}</style>');
	},
	move:function(){
		if(!moveArea.parentObj) return false;
		ById(moveArea.titleId).style.marginBottom="5px";
		if(document.all){
			ById(moveArea.titleId).style.styleFloat="left";
			ById(moveArea.relatedId).style.styleFloat="right";
		} else {
			ById(moveArea.titleId).style.cssFloat="left";
			ById(moveArea.relatedId).style.cssFloat="right";
		}
		
		if(!moveArea.titleNextObj){
			moveArea.parentObj.appendChild(ById(moveArea.relatedId));
		} else{
			moveArea.titleNextObj.style.clear="both";
			moveArea.parentObj.insertBefore(ById(moveArea.relatedId),moveArea.titleNextObj);
		}
		ById(moveArea.relatedId).style.visibility="visible";
	}
}

document.write('<style>#footer{display:none;}</style>');




/*
Script for tooltip 
 written by ArfaethaLab 05/2007
*/

var Popup={

	//Initialization
	popwidth:80, 			//Default-width of tooltip
	popoffset:[0,0],		//Position of tooltip [x,y]
	poptrans:0.8,			//Translucence  of tooltip
	popbackimagepPath:"",	//Path to caption's background image
	popvanishTime:1, 	//Time until tooltip disappear (millisecond)
	pictPosition:[440,113], //ピクトグラムの横座標,縦座標　基準はメイン領域左上
	itemPosition:[680,130], //アイテムリストアイコンの横座標,縦座標
	/*popidprename:"pict",*/
	popndt_bordercolor:"#000000",
	popndt_backcolor:"#455d9e",
	popndt_fontcolor:"#FFFFFF",
	pict_targetId:"pict_qs",
	item_iconsId:"itemlisticons",
	gx:[],gy:[],tID:[],cou:0,
	postnum:function(){return Popup.cou++;},
	
	getxy:function (e){
		Popup.gx=e.clientX+window.pageXOffset;
		Popup.gy=e.clientY+window.pageYOffset;
	}
,	popn:function (ev,wid){	
		var e=(ev.target) ? ev.target:ev.srcElement;
		var targ=e.id.replace(/_[0-9]*(itsicons)?$/,"")+"_description";
		
		Popup.cancvan();
		if(document.all){
			Popup.gx=window.event.clientX+document.body.scrollLeft;
			Popup.gy=window.event.clientY+document.body.scrollTop;
		}
		//contents
		ById("popndt_inner").innerHTML=ById(targ).getElementsByTagName("dt")[0].innerHTML;
	//	ById("popndd_inner").innerHTML=ById(targ).getElementsByTagName("dd")[0].innerHTML;
		//style
		//ById("popndl").style.left=Popup.gx+Popup.posmod[0]+"px";
		//ById("popndl").style.top=Popup.gy+Popup.posmod[1]+"px";
		
		if(e.id.indexOf("itsicons")!=-1){
			ById("popndl").className="itsicons";
			ById("popndl").style.left=Popup.itemPosition[0]+"px";
			ById("popndl").style.top=Popup.itemPosition[1]+"px";
		} else {
			ById("popndl").className="picticons";
			ById("popndl").style.left=Popup.pictPosition[0]+"px";
			ById("popndl").style.top=Popup.pictPosition[1]+"px";
		}

		ById("popndl").style.display="block";
		if(wid) {
			ById("popndl").style.width=wid+"px";
			ById("popndt").style.width=wid+"px";
		//	ById("popndd").style.width=wid+"px";
		} else {
			/*ById("popndl").style.width=Popup.popwidth+"px";
			ById("popndt").style.width=Popup.popwidth+"px";
			ById("popndd").style.width=Popup.popwidth+"px";*/
		}
		//event
		addListener(e,"mouseout",Popup.popvan,true);
		addListener(ById("popndl"),"mouseout",Popup.popvan,true);
		addListener(ById("popndl"),"mouseover",Popup.cancvan,true);
		
		//link
		if (e.href){
			var linkto=e.href;
			//ById("popndl").className="link";
			if(document.all){
				ById("popndl").setAttribute("onclick", new Function("location.href='"+linkto+"';"));
			} else {
				ById("popndl").setAttribute("onclick", "location.href='"+linkto+"';");
			}
		} else{
			//ById("popndl").className="";
			ById("popndl").removeAttribute("onclick");
			ById("popndt").style.paddingRight="2px";
			ById("popndt_inner").style.paddingRight="2px";
		}
	}
,	popvan:function (e){
		var func=function(){
			ById("popndl").style.display="none";
		};
		//Popup.tID.push(setTimeout(func,500));
		Popup.tID.push(setTimeout(func,Popup.popvanishTime));
	}
,	cancvan:function (){
		for (i=0,L=Popup.tID.length;i<L;i++){
			clearTimeout(Popup.tID[i]);
		}
		Popup.tID=new Array;
	}
	
,	popnload:function (){
		if(!document.all){
			window.onmousemove=Popup.getxy;
		}
		var objBody = document.getElementsByTagName("body")[0];
		var objPopupDiv= document.createElement("div");
		objPopupDiv.setAttribute('id','popndl');
		objBody.insertBefore(objPopupDiv, objBody.firstChild);
		var objPopupDiv= document.createElement("div");
		objPopupDiv.setAttribute('id','popndt');
		ById("popndl").appendChild(objPopupDiv);
		var objPopupDiv= document.createElement("div");
		objPopupDiv.setAttribute('id','popndt_inner');
		ById("popndt").appendChild(objPopupDiv);
		/*var objPopupDiv= document.createElement("div");
		objPopupDiv.setAttribute('id','popndd');
		ById("popndl").appendChild(objPopupDiv);
		var objPopupDiv= document.createElement("div");
		objPopupDiv.setAttribute('id','popndd_inner');
		ById("popndd").appendChild(objPopupDiv);*/
		
		var images=ById(Popup.pict_targetId).getElementsByTagName("img");
		for (var i=0,L=images.length;i<L;i++){
			var img=images[i];
			
			//var reg = new RegExp("_([0-9]*)\.gif$","i");
			var reg = new RegExp("\/([^/]+?)\.gif$","i");
			if(img.src.match(reg)){
				var imgId=RegExp.$1+"_"+Popup.postnum();
				img.setAttribute("id",imgId);
				addListener(img,"mouseover",Popup.popn,true);
			}
		}
		if(ById(Popup.item_iconsId)) {
		 var itemslist=ById(Popup.item_iconsId).getElementsByTagName("img");
			for (var i=0,L=itemslist.length;i<L;i++){
				var img=itemslist[i];
				
			//var reg = new RegExp("_([0-9]*)\.gif$","i");
				var reg = new RegExp("\/([^/]+?)\.gif$","i");
				if(img.src.match(reg)){
					var imgId=RegExp.$1+"_"+Popup.postnum()+"itsicons";
					img.setAttribute("id",imgId);
					addListener(img,"mouseover",Popup.popn,true);
				}
			}
		}

	

		
	}
,	setstyle:function (){
		//style of Popup-contents
		document.write("<style>dl.popn{ display:none}");
		document.write("#popndl,#popndt,#popndd{ margin:0; padding:0; line-height:1;}");
		document.write("#popndl{ display:none; position:absolute;  filter: alpha(opacity="+Popup.poptrans*100+");  -moz-opacity:"+Popup.poptrans+";  opacity:"+Popup.poptrans+"; ");
		document.write("padding-left:"+Popup.popoffset[0]+"px;padding-top:"+Popup.popoffset[1]+"px}");
		document.write("#popndt{ border:1px solid "+Popup.popndt_bordercolor+"; background:"+Popup.popndt_backcolor+" right top no-repeat; color:"+Popup.popndt_fontcolor+"; font-weight: bold; font-size:10pt; margin:0;}");
		document.write("#popndt #popndt_inner{padding:3px 0 3px 0; margin:0 13px 0 13px;color:"+Popup.popndt_fontcolor+";}");
		document.write("#popndl.link{ cursor:pointer;}");
		document.write("#popndl.link #popndt{ background-image:url("+Popup.popbackimagepPath+")}");
		/*document.write('#popndd{ border:1px solid #72BF44; background:#EDEEEF; color:#000000; font-weight: normal; font-size:8pt;margin:0;}');
		document.write('#popndd #popndd_inner{ padding:2px;}</style>');*/
		document.write("</style>");
	}
}

function addListener(elem, eventType, func, cap)
	{
		if(elem.addEventListener)
		{
			elem.addEventListener(eventType, func, cap);
		}
		else if(elem.attachEvent) 
		{
			elem.attachEvent('on' + eventType, func);
		}
}

Popup.setstyle();
addLoadEvent.add(Popup.popnload);

//backtotop
var backtoTop={
	btID:"link_backtotop",
	mainID:"",
	headerHeight:90,
	initialize:function(){
		document.write("<style>#"+backtoTop.btID+"{display:none}<\/style>");
		addLoadEvent.add(function(){
		  if(ById("main")) {
			backtoTop.mainID= "main";
		  }else if(ById("main_singlecolumn")){
			backtoTop.mainID= "main_singlecolumn";
		  } 
		  if(backtoTop.compareHeight()) ById(backtoTop.btID).style.display="block";
			
		});
	},
	compareHeight:function(){
			if((!ById(backtoTop.btID)) || (!ById(backtoTop.mainID))) return;
			var pageHeight=ById(backtoTop.mainID).clientHeight+backtoTop.headerHeight;
			var screenHeight=document.documentElement.clientHeight ||  window.innerHeight;
			//if(document.documentElement.clientHeight > document.body.clientHeight) screenHeight=document.body.clientHeight;
			//modified 081225 : delete 
			return (pageHeight>screenHeight)? true :false;
	}
}
backtoTop.initialize();

function open_entry(){
	window.open('http://www.juki.co.jp/industrial_e/customer_e/seminar_e/manage_e/entry.html', 'entry',"resizable=1,scrollbars=1,menubar=1,directories=1,status=1,location=1,toolbar=1,width=800,height=700") ;
}

function open_order(){
	window.open('http://www.juki.co.jp/industrial_e/customer_e/seminar_e/manage_e/order.html', 'order',"resizable=1,scrollbars=1,menubar=1,directories=1,status=1,location=1,toolbar=1,width=800,height=700") ;
}


function ajaxSearch_initialize(){
	if($("search_text")){
		Event.observe($("search_text"),"focus",function(e){
			var obj= Event.element(e);
			if (obj.value == 'SEARCH') {
				obj.className="search_active";
				obj.value = '';
			}
		},false);
		Event.observe($("search_text"),"blur",function(e){
			var obj= Event.element(e);
			if (obj.value == '') {
				obj.className="search_inactive";
				obj.value = 'SEARCH';
			}
		},false);
	}
	if($("search_button")){
		Event.observe($("search_button"),"click",function(e){
			blogAjaxJsonSearch('http://www.juki.co.jp/industrial_e/search_data.php', $('search_text').value );
		},false);
	}
}
addLoadEvent.add(ajaxSearch_initialize);


var pdfLink={
	cname:"",	_entrylink:"",	category:"",	_toplevelcategory:"",	entrylink:"",
	_targetObj:"icon_area",targetObj:{},
	
	ifM:false,ifC:false,toplevelcategory:"",hash:"",
	initialize:function(){
		addLoadEvent.add(pdfLink.check);
		pdfLink.entrylink=pdfLink._entrylink.replace("http://www.juki.co.jp/industrial_e/","");
		pdfLink.toplevelcategory=(pdfLink._toplevelcategory=="for Apparel")?0:1;
	},
	check:function(){
		pdfLink.targetObj=$(pdfLink._targetObj);
		new Ajax.Request("http://www.juki.co.jp/industrial_e/pdf_manuals.php",{
			onComplete:function(httpObj){
				var obj=eval("("+httpObj.responseText+")");
				
				if(obj["Manuals"][pdfLink.toplevelcategory][pdfLink.category]){
					obj["Manuals"][pdfLink.toplevelcategory][pdfLink.category].each(function(entries){
						if(entries["pagelink"]) {
							if(typeof entries["pagelink"]=="string"){
								if(entries["pagelink"]==pdfLink.entrylink){
									if(entries["manuals"]) pdfLink.ifM=true;
									if(entries["catalogs"]) pdfLink.ifC=true;
									pdfLink.hash=pdfLink.entrylink;
								}
							} else{
								entries["pagelink"].each(function(pglink,key){
									if(pglink==pdfLink.entrylink){
										if(entries["manuals"]) pdfLink.ifM=true;
										if(entries["catalogs"]) pdfLink.ifC=true;
										pdfLink.hash=pdfLink.entrylink;
									}
								});
							}
						}
					});
				
				}

				pdfLink.finish();
			}
		});
	},
	finish:function(){
		var cou=0;var string=[];
		if(pdfLink.ifC || pdfLink.ifM){
			var hash=pdfLink.hash;
			string[cou++]='<a href="http://www.juki.co.jp/industrial_e/products_e/alldocument.html#'+hash+'">';
			if(pdfLink.ifC) string[cou++]="Catalog";
			if(pdfLink.ifM) string[cou++]=((pdfLink.ifC)?"・":"")+"Manual";
			string[cou++]='</a>';
		} else {
			string[cou++]="<br />";
		}
		//mes(pdfLink.targetObj);
		$("icon_area").innerHTML=string.join("");
	}
}

addLoadEvent.addLast(setHeight);
addLoadEvent.setOnload();

function mes(message){
	document.getElementsByTagName("body")[0].appendChild(document.createTextNode(message));
}
