/* Copyright . 2007 RedZee Search, All rights reserved.*/

var bseline=540;
var bashorz = 0;
var rdx=0;
var nxtimgid=0;
var _loc = new Array();
var schres = new Array();

function _onload(qry) {
    updateBashorz();
    
	try {document.getElementById('txtinput').focus();} catch(e) {/*Do Nothing*/}
	    try {
		    if (isie) {
				msf();
					}
					    } catch(e){/*Do Nothing*/}
					    
						_reqSearch = assignReq(_reqSearch);
						    _init();
						    
							try {document.getElementById('txtinput').focus();} catch(e) {/*Do Nothing*/}
							
							    if (null != qry && "undefined" != typeof(qry) && 0 < qry.length) {
								    search(qry);
									}
									
									    // no select!
										//disableSelection(document.body);
										    //enableSelection(document.getElementById("txtinput"));
										    
											// alert('enableSelection(document.getElementById("txtinput"))::008');
											}
											
											function _onresize() {
											    updateBashorz();
												_init();
												    nav(0);
												    }
												    
												    function updateBashorz() {
													var w = getScrWidth();
													    if (0 >= w) {
														    w = 1024; // what else to do?
															}
															    bashorz = (w/2)-446;
																try {
																	// 892
																		// document.getElementById("imgNsl").style.left = bashorz+"px";
																		
																			// 968 -> 38
																				// document.getElementById("imgNsl").style.left = (bashorz-38)+"px";
																				
																				    }
																					catch (e) {/*Do Nothing*/}
																					}
																					
																					function _init() {
																					    document.body.onmousemove = body_onmousemove;
																						document.body.onmouseup = body_onmouseup;
																						
																						    // RIGHT X:
																							// (1024 - 290) - 182 = 552
																							
																							    var hghts = new Array();
																								hghts[0] = 0;
																								    hghts[1] = 55;
																									hghts[2] = 150;
																									    hghts[3] = 190;
																									    
																										_loc[0] = new Object();
																										    _loc[1] = new Object();
																											_loc[2] = new Object();
																											    _loc[3] = new Object();
																												_loc[4] = new Object();
																												    _loc[5] = new Object();
																													_loc[6] = new Object();
																													    _loc[7] = new Object();
																														_loc[8] = new Object();
																														
																														    _loc[0].wdth = 120;
																															_loc[0].hght = 88;
																															    _loc[0].x = bashorz;
																																_loc[0].y = bseline-_loc[0].hght-hghts[0];
																																    _loc[0].z = 100;
																																	_loc[0].imglm = null;
																																	
																																	    _loc[1].wdth = 120;
																																		_loc[1].hght = 88;
																																		    _loc[1].x = bashorz;
																																			_loc[1].y = bseline-_loc[1].hght-hghts[0];
																																			    _loc[1].z = 200;
																																				_loc[1].imglm = null;
																																				
																																				    _loc[2].wdth = 201;
																																					_loc[2].hght = 147;
																																					    _loc[2].x = bashorz+36;
																																						_loc[2].y = bseline-_loc[2].hght-hghts[1];
																																						    _loc[2].z = 300;
																																							_loc[2].imglm = null;
																																							
																																							    _loc[3].wdth = 290;
																																								_loc[3].hght = 212;
																																								    _loc[3].x = bashorz+76;
																																									_loc[3].y = bseline-_loc[3].hght-hghts[2];
																																									    _loc[3].z = 400;
																																										_loc[3].imglm = null;
																																										
																																										    _loc[4].wdth = 380;
																																											_loc[4].hght = 277;
																																											    _loc[4].x = bashorz+256;
																																												_loc[4].y = bseline-_loc[4].hght-hghts[3];
																																												    _loc[4].z = 500;
																																													_loc[4].imglm = null;
																																													
																																													    _loc[5].wdth = 290;
																																														_loc[5].hght = 212;
																																														    _loc[5].x = bashorz+526;
																																															_loc[5].y = bseline-_loc[5].hght-hghts[2];
																																															    _loc[5].z = 400;
																																																_loc[5].imglm = null;
																																																
																																																    _loc[6].wdth = 201;
																																																	_loc[6].hght = 147;
																																																	    _loc[6].x = bashorz+655;
																																																		_loc[6].y = bseline-_loc[6].hght-hghts[1];
																																																		    _loc[6].z = 300;
																																																			_loc[6].imglm = null;
																																																			
																																																			    _loc[7].wdth = 120;
																																																				_loc[7].hght = 88;
																																																				    _loc[7].x = bashorz+772;
																																																					_loc[7].y = bseline-_loc[7].hght-hghts[0];
																																																					    _loc[7].z = 200;
																																																						_loc[7].imglm = null;
																																																						
																																																						    _loc[8].wdth = 120;
																																																							_loc[8].hght = 88;
																																																							    _loc[8].x = bashorz+772;
																																																								_loc[8].y = bseline-_loc[8].hght-hghts[0];
																																																								    _loc[8].z = 100;
																																																									_loc[8].imglm = null;
																																																									}
																																																									
																																																									function search (qry) {
																																																									
																																																									//	alert("@debug::search::"+qry);
																																																									
																																																									    hideNotices();
																																																										hideAll();
																																																										    _reqSearch = assignReq(_reqSearch);
																																																											// setSearchLock(true);
																																																											    rdx=0;
																																																												schres = new Array();
																																																												    loadRdzSearch(qry);
																																																												    }
																																																												    
																																																												    function cancelSearch() {
																																																												    
																																																													try {
																																																														setCompletePgs();
																																																															_reqSearch.abort();
																																																															    } catch(e) {/*Do Nothing*/}
																																																															    
																																																																// ...
																																																																
																																																																    setSearchLock(false);
																																																																    }
																																																																    
																																																																    function dispResults (res) {
																																																																	// showDbgMsg("dispResults("+res.length+"): SANITY");
																																																																	
																																																																	
																																																																	    var t3dx = 0;
																																																																		for (var i=0,l=res.length;l>i;i++) {
																																																																			var bmod = i % 2;
																																																																				var X = l - ( (l - i) * (1 - bmod) );
																																																																					var S = ((i + bmod) / 2);
																																																																						var idx = X-S;
																																																																						
																																																																							// top3 count
																																																																								if (res[idx].isTop3) t3dx++;
																																																																								
																																																																								
																																																																									// image & data
																																																																										var imglm = document.createElement("IMG");
																																																																											imglm.id = "com_rzs_ecmajsp_aimg_" + ++nxtimgid;
																																																																												imglm.name = imglm.id;
																																																																													imglm.resdx = idx;
																																																																														imglm.style.cursor = "pointer";
																																																																															imglm.style.cursorDrag = "pointer";
																																																																																imglm.imgdx = 0;
																																																																																	imglm.style.position = "absolute";
																																																																																		imglm.style.display = "none";
																																																																																			imglm.style.border="none";
																																																																																				imglm.onclick = pvwimg_onclick;
																																																																																					imglm.ondblclick = pvwimg_ondblclick;
																																																																																						imglm.ondrag = pvwimg_ondrag;
																																																																																							imglm.ondragstart = pvwimg_ondragstart;
																																																																																								imglm.onmousedown = pvwimg_onmousedown;
																																																																																									imglm.onerror = pvwimg_onerror;
																																																																																										imglm.isthumb = 0;
																																																																																											
																																																																																												imglm.rslthost = res[idx].dispurl;
																																																																																													imglm.src = res[idx].imgageurl;
																																																																																														
																																																																																															imglm.resTitle = truncate(res[idx].title, 58, "...");
																																																																																																imglm.resDescr = truncate(res[idx].descr, 140, "...");
																																																																																																	imglm.resDspurl = truncate(res[idx].dispurl, 35, "...");
																																																																																																		imglm.resTargetUrl = res[idx].targeturl;
																																																																																																			imglm.resEncUrl = res[idx].encurl;
																																																																																																				document.body.appendChild(imglm);
																																																																																																					schres[idx]=imglm;
																																																																																																					
																																																																																																						// info
																																																																																																							// var imgifolm = document.createElement("DIV");
																																																																																																								var imgifolm = document.createElement("SPAN");
																																																																																																									imgifolm.pvwimgId = imglm.id;
																																																																																																										imgifolm.onclick = pvwimg_onclick;
																																																																																																											imgifolm.ondblclick = pvwimg_ondblclick;
																																																																																																												imgifolm.ondrag = pvwimg_ondrag;
																																																																																																													imgifolm.ondragstart = pvwimg_ondragstart;
																																																																																																														imgifolm.onmousedown = pvwimg_onmousedown;
																																																																																																															imgifolm.style.cursor = "pointer";
																																																																																																																imgifolm.style.cursorDrag = "pointer";
																																																																																																																	imgifolm.style.position = "absolute";
																																																																																																																		imgifolm.style.display = "none";
																																																																																																																			imgifolm.style.textAlign = "right";
																																																																																																																				imgifolm.innerHTML = getImgInfo(imglm);
																																																																																																																				
																																																																																																																					// if (res[idx].isTop3)
																																																																																																																						// 20080514
																																																																																																																						//		if (3 > idx)
																																																																																																																						//			imgifolm.style.backgroundColor = "#FFFFCC";
																																																																																																																						//		else
																																																																																																																						//			imgifolm.style.backgroundColor = "#FFFFFF";
																																																																																																																							imgifolm.style.backgroundColor = "#FFFFFF";
																																																																																																																							
																																																																																																																								document.body.appendChild(imgifolm);
																																																																																																																									imglm.imgifolm=imgifolm;
																																																																																																																									    }
																																																																																																																									    
																																																																																																																										// ppc ident
																																																																																																																										    ppcIdent(t3dx);
																																																																																																																										    
																																																																																																																											// initial positioning
																																																																																																																											    if (0 < res.length) {
																																																																																																																												    if (1 == t3dx)
																																																																																																																														nav(-4);
																																																																																																																															else
																																																																																																																																    nav(-3);
																																																																																																																																	}
																																																																																																																																	
																																																																																																																																	    showInitialHlp();
																																																																																																																																		setSearchLock(false);
																																																																																																																																		}
																																																																																																																																		
																																																																																																																																		function ppcIdent(t3dx) {
																																																																																																																																		    if (1 == t3dx) {
																																																																																																																																			    ppcIdentItem(0);
																																																																																																																																				    ppcIdentItem(1);
																																																																																																																																					    ppcIdentItem(schres.length-1);
																																																																																																																																						}
																																																																																																																																						    else {
																																																																																																																																							    ppcIdentItem(0);
																																																																																																																																								    ppcIdentItem(1);
																																																																																																																																									    ppcIdentItem(2);
																																																																																																																																										}
																																																																																																																																										}
																																																																																																																																										
																																																																																																																																										function ppcIdentItem(idx) {
																																																																																																																																										    if (schres.length > idx)
																																																																																																																																											    schres[idx].imgifolm.style.backgroundColor = "#FFFFCC";
																																																																																																																																											    }
																																																																																																																																											    
																																																																																																																																											    /**
																																																																																																																																											     *
																																																																																																																																											      * http://localhost/redzee/betasearch/svc.search.pl?query=
																																																																																																																																											       * /redzee/betasearch/svc.search.pl?query=
																																																																																																																																											        * /search/beta/svc.search.pl?query=
																																																																																																																																											         */
																																																																																																																																											         
																																																																																																																																											         function rdz_onrsc() {
																																																																																																																																											            try {
																																																																																																																																											        	    loadRdzSearchXmlResp();
																																																																																																																																											        		}
																																																																																																																																											        		    catch (e) {
																																																																																																																																											        			    // alert("@debug::rdz_onrsc::EXCEPTION!["+e.desctiption+"]");
																																																																																																																																											        				    showNotice("res_exception");
																																																																																																																																											        					}
																																																																																																																																											        					}
																																																																																																																																											        					
																																																																																																																																											        					function loadRdzSearch(qry) {
																																																																																																																																											        					
																																																																																																																																											        					    // alert("@debug::loadRdzSearch("+qry+"): SANITY");
																																																																																																																																											        					    
																																																																																																																																											        						var url
																																																																																																																																											        							= "/search/search?format=xml&where=Web&query="
																																																																																																																																											        								+ encodeURIComponent(qry)
																																																																																																																																											        									+ "&ts=" + getTs();
																																																																																																																																											        									    _reqSearch.open("GET", url, true);
																																																																																																																																											        										_reqSearch.onreadystatechange = rdz_onrsc;
																																																																																																																																											        										    _reqSearch.send(null);
																																																																																																																																											        										    
																																																																																																																																											        											initPgs();
																																																																																																																																											        											
																																																																																																																																											        											//	alert("@debug::loadRdzSearch("+qry+"): searching:\n\n\t"+url);
																																																																																																																																											        											}
																																																																																																																																											        											
																																																																																																																																											        											function loadRdzSearchXmlResp() {
																																																																																																																																											        											
																																																																																																																																											        											    if (_reqSearch.readyState > 1) {
																																																																																																																																											        												    setPgsSect(PGSSECT_PARSE);
																																																																																																																																											        													    incPgs(1);
																																																																																																																																											        														}
																																																																																																																																											        														
																																																																																																																																											        														    if (_reqSearch.readyState == 4) {
																																																																																																																																											        															    if (_reqSearch.status != 200) {
																																																																																																																																											        																	// showDbgMsg("EXCEPTION!:loadRdzSearchXmlResp:[Invalid HTTP STATUSCD:"+_reqSearch.status+"]");
																																																																																																																																											        																		    return;
																																																																																																																																											        																			    }
																																																																																																																																											        																				}
																																																																																																																																											        																				    else {
																																																																																																																																											        																					    return;
																																																																																																																																											        																						}
																																																																																																																																											        																						
																																																																																																																																											        																						    // exception?    /*encoding or general service failure*/
																																																																																																																																											        																							var docElem = null;
																																																																																																																																											        																							    try {
																																																																																																																																											        																								    docElem = _reqSearch.responseXML.documentElement;
																																																																																																																																											        																									}
																																																																																																																																											        																									    catch (e) {
																																																																																																																																											        																										    showNotice("res_exception");
																																																																																																																																											        																											    return;
																																																																																																																																											        																												}
																																																																																																																																											        																												
																																																																																																																																											        																												    // exception?    /*filter or server-side error*/
																																																																																																																																											        																													var exNodes = selNode(docElem, "exceptions").childNodes;
																																																																																																																																											        																													    if (0 < exNodes.length) {
																																																																																																																																											        																														    switch ( getCDataValue(selNode(exNodes[0], "EXCODE")) ) {
																																																																																																																																											        																															    case "FILTER":
																																																																																																																																											        																																	showNotice("res_filter");
																																																																																																																																											        																																		    break;
																																																																																																																																											        																																			    case "EXCEPTION":
																																																																																																																																											        																																					showNotice("res_exception");
																																																																																																																																											        																																						    break;
																																																																																																																																											        																																							    default:
																																																																																																																																											        																																									showNotice("res_exception");
																																																																																																																																											        																																										    break;
																																																																																																																																											        																																											    }
																																																																																																																																											        																																												    return;
																																																																																																																																											        																																													}
																																																																																																																																											        																																													
																																																																																																																																											        																																													    var rsltsNode = selNode(docElem, "results");
																																																																																																																																											        																																														var rnds = rsltsNode.childNodes;
																																																																																																																																											        																																														
																																																																																																																																											        																																														    // empty?
																																																																																																																																											        																																															if (10 > rnds.length) {
																																																																																																																																											        																																																showNotice("res_emptyresultset");
																																																																																																																																											        																																																	return;
																																																																																																																																											        																																																	    }
																																																																																																																																											        																																																	    
																																																																																																																																											        																																																		setPgs(100-pgsSectParse);
																																																																																																																																											        																																																		    var ary = new Array();
																																																																																																																																											        																																																		    
																																																																																																																																											        																																																		    
																																																																																																																																											        																																																			for (var i=0,l=rnds.length;i<l;i++) {
																																																																																																																																											        																																																				incPgs( (pgsSectParse/l) * (i+1) );
																																																																																																																																											        																																																					if ("result" != rnds[i].nodeName)
																																																																																																																																											        																																																						    continue;
																																																																																																																																											        																																																							    if (1 > rnds[i].childNodes.length)
																																																																																																																																											        																																																									continue;
																																																																																																																																											        																																																									
																																																																																																																																											        																																																										var node = null;
																																																																																																																																											        																																																											var nval = null;
																																																																																																																																											        																																																												var schRes = new Object();
																																																																																																																																											        																																																												
																																																																																																																																											        																																																													// alert("@debug::<xmlproc>::["+rnds[i].nodeName+"]->"+rnds[i].childNodes.length);
																																																																																																																																											        																																																													
																																																																																																																																											        																																																														node = selNode(rnds[i], "DOMAIN");
																																																																																																																																											        																																																															if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																nval = getCDataValue(node);
																																																																																																																																											        																																																																	if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																		schRes.toplvldomain = nval;
																																																																																																																																											        																																																																		
																																																																																																																																											        																																																																			node = selNode(rnds[i], "URL");
																																																																																																																																											        																																																																				if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																					nval = getCDataValue(node);
																																																																																																																																											        																																																																						if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																							schRes.targeturl = nval;
																																																																																																																																											        																																																																							
																																																																																																																																											        																																																																								node = selNode(rnds[i], "URLDESCR");
																																																																																																																																											        																																																																									if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																										nval = getCDataValue(node);
																																																																																																																																											        																																																																											if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																												schRes.dispurl = nval;
																																																																																																																																											        																																																																													if (7 < schRes.dispurl.length && "http://" == schRes.dispurl.substr(0,7)) {
																																																																																																																																											        																																																																														    schRes.dispurl = schRes.dispurl.substr(7);
																																																																																																																																											        																																																																															    }
																																																																																																																																											        																																																																																    schRes.encurl = encodeURIComponent(schRes.targeturl);
																																																																																																																																											        																																																																																    
																																																																																																																																											        																																																																																    	node = selNode(rnds[i], "TITLE");
																																																																																																																																											        																																																																																    		if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																																    			nval = getCDataValue(node);
																																																																																																																																											        																																																																																    				if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																																    					schRes.title = nval;
																																																																																																																																											        																																																																																    					
																																																																																																																																											        																																																																																    						node = selNode(rnds[i], "DESCRIPTION");
																																																																																																																																											        																																																																																    							if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																																    								nval = getCDataValue(node);
																																																																																																																																											        																																																																																    									if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																																    										schRes.descr = nval;
																																																																																																																																											        																																																																																    										
																																																																																																																																											        																																																																																    											node = selNode(rnds[i], "WEIGHT");
																																																																																																																																											        																																																																																    												if (null == node || "undefined" == typeof(node)) continue;
																																																																																																																																											        																																																																																    													nval = getCDataValue(node);
																																																																																																																																											        																																																																																    														if (null == nval || "undefined" == typeof(nval) || 0 == nval.length) continue;
																																																																																																																																											        																																																																																    															schRes.sortweight = nval;
																																																																																																																																											        																																																																																    															
																																																																																																																																											        																																																																																    																// image sourcation
																																																																																																																																											        																																																																																    																	node = selNode(rnds[i], "IMGURL");
																																																																																																																																											        																																																																																    																		if (null == node || "undefined" == typeof(node))
																																																																																																																																											        																																																																																    																			    nval = null;
																																																																																																																																											        																																																																																    																				    else
																																																																																																																																											        																																																																																    																						nval = getCDataValue(node);
																																																																																																																																											        																																																																																    																							if (null == nval || "undefined" == typeof(nval) || 0 == nval.length)
																																																																																																																																											        																																																																																    																								    schRes.imgageurl = "http://www.redzee.com/images/Stream12.png";
																																																																																																																																											        																																																																																    																									    else
																																																																																																																																											        																																																																																    																											schRes.imgageurl = nval;
																																																																																																																																											        																																																																																    																											
																																																																																																																																											        																																																																																    																												node = selNode(rnds[i], "ISTOP3");
																																																																																																																																											        																																																																																    																													if (null == node || "undefined" == typeof(node))
																																																																																																																																											        																																																																																    																														    schRes.isTop3 = false;
																																																																																																																																											        																																																																																    																															    else {
																																																																																																																																											        																																																																																    																																	nval = getCDataValue(node);
																																																																																																																																											        																																																																																    																																		    if (null == nval || "undefined" == typeof(nval) || 0 == nval.length || "true" != nval)
																																																																																																																																											        																																																																																    																																				    schRes.isTop3 = false;
																																																																																																																																											        																																																																																    																																						else
																																																																																																																																											        																																																																																    																																								schRes.isTop3 = true;
																																																																																																																																											        																																																																																    																																									}
																																																																																																																																											        																																																																																    																																									
																																																																																																																																											        																																																																																    																																										ary[ary.length] = schRes;
																																																																																																																																											        																																																																																    																																										    }
																																																																																																																																											        																																																																																    																																											setCompletePgs();
																																																																																																																																											        																																																																																    																																											    dispResults(ary);
																																																																																																																																											        																																																																																    																																											    
																																																																																																																																											        																																																																																    																																												// ./suggestions/SUGGESTION/CDATA/text
																																																																																																																																											        																																																																																    																																												    rsltsNode = selNode(docElem, "suggestions");
																																																																																																																																											        																																																																																    																																													rnds = rsltsNode.childNodes;
																																																																																																																																											        																																																																																    																																													    for (var i=0,l=rnds.length;l>i;i++) {
																																																																																																																																											        																																																																																    																																														    // alert("@debug::[search.007.js]::loadRdzSearchXmlResp(): rnds[@length="+rnds.length+"];rnds["+i+"][@nodeName="+rnds[i].nodeName+"]");
																																																																																																																																											        																																																																																    																																															    if ("SUGGESTION" != rnds[i].nodeName) continue;
																																																																																																																																											        																																																																																    																																																    var s = getCDataValue(rnds[i]);
																																																																																																																																											        																																																																																    																																																	    if (null != s && "undefined" != typeof(s) && 0 < s.length) {
																																																																																																																																											        																																																																																    																																																			// s = s.replace(/"/gi,"\\\"");
																																																																																																																																											        																																																																																    																																																				    // alert("@debug::[search.007.js]::loadRdzSearchXmlResp(): [@dym="+s+"]");
																																																																																																																																											        																																																																																    																																																						dym(s);
																																																																																																																																											        																																																																																    																																																							    break;
																																																																																																																																											        																																																																																    																																																								    }
																																																																																																																																											        																																																																																    																																																									}
																																																																																																																																											        																																																																																    																																																									}
																																																																																																																																											        																																																																																    																																																									
																																																																																																																																											        																																																																																    																																																									function getImgInfo(imglm) {
																																																																																																																																											        																																																																																    																																																									    var htmlStr
																																																																																																																																											        																																																																																    																																																										    = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%;height:100%;table-layout:fixed;\">"
																																																																																																																																											        																																																																																    																																																											    + "<tr>"
																																																																																																																																											        																																																																																    																																																												    + "<td width=\"*\" align=\"left\" nowrap>"
																																																																																																																																											        																																																																																    																																																													    + "<font size=\"2\" face=\"Verdana\">"+(getImgInfoIdx(imglm))+"://"+imglm.resDspurl+"</font>"
																																																																																																																																											        																																																																																    																																																														    + "</td>"
																																																																																																																																											        																																																																																    																																																															    + "</tr>"
																																																																																																																																											        																																																																																    																																																																    + "</table>"
																																																																																																																																											        																																																																																    																																																																	;
																																																																																																																																											        																																																																																    																																																																	    return htmlStr;
																																																																																																																																											        																																																																																    																																																																	    }
																																																																																																																																											        																																																																																    																																																																	    
																																																																																																																																											        																																																																																    																																																																	    function getImgInfoIdx(imglm) {
																																																																																																																																											        																																																																																    																																																																		var idx = (imglm.resdx-0) + 1;
																																																																																																																																											        																																																																																    																																																																		    idx = "000"+idx;
																																																																																																																																											        																																																																																    																																																																			idx = idx.substr(idx.length-3);
																																																																																																																																											        																																																																																    																																																																			    return idx;
																																																																																																																																											        																																																																																    																																																																			    }
																																																																																																																																											        																																																																																    																																																																			    
																																																																																																																																											        																																																																																    																																																																			    function setSearchLock(lck) {
																																																																																																																																											        																																																																																    																																																																			    
																																																																																																																																											        																																																																																    																																																																				document.getElementById("btn_search").disabled=lck;
																																																																																																																																											        																																																																																    																																																																				
																																																																																																																																											        																																																																																    																																																																				//	if (lck) {
																																																																																																																																											        																																																																																    																																																																				//		document.getElementById("btn_search").style.display="none";
																																																																																																																																											        																																																																																    																																																																				//		document.getElementById("btn_cancel").style.display="inline";
																																																																																																																																											        																																																																																    																																																																				//	}
																																																																																																																																											        																																																																																    																																																																				//	else {
																																																																																																																																											        																																																																																    																																																																				//		document.getElementById("btn_cancel").style.display="none";
																																																																																																																																											        																																																																																    																																																																				//		document.getElementById("btn_search").style.display="inline";
																																																																																																																																											        																																																																																    																																																																				//	}
																																																																																																																																											        																																																																																    																																																																				}
																																																																																																																																											        																																																																																    																																																																				
																																																																																																																																											        																																																																																    																																																																				function showNotice(name) {
																																																																																																																																											        																																																																																    																																																																				
																																																																																																																																											        																																																																																    																																																																				    // showNotice("res_filter");
																																																																																																																																											        																																																																																    																																																																					// showNotice("res_emptyresultset");
																																																																																																																																											        																																																																																    																																																																					    // showNotice("res_exception");
																																																																																																																																											        																																																																																    																																																																					    
																																																																																																																																											        																																																																																    																																																																						setCompletePgs();
																																																																																																																																											        																																																																																    																																																																						    showWin(name, false, "center", "120px");
																																																																																																																																											        																																																																																    																																																																						    }
																																																																																																																																											        																																																																																    																																																																						    
																																																																																																																																											        																																																																																    																																																																						    function hideNotices() {
																																																																																																																																											        																																																																																    																																																																							hideWin("res_filter");
																																																																																																																																											        																																																																																    																																																																							    hideWin("res_emptyresultset");
																																																																																																																																											        																																																																																    																																																																								hideWin("res_exception");
																																																																																																																																											        																																																																																    																																																																								}
																																																																																																																																											        																																																																																    																																																																								
																																																																																																																																											        																																																																																    																																																																								