﻿function colorRow(cell){	
	for(i=0;i<cell.cells.length;++i)
		cell.cells(i).style.backgroundColor="#996666";
}
function resetRow(cell,th_cell){	
	for(i=0;i<cell.cells.length;++i){
		if(i == 0 || i == 1)
			cell.cells(i).style.backgroundColor="#596F7D";
		else if(th_cell && i == 2)
				cell.cells(i).style.backgroundColor="#596F7D";
			else
				cell.cells(i).style.backgroundColor="#647c8e";
	}
}
function delete_conf(row_no,link_to){
	yes = confirm("Are you sure you want to delete row number\""+row_no+"\"");
	if(yes){
		window.navigate(link_to+"&del_row_no="+row_no);	
	}
}
function empty_conf(row_no,link_to){
	yes = confirm("Are you sure you want to empty profile row number\""+row_no+"\"");
	if(yes){
		window.navigate(link_to+"&empty_prof=1");	
	}
}
function getCookie(cookie_name_str){
		cookie_str = document.cookie;
		cookie_len_int = cookie_str.length;
		cookie_name_len_int = cookie_name_str.length;
		cookie_name_pos_int = cookie_str.indexOf(cookie_name_str);
		if(cookie_name_pos_int != -1){
			value_start_pos_int = cookie_name_pos_int + cookie_name_len_int +1;
			value_end_pos_int = cookie_str.indexOf(";",value_start_pos_int);
			if(value_end_pos_int == -1){
				value_end_pos_int = cookie_len_int - value_start_pos_int;						
			}else{
				value_end_pos_int -= value_start_pos_int;
			}
			return unescape(cookie_str.substr(value_start_pos_int,value_end_pos_int));
		}
		return null;		
}
function setCookie(name_str,value_str,days_int,hours_int,minutes_int,seconds_int){
	exp_date = new Date();
	days_int *= 24*60*60*1000;
	hours_int *= 60*60*1000;
	minutes_int *= 60*1000;
	seconds_int *= 1000;
	exp_date_int = exp_date.getTime() + days_int + hours_int + minutes_int + seconds_int;
	exp_date.setTime(exp_date_int);
	document.cookie = name_str + "=" + escape(value_str) + "; expires=" + exp_date.toGMTString();
}
function inArray(array_array,value){
	for(i=0;i<array_array.length;++i){
		if(array_array[i] == value)
			return true;
	}
	return false;
}
function maximizedWindow(url,name){
	window.open(url,
        	name,"toolbar=no,location=no,directories=no,staus=no,menubar=no,scrollbars=yes,resizable=no,fullscreen=yes");
}