function openInNewWindow1(url,root){
    if(url.indexOf(".pdf") > -1 || url.indexOf(".PDF") > -1){
    	window.open(url,target='newwindow','resizable=1,width=700,height=500');
    }else{
    	var link =root+"/largeimage?ImgName="+url;
	window.open(link,target='newwindow','width=510,height=510');
	}
}

function openInNewWindow(url){
    if(url.indexOf(".pdf") > -1 || url.indexOf(".PDF") > -1){
    	window.open(url,target='newwindow','resizable=1,width=700,height=500');
    }else{
    	
	window.open(link,target='newwindow','width=510,height=510');
	}
}
function openInExternalWindow(url){
	window.open(url,target="newwindow");
}
function openInSameWindow(url){
	window.open(url,target="_top");
}

function validate_manual(manual){
	if(manual == null || trim(manual) == "" || manual=="Find A Manual"){
		alert("Enter Valid Model number");
		
		
		return false;
	} else{
		return true;
	}
	
}

function openFlashInExternalWindow(url){
	window.open(url,target="newwindow",'type=application/x-shockwave-flash,quality=high,pluginspage=http://www.macromedia.com/go/getflashplayer,width=510,height=510');
}



function remName(a) {
var b = document.getElementById('searchbox').value;
	if (a.value == b) {
		a.value = "";
	} else {
		if (a.value == "") {
			a.value = b;
		} else {
			a.value = a.value;
		}
	}
}
function chkName(a) {
var b = document.getElementById('searchbox').value;
	if (a.value == "") {
		a.value = b;
	} else {
		a.value = a.value;
	}
}
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

