  function linkto(link)
  {
  location.href=link;
  }
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 = "/rca_av/jsps/includes/largeimage.jsp?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 openModalDialog(url){
 window.open(url,target='newwindow','width=1024px,height=668px');
}
function openInExternalWindowsmallpopup(url){
	window.open(url,target='newwindow','width=800,height=600');
}
function openInSameWindow(url){
	window.open(url,target="_self");
}
function validate_search(search){
	trim_search=trim(search);
	if(trim_search == null || trim_search == ""   || trim_search == "Find a Product"){
		alert("Please Enter a valid keyword !");
		
		
		return false;
	} else{
		return true;
	}
	
}
function validate_manual(manual){
trim_manual=trim(manual);
	if(trim_manual == null || trim_manual == "" || trim_manual=="Find a Manual"){
		alert("Enter Valid Model number");
		
		
		return false;
	} else{
		return true;
	}
	
}
		function remName(a, b){
		if(a.value==b){
		a.value='';
		}else if(a.value==''){
		a.value=b;
		}else{
		a.value=a.value;
		}
		}
		 
		function chkName(a, b){
		if(a.value==''){
		a.value=b;
		}else{
		a.value=a.value;
		}
		}
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 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';
}
