﻿function popup(url,windowName,width,height,scrollbars,resizable,toolbar,location,statusbar,menubar,left,top)
{
	if(windowName == null || windowName == '')
	{
		JSday = new Date();
		windowName='page'+JSday.getTime();	
	}
	if(width == null || width == '')
	{
		width = 640;	
	}
	if(height == null || height == '')
	{
		height = 480;
	}
	if(scrollbars == null || scrollbars == '')
	{
		scrollbars = 0;	
	}
	if(resizable == null || resizable == '')
	{
		resizable = 0;	
	}
	if(location == null || location == '')
	{
		location = 0;	
	}
	if(statusbar == null || statusbar == '')
	{
		statusbar = 1;	
	}
	if(menubar == null || menubar == '')
	{
		menubar = 0;	
	}
	if(left == null || left == '')
	{
		left = 260;	
	}
	if(top == null || top == '')
	{
		top = 145;	
	}

	newwindow=window.open(url,windowName,'width='+width+',height='+height+',toolbar='+toolbar+',scrollbars='+scrollbars+',location='+location+',statusbar='+statusbar+',menubar='+menubar+',resizable='+resizable+',left='+left+',top='+top);
	
	if (window.focus)
	{
		newwindow.focus()
	}
	return false;
}

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());
}

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 "";
}
