if(!dpss) var dpss = {};
if(!dpss.common) dpss.common = {};

dpss.common.getCookie = function(key,  tmp1, tmp2, xx1, xx2, xx3) {	//#02
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) {
			return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
		}
		xx1 = xx2 + 1;
	}
	return("");
};
dpss.common.setCookie = function(key, val,exdays) {	//#02
	var d = new Date();
	d.setDate(d.getDate() + exdays);
	var s = key + "=" + escape(val);
	s += (exdays == undefined) ? "" : ";expires=" + d.toGMTString();
	document.cookie = s;
};
dpss.common.clearCookie = function(key) {	//#02
	document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
};

dpss.common.ajaxGetData = function(url, parameter, complete, failure, exeption, asynchronous) {
	parameter = parameter.escapeHTML();
	var option = {
		method: 'get',
		parameters: parameter,
		asynchronous: asynchronous,
		onComplete : complete,
		onFailure : failure,
		onException : exeption
	};
	new Ajax.Request(url, option);
};
dpss.common.ajaxPostData= function(url, data, complete, failure, exeption, asynchronous) {
	var option = {
		method: 'post',
		postBody : data,
		asynchronous: asynchronous,
		onComplete : complete,
		onFailure : failure,
		onException : exeption
	};
	return new Ajax.Request(url, option);
};

dpss.common.ajaxUpdate = function(url, method, data, element, complete, failure, exeption){
	var option = {
		method: method,
		onComplete : complete,
		onFailure : failure,
		onException : exeption
	};
	if(method.toUperCase == "POST") {
		option.postBody = data;
	} else {
		option.parameters = data;
	}
	new Ajax.Updater({success:element}, url, option);
};

dpss.common.MM_swapImgRestore = function() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
};

dpss.common.MM_preloadImages = function() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=dpss.common.MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
};

dpss.common.MM_findObj = function(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=dpss.common.MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
};

dpss.common.MM_swapImage = function() { //v3.0
	var i,j=0,x,a=dpss.common.MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=dpss.common.MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};
dpss.common.MM_openBrWindow = function(theURL,winName,features) { //v2.0
  var win = window.open(theURL,winName,features);
  return win;
};