// small routine that reloads the page if we have a nn 4 userclient
if(document.layers){
	origWidth=innerWidth;
	origHeight=innerHeight;
	onresize=function(){
		if(innerWidth!=origWidth||innerHeight!=origHeight)
		location.reload();
	}
}
function search(indexDb) {
	var form = document.forms['SearchForm'];
	var s = form.Search.value;
stext = '/' + indexDb + '/Search?ReadForm&Query=[ProductName]=' + s + '*|[ComText]=' + s + '*|[IngrInfo11]=' + s + '*|[IngrInfo05]=' + s + '*|[Ingr04a]=' + s + '*|[Ingr04a2]=' + s + '*|[Ingr04b]=' + s + '*|[Ingr04c]=' + s + '*|[Ingr04d]=' + s + '*|[IngrInfo01]=' + s + '*|[body]=' + s + '*|[title]=' + s + '*|[category]=' + s + '*&View=HTMLSearchTemplate&View2=HTMLSearchProductTemplate&SortBy=&count=10&start=0&site=docs&';
	location = stext ;
}
function flipcss(object) {
	//delCookie('csscookie');
	//var csscookie = getCookie(csscookie);
	//if (csscookie != object.value) {
		setCookie('csscookie', object.value, 'Wednesday, 09-Nov-09 23:12:40 GMT', '/');
		location = location.href;
	//}
	//var addstyle = location.href + '&style=' + object.value;
	//newstyle = object.value == 'default.css' ? location.href.replace("defaultlarge.css", object.value) : location.href.replace("default.css", object.value);
	
}
function flipview(value) {
	setCookie('viewcookie', value, 'Wednesday, 09-Nov-09 23:12:40 GMT', '/');
	location = location.href;	
}

function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}


function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}


function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

