	// Rows highlight effect
	function rowOver(obj)
	{
		//obj.style.backgroundColor = "#DDDDDD";
		obj.style.backgroundColor = "#FFFFCC";
	}
	
	// Rows highlight effect
	function rowOut(obj)
	{
		obj.style.backgroundColor = "";
	}
	
	// Select All Delete Checkbox
	function select_all_checkbox(){
		fr = document.frm;
		
			if(fr.sel_all_chkbox.checked == true){
				for(i=1; i <= fr.num_rows.value; i++){
					
//					alert(fr.showedRows.value+' : '+i);
					if (fr['sel'+i])
						fr['sel'+i].checked = true;
					
					
				}
					
			}else{
				for(i=1; i <= fr.num_rows.value; i++){
					if (fr['sel'+i])
						fr['sel'+i].checked = false;
					

				}			
			
			}

	}
	
	// Store Delete Row ID
	function selected_chkbox(){
	
		fr = document.frm;
	
		var sel_str = '';
		var sel_cnt = 0;
		
		for(i=1; i <= fr.num_rows.value; i++){
			
			
			if (fr['sel'+i]){
				if (fr['sel'+i].checked == true){
					
					sel_str += fr['sel'+i].value + ',';
					sel_cnt++;
					
				}
			}
		}
		
		fr.sel_chkbox_arr.value = sel_str;
		
		if(sel_cnt > 0){
			return true;
			
		}else{
			alert("please select item.")
			return false;

		}
		
	}
	
	// Paging
	function ChgPage(pg){
		fr = document.frm;
		
		fr.page.value = pg;
		if(fr.asc.value != ''){
			if(fr.asc.value	==0)
				fr.asc.value = 1
			else
				fr.asc.value = 0
		}
			
		//getFormElement();
		form_submit();

	}

	// SQL set ordey by
	function SetOrderBy(str){
		fr = document.frm;	
		if (fr.ord.value!='' && fr.ord.value == str){
			if (fr.asc.value == '0')
				fr.asc.value = '1'

			else
				fr.asc.value = '0'

		}else{
			fr.asc.value = '0'

		}

		fr.ord.value = str;

		getFormElement();

	}
	
	//pop Lookup Windows
	function pop_lookup(url, name, w, h){		
		win_status = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=' + w + ',height=' + h;
		popw = window.open(url,name+" lookup",win_status);
		popw.window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
		popw.window.focus();		

		fr = document.frm;
		fr.action= url;
		fr.target= "lookup";
		fr.method = "post";
		fr.submit();
		
		return false;
		
	}
	
	function pop_win(url, name, w, h){		
		win_status = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h;
		popw = window.open(url,name,win_status);
		popw.window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
		//popw.window.moveTo(0, 0);
		popw.window.focus();		
		
		return false;
		
	}
	
	function sort_by(name){
		fr = document.frm
		fr.ord.value = name;
		form_submit()
		
	}
	
	
	function photo_preview(dbt, fld, id){
		pop_win('../main/photo_preview.php?dbt='+dbt+'&fld='+fld+'&id='+id, 'preview', screen.Width, screen.Height);
	
	}
	
	function photo_remove(dbt, fld, id){
		//pop_win('../content/photo_preview.php?dbt='+dbt+'&fld='+fld+'&id='+id, 'preview', 300, 300);
		parent.process.location = '../main/photo_remove.php?dbt='+dbt+'&fld='+fld+'&id='+id;
	
	}		
