﻿function handleLinks(action, input, value)
{
	var obj = document.generic_form;
	obj.TMP.value = value;
	obj.action = action;
	obj.submit();	
}
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function addField(obj, name, val) 
{
	 if(!document.getElementById) return; //Prevent older browsers from getting any further.
 
	 if(document.createElement) //W3C Dom method.
	 { 
		var input	= document.createElement("input");
		input.id	= name;
		input.name	= name;
		input.type	= "hidden"; //Type of field - can be any valid input type like text,file,checkbox etc.
		input.value = val
		obj.appendChild(input);
	 }
}
function handleSearch(obj)
{
	var cookiename = skw_cookie
	if (! obj.skw.value ) 
	{ 
		return false; 
	}
	else 
	{ 
		return setCookie(cookiename, obj.skw.value, 1)
	}
}
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name + "=" + escape(value) +((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	
	if ( ! getCookie(c_name) )
	{
		return false
	}
	return true
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}								
function setTitle(str)
{
	document.title = document.title + " - " + str
}





