function openInNewWindow(url){
    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=546,height=671');
	}
}


function openVideoInNewWindow(url){
	window.open(url,target="newwindow",'width=370,height=320');
}
function openInExternalWindow(url){
	window.open(url,target='newwindow');
}
function openInExternalWindowsmallpopup(url){
	window.open(url,target='newwindow','width=800,height=600');
}
function openInSameWindow(url){
	window.open(url,target="_self");
}
function validate_search(search){

	if(search !=null)
	{
		search  = trim(search," ");
	}
	if(search == null || trim(search) == ""){
		alert("Enter a word or phrase");
		
		
		return false;
	} else{
		return true;
	}
	
}
function validate_search(search){
	if(search == null || trim(search) == ""   || search == "Find A Product"){
		alert("Please Enter a valid keyword !");
		
		
		return false;
	} else{
		return true;
	}
	
}
function validate_manual(manual){
	if(manual == null || trim(manual) == "" || manual=="Find A Manual"){
		alert("Enter Valid Model number");
		
		
		return false;
	} else{
		return true;
	}
	
}
function validate_form(thisform){
	if(thisform !=null)
	{
		thisform  = trim(thisform," ");
	}
	if(thisform == null || thisform == ""){
		alert("Select SKU");
		
		
		return false;
	} else{
		return true;
	}
	}
function changecolor()
{
//alert("chnge");
document.getElementById("display_table").style.color="#000000";
}

/**
*
*  Javascript trim, ltrim, rtrim
*  http://www.webtoolkit.info/
*
**/
 
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"), "");
}

function showtip(tip){
    var dv = document.getElementById(tip);
    dv.style.display = 'inline';
}
function hidetip(tip){
    var dv = document.getElementById(tip);
    dv.style.display = 'none';
}


